Maintain `<c-e>` and `<c-y>` functionality in insert/select mode.
parent
dd9a4b5493
commit
930607a63a
|
@ -33,26 +33,22 @@ function M.setup()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set({ 'i', 's' }, '<c-e>', function()
|
||||||
{ 'i', 's' },
|
|
||||||
'<c-e>',
|
|
||||||
function()
|
|
||||||
if luasnip.choice_active() then
|
if luasnip.choice_active() then
|
||||||
luasnip.change_choice(1)
|
return '<Plug>luasnip-next-choice'
|
||||||
|
else
|
||||||
|
return '<c-e>'
|
||||||
end
|
end
|
||||||
end,
|
end, { silent = true, expr = true, remap = true })
|
||||||
{ silent = true }
|
|
||||||
)
|
vim.keymap.set({ 'i', 's' }, '<c-y>', function()
|
||||||
vim.keymap.set(
|
|
||||||
{ 'i', 's' },
|
|
||||||
'<c-y>',
|
|
||||||
function()
|
|
||||||
if luasnip.choice_active() then
|
if luasnip.choice_active() then
|
||||||
luasnip.change_choice(-1)
|
return '<Plug>luasnip-prev-choice'
|
||||||
|
else
|
||||||
|
return '<c-y>'
|
||||||
end
|
end
|
||||||
end,
|
end, { silent = true, expr = true, remap = true })
|
||||||
{ silent = true }
|
|
||||||
)
|
|
||||||
-- Allow aborting the active snippet at any point in time.
|
-- Allow aborting the active snippet at any point in time.
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
{ 'n', 'i', 's' },
|
{ 'n', 'i', 's' },
|
||||||
|
|
Loading…
Reference in New Issue