feat: improve snippet completion

This commit is contained in:
Moritz Böhme 2024-08-18 12:31:09 +02:00
parent 667b7a9db3
commit 9e2c4205d9
Signed by: moritz
GPG key ID: 970C6E89EB0547A9

View file

@ -13,9 +13,6 @@ cmp.setup({
},
}),
},
enabled = function()
return not luasnip.jumpable(1)
end,
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
@ -49,6 +46,8 @@ cmp.setup({
["<C-n>"] = cmp.mapping(function(fallback)
if luasnip.choice_active() then
luasnip.change_choice(1)
elseif luasnip.locally_jumpable(1) then
luasnip.jump(1)
else
fallback()
end
@ -56,6 +55,8 @@ cmp.setup({
["<C-p>"] = cmp.mapping(function(fallback)
if luasnip.choice_active() then
luasnip.change_choice(-1)
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end