From 3d04b09581fcbd810584a13d169613236cdbbcd2 Mon Sep 17 00:00:00 2001 From: Rawley Fowler <75388349+rawleyfowler@users.noreply.github.com> Date: Tue, 26 Jul 2022 08:01:17 -0600 Subject: [PATCH] Update lsp.lua --- neovim/after/plugin/lsp.lua | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/neovim/after/plugin/lsp.lua b/neovim/after/plugin/lsp.lua index 6e54ebb..7813241 100644 --- a/neovim/after/plugin/lsp.lua +++ b/neovim/after/plugin/lsp.lua @@ -24,10 +24,11 @@ cmp.setup({ }, mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 'c' }), + [''] = cmp.mapping.confirm({ select = true }), [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), + [''] = cmp.mapping.complete(), }), formatting = { @@ -102,3 +103,16 @@ require('luasnip.loaders.from_vscode').lazy_load({ include = nil, exclude = {}, }) + +-- Auto complete +vim.cmd([[ +" Use and to navigate through popup menu +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\" : "\" + +" Set completeopt to have a better completion experience +set completeopt=menuone,noinsert,noselect + +" Avoid showing message extra message when using completion +set shortmess+=c +]])