diff options
| author | ache <ache@ache.one> | 2026-04-19 00:51:18 +0200 |
|---|---|---|
| committer | ache <ache@ache.one> | 2026-04-19 00:51:18 +0200 |
| commit | 7b85700704a5a366e5fc8a918a706ade018620ad (patch) | |
| tree | 7265c46b425d69c19348c914e641ae8079fe147c /lua | |
| parent | feat: Enable & configure autotag (diff) | |
fix: Fix LuaSnip moves
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/ache/plugins/nvim-cmp.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lua/ache/plugins/nvim-cmp.lua b/lua/ache/plugins/nvim-cmp.lua index 5a63ab1..fc9ef0c 100644 --- a/lua/ache/plugins/nvim-cmp.lua +++ b/lua/ache/plugins/nvim-cmp.lua @@ -102,6 +102,26 @@ return { ["<c-space>"] = cmp.mapping.complete(), ["<c-e>"] = cmp.mapping.abort(), ["<CR>"] = cmp.mapping.confirm({ select = true }), + -- To add <Tab> and <S-Tab> in completion AND as luasnip edition move + ["<Tab>"] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.locally_jumpable(1) then + luasnip.jump(1) + else + fallback() + end + end, { "i", "s" }), + + ["<S-Tab>"] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), }), -- Order is important ! |