From 1afa56764aaddbbc4253c8e61086aedec2340efd Mon Sep 17 00:00:00 2001 From: bh Date: Thu, 13 Nov 2025 19:55:39 +0800 Subject: LuaSnips Stuff --- lua/config/luasnip.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lua/config/luasnip.lua (limited to 'lua/config/luasnip.lua') diff --git a/lua/config/luasnip.lua b/lua/config/luasnip.lua new file mode 100644 index 0000000..f3b39b4 --- /dev/null +++ b/lua/config/luasnip.lua @@ -0,0 +1,20 @@ +return function() + local ls = require("luasnip") + + -- Expand snippet + vim.keymap.set("i", "", function() ls.expand() end, { silent = true }) + + -- Jump forward/backward + vim.keymap.set({ "i", "s" }, "", function() ls.jump(1) end, { silent = true }) + vim.keymap.set({ "i", "s" }, "", function() ls.jump(-1) end, { silent = true }) + + -- Change choice in choice node + vim.keymap.set({ "i", "s" }, "", function() + if ls.choice_active() then + ls.change_choice(1) + end + end, { silent = true }) + + -- Optionally, load snippets here if you have them + -- require("luasnip.loaders.from_vscode").lazy_load() +end -- cgit v1.2.3