mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 22:22:40 +00:00
40 lines
856 B
Lua
40 lines
856 B
Lua
return {
|
|
{
|
|
"L3MON4D3/LuaSnip",
|
|
opts = function()
|
|
LazyVim.cmp.actions.snippet_forward = function()
|
|
if require("luasnip").jumpable(1) then
|
|
require("luasnip").jump(1)
|
|
return true
|
|
end
|
|
end
|
|
LazyVim.cmp.actions.snippet_stop = function()
|
|
if require("luasnip").expand_or_jumpable() then -- or just jumpable(1) is fine?
|
|
require("luasnip").unlink_current()
|
|
return true
|
|
end
|
|
end
|
|
end,
|
|
keys = {
|
|
{
|
|
"<C-k>",
|
|
mode = { "i", "s" },
|
|
function()
|
|
if ls.expand_or_jumpable() then
|
|
ls.expand_or_jump()
|
|
end
|
|
end
|
|
},
|
|
{
|
|
"<C-j>",
|
|
mode = { "i", "s" },
|
|
function()
|
|
if ls.jumpable(-1) then
|
|
ls.jump(-1)
|
|
end
|
|
end
|
|
},
|
|
},
|
|
},
|
|
}
|