[nvim] don't use tab to jump to next snippet position

This commit is contained in:
Marco Thomas
2022-10-26 23:46:37 +02:00
parent 2d5b4ecf7d
commit 56be4ed7bc
2 changed files with 21 additions and 21 deletions

View File

@@ -28,7 +28,7 @@ Only used in sway.
+ `fzf`
+ `ripgrep` (`nvim` needs this)
+ `ripgrep-all` (used in `wofi`; `sway`)
+ `fd` (rust find; used in `sway`)
+ `fd` (rust find; used in `sway` and `nvim`)
+ all `fcitx5` stuff (data, gtk, qt, mozc)
### theming stuff (sway)

View File

@@ -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({