diff options
| author | bh <qn+git@excalibur.computer> | 2025-11-13 19:55:39 +0800 |
|---|---|---|
| committer | bh <qn+git@excalibur.computer> | 2025-11-13 19:55:39 +0800 |
| commit | 1afa56764aaddbbc4253c8e61086aedec2340efd (patch) | |
| tree | c66c56f2b66f77031566904e9f93e648b17e61bb /lua/config/luasnip.lua | |
| parent | cfaa4eb06d8353288aa19238c6519a29a9df5d75 (diff) | |
LuaSnips Stuff
Diffstat (limited to 'lua/config/luasnip.lua')
| -rw-r--r-- | lua/config/luasnip.lua | 20 |
1 files changed, 20 insertions, 0 deletions
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", "<C-K>", function() ls.expand() end, { silent = true }) + + -- Jump forward/backward + vim.keymap.set({ "i", "s" }, "<C-L>", function() ls.jump(1) end, { silent = true }) + vim.keymap.set({ "i", "s" }, "<C-J>", function() ls.jump(-1) end, { silent = true }) + + -- Change choice in choice node + vim.keymap.set({ "i", "s" }, "<C-E>", 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 |
