Maintain `<c-e>` and `<c-y>` functionality in insert/select mode.

main
Joshua Potter 2024-01-04 16:02:10 -07:00
parent dd9a4b5493
commit 930607a63a
1 changed files with 16 additions and 20 deletions

View File

@ -33,26 +33,22 @@ function M.setup()
}, },
} }
vim.keymap.set( vim.keymap.set({ 'i', 's' }, '<c-e>', function()
{ 'i', 's' }, if luasnip.choice_active() then
'<c-e>', return '<Plug>luasnip-next-choice'
function() else
if luasnip.choice_active() then return '<c-e>'
luasnip.change_choice(1) end
end end, { silent = true, expr = true, remap = true })
end,
{ silent = true } vim.keymap.set({ 'i', 's' }, '<c-y>', function()
) if luasnip.choice_active() then
vim.keymap.set( return '<Plug>luasnip-prev-choice'
{ 'i', 's' }, else
'<c-y>', return '<c-y>'
function() end
if luasnip.choice_active() then end, { silent = true, expr = true, remap = true })
luasnip.change_choice(-1)
end
end,
{ 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' },