diff options
Diffstat (limited to 'nvim/lua/plugins/completion.lua')
-rw-r--r-- | nvim/lua/plugins/completion.lua | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/nvim/lua/plugins/completion.lua b/nvim/lua/plugins/completion.lua index 4d46317..1a4ef7a 100644 --- a/nvim/lua/plugins/completion.lua +++ b/nvim/lua/plugins/completion.lua @@ -2,30 +2,47 @@ return { { "hrsh7th/nvim-cmp", dependencies = { - 'neovim/nvim-lspconfig', 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-path', - 'hrsh7th/cmp-cmdline' + 'hrsh7th/cmp-cmdline', + 'hrsh7th/cmp-vsnip', + 'hrsh7th/vim-vsnip' }, config = function() local cmp = require'cmp' cmp.setup { snippet = { - expand = function() - vim.snippet.expand(args.body) + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) end, }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(), }, + mapping = cmp.mapping.preset.insert({ + ['<C-Space>'] = cmp.mapping.complete(), + ['<C-e>'] = cmp.mapping.abort(), + ['<CR>'] = cmp.mapping.confirm({ select = true }), + }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, + { name = 'vsnip' }, },{ { name = 'buffer' }, }) } end, + },{ + 'neovim/nvim-lspconfig', + config = function() + local lspconfig = require('lspconfig') + + lspconfig.rust_analyzer.setup {} + lspconfig.pyright.setup {} + lspconfig.clangd.setup {} + end, + }, } |