summaryrefslogtreecommitdiff
path: root/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/snippets.lua
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-06-19 18:34:13 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-06-19 18:34:13 +0900
commit307fceea38b7352a79b0bdb87025a34b76973867 (patch)
tree382eb3e6a11973bc2c6ba33eee14d43ec2a9566b /ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/snippets.lua
parentb66f68b8c014a3041c936ee9de1b57db5bcb50fb (diff)
updates
Diffstat (limited to 'ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/snippets.lua')
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/snippets.lua72
1 files changed, 0 insertions, 72 deletions
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/snippets.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/snippets.lua
deleted file mode 100644
index eac9161..0000000
--- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/snippets.lua
+++ /dev/null
@@ -1,72 +0,0 @@
-return {
- {
- "L3MON4D3/LuaSnip",
- version = "v2.*",
- build = "make install_jsregexp",
- dependencies = {
- "rafamadriz/friendly-snippets",
- config = function()
- require("luasnip.loaders.from_vscode").lazy_load()
- end,
- },
- config = function()
- local ls = require("luasnip")
- ls.setup({
- link_children = true,
- link_roots = false,
- keep_roots = false,
- update_events = { "TextChanged", "TextChangedI" },
- })
- local c = ls.choice_node
- ls.choice_node = function(pos, choices, opts)
- if opts then
- opts.restore_cursor = true
- else
- opts = { restore_cursor = true }
- end
- return c(pos, choices, opts)
- end
-
- require("luasnip.loaders.from_vscode").lazy_load({
- paths = { '"' .. vim.fn.stdpath("config") .. '/lua/thesiahxyz/snippets"' },
- })
-
- vim.cmd.runtime({ args = { "lua/thesiahxyz/snippets/*.lua" }, bang = true }) -- load custom snippets
-
- vim.keymap.set({ "i", "x" }, "<A-L>", function()
- if ls.expand_or_jumpable() then
- ls.expand_or_jump()
- end
- end, { silent = true, desc = "Expand snippet or jump to the next snippet node" })
-
- vim.keymap.set({ "i", "x" }, "<A-H>", function()
- if ls.jumpable(-1) then
- ls.jump(-1)
- end
- end, { silent = true, desc = "Previous spot in the snippet" })
-
- vim.keymap.set({ "i", "x" }, "<A-l>", function()
- if ls.choice_active() then
- ls.change_choice(1)
- end
- end, { silent = true, desc = "Next snippet choice" })
-
- vim.keymap.set({ "i", "x" }, "<A-h>", function()
- if ls.choice_active() then
- ls.change_choice(-1)
- end
- end, { silent = true, desc = "Previous snippet choice" })
- end,
- keys = {
- vim.keymap.set("i", "<tab>", function()
- return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
- end, { expr = true, silent = true, desc = "Jump to next snippet" }),
- vim.keymap.set("s", "<tab>", function()
- require("luasnip").jump(1)
- end, { desc = "Jump to next snippet" }),
- vim.keymap.set({ "i", "s" }, "<s-tab>", function()
- require("luasnip").jump(-1)
- end, { desc = "Jump to Previous Snippet" }),
- },
- },
-}