In vim, I use Ctrl-n to word complete while in insert mode. If there is more than one possible match, I get a dropdown from which I can select one of the possible matches using the arrow keys.
However, I don’t want to use the arrow keys; I want to use the ‘j’ and ‘k’ keys. But when I type ‘j’ or ‘k’, it inserts the letters instead of going up or down in the dropdown. Is there a way I can configure vim to do this the way I want?
See
:hpopupmenu-keys.There is no special set of mappings for the popup menu sub-mode, but you can make a conditional insert-mode mapping:
This makes
j/knavigate the popup menu like<C-N>/<C-P>, while it is visible.Addendum: If you want to be able to hold in control while you type
jandk, you can replace them with<C-J>and<C-K>, respectively. (See mwcz’s comment to this answer.)