Hi, In Luasnip, I prefer using <C-j> and <C-k> for snippet expanding/jumping. But here We can only jump if snippet already expanded. I didn't find anything that can solve my problem.
If I don't use cmp then how we can expand snippet ?
If req is a snippet for require() then after typing req then If I press , it should expand snippet.
This is the pull request what I have added in my nvim config. May be I was wrong. May be there is a better way to do this. I am new in Neovim. Sorry If I make something wrong.
Here is my <C-j> and <C-k> mapping.
vim.keymap.set({ "i", "s" }, "<C-j>", function()
require("snippets").expand_or_jump()
end, { desc = "Snippet Expand/Jump Next" })
vim.keymap.set({ "i", "s" }, "<C-k>", function()
if vim.snippet.active({ direction = -1 }) then
vim.schedule(function()
vim.snippet.jump(-1)
end)
end
end, { desc = "Snippet Jump Prev" })
Hi, In Luasnip, I prefer using
<C-j>
and<C-k>
for snippet expanding/jumping. But here We can only jump if snippet already expanded. I didn't find anything that can solve my problem.If I don't use cmp then how we can expand snippet ?
If, it should expand snippet.
req
is a snippet forrequire()
then after typingreq
then If I pressThis is the pull request what I have added in my nvim config. May be I was wrong. May be there is a better way to do this. I am new in Neovim. Sorry If I make something wrong.
Here is my
<C-j>
and<C-k>
mapping.Just add this feature if it's missing.
Thanks