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' },
|
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' },
|
||||||
|
|
Loading…
Reference in New Issue