fix: Restore some keybindings to nvim-cmp

In recent versions, nvim-cmp plugin has dropped the default keybindings
that had to use the plugin, enforcing users to set their own.
This commit is contained in:
Dionisio E Alonso 2022-05-11 09:15:04 -03:00
parent 39bc82d399
commit 800653ff28
1 changed files with 7 additions and 1 deletions

View File

@ -53,7 +53,13 @@ local on_attach = function(client, bufnr)
virtual_text = false
}
)
require("cmp").setup {
local cmp = require("cmp")
cmp.setup {
mapping = {
["<C-n>"] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert },
["<C-p>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert },
},
formatting = {format = cmp_format},
sources = {
{name = "nvim_lsp"},