fix(vim): add binding to jump between snippet placeholders

Currently it is set up to use tab to jump between placeholders and go to
the next completion item. This is causing conflicts when typing
variables in the snippet placeholders.

Now you can use <CTRL-h> to jump to the next placeholders. This is only
available when the completion is active so, dose not conflict with
switching windows.
This commit is contained in:
Ade Attwood 2022-10-01 11:44:37 +01:00
parent 67f15d126d
commit e7897fc7e0

View file

@ -37,6 +37,9 @@ cmp.setup({
mapping = cmp.mapping.preset.insert({
['<C-j>'] = cmp.get_config().mapping['<Down>'],
['<C-k>'] = cmp.get_config().mapping['<Up>'],
['<C-l>'] = function() luasnip.jump(1) end,
['<C-h>'] = function() luasnip.jump(-1) end,
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping(function(_fallback)
if cmp.visible() then