Regardless of which code completion plugin I use (I tried asyncomplete and YouCompleteMe), when there's a completion pop-up, up and down arrow keys select completion options in it instead of moving the cursor. How do I disable this behavior? For me, tab is enough to cycle through completions.
1 Answer
Remap <up>
key to close popup menu
and move cursor up when popup menu
is visible:
inoremap <expr> <up> pumvisible() ? '<c-e><up>' : '<up>'
-
1Thanks. I replaced
<c-e>
with<c-y>
to insert the selected completion (my question was probably poorly phrased), works like a charm.<c-e>
reverts the line to "what you typed" state regardless of whether there was a selected completion.– GrishkaCommented Dec 6, 2019 at 0:13 -
for those who use lunarvim: github.com/LunarVim/LunarVim/discussions/4367– Crispy13Commented May 14 at 4:10