From cb36ccfa8db66db953795fd8e22138ed1712b1cd Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 18 Sep 2024 00:58:26 +0200 Subject: checkpoint - added basic luasnip configuration - added highlights for TODO and FIXME keywords - added incremental selection of treesitter - added prettier to conform formatters - added when_disabled function to disable pairs in comments - changed the hiding keybind to :Hide command - only enable ` pairs in markdown - removed keybind - removed cmp's calc source - renamed keybinds for consistency - reorganized plugins in lazy.lua --- after/plugin/luasnip.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 after/plugin/luasnip.lua (limited to 'after/plugin/luasnip.lua') diff --git a/after/plugin/luasnip.lua b/after/plugin/luasnip.lua new file mode 100644 index 0000000..e14a1a5 --- /dev/null +++ b/after/plugin/luasnip.lua @@ -0,0 +1,31 @@ +local ls = require("luasnip") +local s = ls.snippet +local i = ls.insert_node +local t = ls.text_node + +local map = vim.keymap.set + +map("i", "", function() + if ls.expand_or_locally_jumpable() then + ls.expand_or_jump() + end +end, { silent = true }) +map({ "i", "s" }, "", function() + ls.locally_jumpable(-1) +end, { silent = true }) +map({ "i", "s" }, "", function() + if ls.choice_active() then + ls.change_choice(1) + end +end, { silent = true }) + +-- temporary keybind to play around +map("n", " s", "source ~/.config/nvim/after/plugin/luasnip.lua") + +ls.config.set_config({ + history = true, +}) + +ls.add_snippets("all", { + ls.parser.parse_snippet("expand", "-- this is $1 expanded $2 $3!"), +}) -- cgit v1.2.3