Install nvim-snippets using lazy.nvim
mainTo install nvim-snippets, add it to your lazy.nvim configuration. The installation includes recommended keybindings for <Tab> and <S-Tab> to handle snippet jumping (forward and backward) in Insert (i) and Select (s) modes using the native vim.snippet API.
{
"garymjr/nvim-snippets",
keys = {
{
"<Tab>",
function()
if vim.snippet.active({ direction = 1 }) then
vim.schedule(function()
vim.snippet.jump(1)
end)
return
end
return "<Tab>"
end,
expr = true,
silent = true,
mode = "i",
},
{
"<Tab>",
function()
vim.schedule(function()
vim.snippet.jump(1)
end)
end,
expr = true,
silent = true,
mode = "s",
},
{
"<S-Tab>",
function()
if vim.snippet.active({ direction = -1 }) then
vim.schedule(function()
vim.snippet.jump(-1)
end)
return
end
return "<S-Tab>"
end,
expr = true,
silent = true,
mode = { "i", "s" },
},
},
}