Nvim: fix luasnip keymappings
This commit is contained in:
parent
747b4b8990
commit
8a3fb3ad45
|
@ -32,7 +32,7 @@ return function()
|
|||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}),
|
||||
["<Tab>"] = function(fallback)
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
|
@ -40,8 +40,8 @@ return function()
|
|||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
["<S-Tab>"] = function(fallback)
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
|
@ -49,7 +49,7 @@ return function()
|
|||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
sources = {
|
||||
{ name = "copilot" },
|
||||
|
|
|
@ -1,23 +1,4 @@
|
|||
return function()
|
||||
local luasnip = require("luasnip")
|
||||
local wk = require("which-key")
|
||||
|
||||
-- load friendly-snippets to luasnip
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
||||
-- Register snippet navigation keybindings
|
||||
local snippet_mappings = {
|
||||
["<c-j>"] = {
|
||||
function()
|
||||
luasnip.jump(1)
|
||||
end,
|
||||
},
|
||||
["<c-k>"] = {
|
||||
function()
|
||||
luasnip.jump(-1)
|
||||
end,
|
||||
},
|
||||
}
|
||||
--wk.register(snippet_mappings, {mode = "i"})
|
||||
--wk.register(snippet_mappings, {mode = "s"})
|
||||
-- load friendly-snippets to luasnip
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue