try to make nvim-cmp and luasnip work together
This commit is contained in:
parent
18e0c512d7
commit
e2c65f5243
1 changed files with 7 additions and 7 deletions
|
@ -8,7 +8,7 @@ cmp.setup {
|
|||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-e"] = cmp.mapping.abort(),
|
||||
["<C-h"] = cmp.mapping.abort(),
|
||||
|
||||
["<C-k>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
|
@ -25,20 +25,20 @@ cmp.setup {
|
|||
end),
|
||||
|
||||
["<C-n>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.locally_jumpable(1) then
|
||||
if luasnip.locally_jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
elseif cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<C-p>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
if luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
elseif cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue