[nvim] don't use tab to jump to next snippet position
This commit is contained in:
@@ -106,26 +106,26 @@ local has_words_before = function()
|
||||
end
|
||||
cmp.setup({
|
||||
mapping = {
|
||||
["<Tab>"] = cmp.mapping(function(fallback) -- Advance to next parameter
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback) -- Got back to last parameter
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
-- ["<Tab>"] = cmp.mapping(function(fallback) -- Advance to next parameter
|
||||
-- if cmp.visible() then
|
||||
-- cmp.select_next_item()
|
||||
-- elseif luasnip.expand_or_jumpable() then
|
||||
-- luasnip.expand_or_jump()
|
||||
-- elseif has_words_before() then
|
||||
-- cmp.complete()
|
||||
-- else
|
||||
-- fallback()
|
||||
-- end
|
||||
-- end, { "i", "s" }),
|
||||
-- ["<S-Tab>"] = cmp.mapping(function(fallback) -- Got back to last parameter
|
||||
-- if cmp.visible() then
|
||||
-- cmp.select_prev_item()
|
||||
-- elseif luasnip.jumpable(-1) then
|
||||
-- luasnip.jump(-1)
|
||||
-- else
|
||||
-- fallback()
|
||||
-- end
|
||||
-- end, { "i", "s" }),
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||
["<C-l>"] = cmp.mapping.confirm({
|
||||
|
||||
Reference in New Issue
Block a user