fix: nvim-cmp config

fix [Tab] behavior
This commit is contained in:
David JULIEN 2021-10-12 14:00:47 +02:00
parent a98e149ad1
commit 05d89420f0

View File

@ -58,8 +58,8 @@ cmp.setup {
select = true,
}),
["<Tab>"] = cmp.mapping(function(fallback)
if vim.fn.pumvisible() == 1 then
vim.fn.feedkeys(t "<C-n>", "n")
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif check_backspace() then
@ -69,8 +69,8 @@ cmp.setup {
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if vim.fn.pumvisible() == 1 then
vim.fn.feedkeys(t "<C-p>", "n")
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else