Update nvim-cmp configuration for new versions

pull/2/head
Ensar Sarajčić 2022-04-14 10:21:54 +02:00
parent 83614f4365
commit 4138293837
1 changed files with 15 additions and 1 deletions

View File

@ -17,7 +17,21 @@ cmp.setup {
["<C-f>"] = cmp.mapping.scroll_docs(4), ["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(), ["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(), ["<C-e>"] = cmp.mapping.close(),
["<C-y>"] = cmp.mapping.confirm({select = true}) ["<C-y>"] = cmp.mapping.confirm({select = true}),
["<C-n>"] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end,
["<C-p>"] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end
}, },
sources = { sources = {
{name = "nvim_lsp"}, {name = "nvim_lsp"},