summaryrefslogtreecommitdiff
path: root/lua/config/.bak/.luasnip.bak.bak
diff options
context:
space:
mode:
Diffstat (limited to 'lua/config/.bak/.luasnip.bak.bak')
-rw-r--r--lua/config/.bak/.luasnip.bak.bak56
1 files changed, 0 insertions, 56 deletions
diff --git a/lua/config/.bak/.luasnip.bak.bak b/lua/config/.bak/.luasnip.bak.bak
deleted file mode 100644
index e0b5617..0000000
--- a/lua/config/.bak/.luasnip.bak.bak
+++ /dev/null
@@ -1,56 +0,0 @@
--- ~/.config/nvim/lua/config/luasnip.lua
-return function()
- local ls = require("luasnip")
- local s = ls.snippet
- local t = ls.text_node
- local i = ls.insert_node
-
- -- Minimal test snippets
- ls.snippets = {
- all = {
- s("hi", t("Hello, world!")), -- trigger: hi
- },
- lua = {
- s("fn", { -- trigger: fn
- t("function "), i(1, "name"), t("("), i(2), t({")", "\t"}),
- i(0),
- t({"", "end"})
- }),
- s("fori", { -- for loop snippet
- t("for "), i(1, "i"), t(" = "), i(2, "1"), t(", "), i(3, "10"), t(" do"),
- t({"", "\t"}), i(0),
- t({"", "end"})
- }),
- },
- }
-
- -- Load VSCode-style snippets (optional)
- require("luasnip.loaders.from_vscode").lazy_load()
-
- -- Load Lua snippets from a separate file (optional)
- -- require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/lua/config/snippets.lua" })
-
- local opts = { silent = true, noremap = true }
-
- -- Expand snippet or jump forward
- vim.keymap.set({ "i", "s" }, "<C-l>", function()
- if ls.expand_or_jumpable() then
- ls.expand_or_jump()
- end
- end, opts)
-
- -- Jump backward
- vim.keymap.set({ "i", "s" }, "<C-h>", function()
- if ls.jumpable(-1) then
- ls.jump(-1)
- end
- end, opts)
-
- -- Cycle choice nodes
- vim.keymap.set({ "i", "s" }, "<C-k>", function()
- if ls.choice_active() then
- ls.change_choice(1)
- end
- end, opts)
-end
-