[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` + `fzf`
+ `ripgrep` (`nvim` needs this) + `ripgrep` (`nvim` needs this)
+ `ripgrep-all` (used in `wofi`; `sway`) + `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) + all `fcitx5` stuff (data, gtk, qt, mozc)
### theming stuff (sway) ### theming stuff (sway)

View File

@@ -106,26 +106,26 @@ local has_words_before = function()
end end
cmp.setup({ cmp.setup({
mapping = { mapping = {
["<Tab>"] = cmp.mapping(function(fallback) -- Advance to next parameter -- ["<Tab>"] = cmp.mapping(function(fallback) -- Advance to next parameter
if cmp.visible() then -- if cmp.visible() then
cmp.select_next_item() -- 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 has_words_before() then -- elseif has_words_before() then
cmp.complete() -- cmp.complete()
else -- else
fallback() -- fallback()
end -- end
end, { "i", "s" }), -- end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback) -- Got back to last parameter -- ["<S-Tab>"] = cmp.mapping(function(fallback) -- Got back to last parameter
if cmp.visible() then -- if cmp.visible() then
cmp.select_prev_item() -- cmp.select_prev_item()
elseif luasnip.jumpable(-1) then -- elseif luasnip.jumpable(-1) then
luasnip.jump(-1) -- luasnip.jump(-1)
else -- else
fallback() -- fallback()
end -- end
end, { "i", "s" }), -- end, { "i", "s" }),
["<C-k>"] = cmp.mapping.select_prev_item(), ["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-j>"] = cmp.mapping.select_next_item(), ["<C-j>"] = cmp.mapping.select_next_item(),
["<C-l>"] = cmp.mapping.confirm({ ["<C-l>"] = cmp.mapping.confirm({