fix(luasnip): fixed luasnip keymaps

This commit is contained in:
Folke Lemaitre 2023-01-05 15:33:08 +01:00
parent 18756a614c
commit 05ec629d7b
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -13,15 +13,18 @@ return {
history = true, history = true,
delete_check_events = "TextChanged", delete_check_events = "TextChanged",
}, },
init = function() -- stylua: ignore
local function jump(key, dir) keys = {
vim.keymap.set({ "i", "s" }, key, function() {
return require("luasnip").jump(dir) or key "<tab>",
end, { expr = true }) function()
end return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
jump("<tab>", 1)
jump("<s-tab>", -1)
end, end,
expr = true, remap = true, silent = true, mode = "i",
},
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
},
}, },
-- auto completion -- auto completion