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
1 changed files with 4 additions and 4 deletions

View File

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