diff options
| Commit | 028e1c525d9d01609f8e7470a68bdceef5692ea8 (patch) | |
|---|---|---|
| Author | 2024-11-18 09:35:17 +0200 | |
| Committer | 2024-11-18 09:35:17 +0200 | |
| Files | 0d93f2bb1824ee7cf6c656a309f71cad913e6d14 /lua/plugins | |
| anderson-028e1c525d9d01609f8e7470a68bdceef5692ea8.tar anderson-028e1c525d9d01609f8e7470a68bdceef5692ea8.tar.gz anderson-028e1c525d9d01609f8e7470a68bdceef5692ea8.zip | ||
| Parent | a1925f409fd2f1af21ffa778ae6bbaa53cc57162 (diff) | |
feat(lsp): Autocomplete on tab
1 files changed, 4 insertions, 3 deletions
| -rw-r--r-- | lua/plugins/lsp.lua | 7 |
diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index cf2ca66..45743c4 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,5 +1,5 @@ -- Thanks https://stackoverflow.com/a/70760302/12036073 -vim.o.updatetime = 300 +vim.o.updatetime = 600 vim.diagnostic.config({ virtual_text = false, float = { focus = false }, @@ -50,12 +50,13 @@ return { }, { 'hrsh7th/nvim-cmp', + dependencies = { 'hrsh7th/vim-vsnip' }, lazy = false, opts = { sources = { { name = 'nvim_lsp' } }, snippet = { expand = function(args) - vim.snippet.expand(args.body) + vim.fn["vsnip#anonymous"](args.body) end, }, }, @@ -63,7 +64,7 @@ return { local cmp = require('cmp') opts.mapping = cmp.mapping.preset.insert({ -- -- `Enter` key to confirm completion - -- ['<CR>'] = cmp.mapping.confirm({select = false}), + ['<Tab>'] = cmp.mapping.confirm({select = false}), -- -- -- Ctrl+Space to trigger completion menu ['<C-Space>'] = cmp.mapping.complete(), |
