This repository has been archived on 2025-12-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
nvim-old/lua/haelnorr/lazy/snippets.lua
2024-06-14 20:14:11 +10:00

30 lines
997 B
Lua

return {
{
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
-- install jsregexp (optional!).
build = "make install_jsregexp",
dependencies = { "rafamadriz/friendly-snippets" },
config = function()
local ls = require("luasnip")
ls.filetype_extend("javascript", { "jsdoc" })
--- TODO: What is expand?
vim.keymap.set({"i"}, "<C-s>e", function() ls.expand() end, {silent = true})
vim.keymap.set({"i", "s"}, "<C-s>;", function() ls.jump(1) end, {silent = true})
vim.keymap.set({"i", "s"}, "<C-s>,", function() ls.jump(-1) end, {silent = true})
vim.keymap.set({"i", "s"}, "<C-E>", function()
if ls.choice_active() then
ls.change_choice(1)
end
end, {silent = true})
end,
}
}