30 lines
738 B
Lua
30 lines
738 B
Lua
return {
|
|
{
|
|
"L3MON4D3/LuaSnip",
|
|
version = "v2.3",
|
|
lazy = true,
|
|
config = function()
|
|
local luasnip = require("luasnip")
|
|
require("luasnip.loaders.from_lua").lazy_load()
|
|
luasnip.config.set_config({
|
|
store_selection_keys = "<c-s>",
|
|
})
|
|
vim.keymap.set({ "i", "s" }, "<Tab>", function()
|
|
if luasnip.expand_or_jumpable() then
|
|
luasnip.expand_or_jump()
|
|
else
|
|
vim.api.nvim_feedkeys(
|
|
vim.api.nvim_replace_termcodes("<Tab>", true, false, true),
|
|
"n", -- noremap to avoid infinite recursion
|
|
true
|
|
)
|
|
end
|
|
end, { silent = true })
|
|
vim.keymap.set({ "i", "s" }, "<S-Tab>", function()
|
|
if luasnip.jumpable(-1) then
|
|
luasnip.jump(-1)
|
|
end
|
|
end, { silent = true })
|
|
end
|
|
},
|
|
}
|