From 76d798761694fdeb89e542beb02edffffcd6f35e Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Sun, 7 Jun 2026 15:45:02 +0200 Subject: misc(nvim): add key mappings for jumping between snippets --- plugin/50-completion.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugin/50-completion.lua') diff --git a/plugin/50-completion.lua b/plugin/50-completion.lua index fe418e8..caf749d 100644 --- a/plugin/50-completion.lua +++ b/plugin/50-completion.lua @@ -27,6 +27,14 @@ vim.keymap.set("i", "", function() return vim.fn.pumvisible() == 1 and "" or "" end, { expr = true }) +-- Jump between snippet placeholders, falling back to native behavior when no snippet is active +vim.keymap.set({ "i", "s" }, "", function() + return vim.snippet.active({ direction = 1 }) and "lua vim.snippet.jump(1)" or "" +end, { expr = true }) +vim.keymap.set({ "i", "s" }, "", function() + return vim.snippet.active({ direction = -1 }) and "lua vim.snippet.jump(-1)" or "" +end, { expr = true }) + ------------------------------------------------------------------------------------------------------------------------ -- Command-line mode completion ------------------------------------------------------------------------------------------------------------------------ -- cgit v1.3.1