Files
dotfiles/vim/.vim/lua/plugins/luasnip.lua
Christian Nieves b4bd109458 BREADCRUMBSSSSS
2024-07-03 18:06:23 +00:00

36 lines
877 B
Lua

return {
{
"danymat/neogen",
config = function()
require("neogen").setup({ snippet_engine = "luasnip" })
end,
},
{
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "<CurrentMajor>.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
-- install jsregexp (optional!).
build = "make install_jsregexp",
},
{ "saadparwaiz1/cmp_luasnip" },
config = function()
local ls = require("luasnip")
vim.keymap.set({ "i" }, "<Tab>", function()
ls.expand()
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<Tab>", function()
ls.jump(1)
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<S-Tab>", 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,
}