local nvim_lsp = require'lspconfig' local function setup_servers() require'lspinstall'.setup() local servers = require'lspinstall'.installed_servers() for _, lsp in pairs(servers) do nvim_lsp[lsp].setup{} end end local opts = { tools = { autoSetHints = true, hover_with_actions = true, runnables = { use_telescope = true }, inlay_hints = { show_parameter_hints = false, parameter_hints_prefix = "", other_hints_prefix = "", }, }, -- all the opts to send to nvim-lspconfig -- these override the defaults set by rust-tools.nvim -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer server = {}, -- rust-analyer options } require('rust-tools').setup(opts) setup_servers() require'lspinstall'.post_install_hook = function () setup_servers() vim.cmd("bufdo e") end local cmp = require'cmp' cmp.setup({ snippet = { expand = function(args) vim.fn["vsnip#anonymous"](args.body) end, }, mapping = { [''] = cmp.mapping.select_prev_item(), [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.select_prev_item(), [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.close(), [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true, }) }, -- Installed sources sources = { { name = 'nvim_lsp' }, { name = 'vsnip' }, { name = 'path' }, { name = 'buffer' }, }, })