fix(auto-completion): ensure first menu item is selected by default

This commit is contained in:
Shashwat Agrawal 2023-11-11 20:31:05 +05:30
parent a005f15cec
commit af4f51b2cd

View File

@ -564,6 +564,9 @@ cmp.setup {
luasnip.lsp_expand(args.body) luasnip.lsp_expand(args.body)
end, end,
}, },
completion = {
completeopt = 'menu,menuone,noinsert'
},
mapping = cmp.mapping.preset.insert { mapping = cmp.mapping.preset.insert {
['<C-n>'] = cmp.mapping.select_next_item(), ['<C-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(), ['<C-p>'] = cmp.mapping.select_prev_item(),