From 56be4ed7bc8037c137392737165bc6c964976564 Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Wed, 26 Oct 2022 23:46:37 +0200 Subject: [PATCH] [nvim] don't use tab to jump to next snippet position --- README.md | 2 +- files/nvim/.config/nvim/lua/mappings.lua | 40 ++++++++++++------------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 5f66171..1ec7b0f 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/files/nvim/.config/nvim/lua/mappings.lua b/files/nvim/.config/nvim/lua/mappings.lua index 453f2ab..7558217 100644 --- a/files/nvim/.config/nvim/lua/mappings.lua +++ b/files/nvim/.config/nvim/lua/mappings.lua @@ -106,26 +106,26 @@ local has_words_before = function() end cmp.setup({ mapping = { - [""] = 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" }), - [""] = 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" }), + -- [""] = 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" }), + -- [""] = 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" }), [""] = cmp.mapping.select_prev_item(), [""] = cmp.mapping.select_next_item(), [""] = cmp.mapping.confirm({