fix bug tab

This commit is contained in:
asep komarudin 2023-03-13 22:55:09 +07:00
parent 39c6fb682a
commit 68087b6dc3
3 changed files with 22 additions and 10 deletions

View file

@ -72,6 +72,18 @@ return {
"i",
"s",
}),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {
"i",
"s",
}),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },

View file

@ -57,13 +57,13 @@ return {
},
-- stylua: ignore
keys = {
{
"<tab>",
function()
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
end,
expr = true, silent = true, mode = "i",
},
-- {
-- "<tab>",
-- function()
-- return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
-- end,
-- expr = 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" } },
},