I'm using deoplete
plugin for auto completion. In Vim, default keybinding for up and down when popup appears is CtrlN / CtrlP. I want to change to CtrlJ / CtrlK for same behavior with CtrlP
plugin.
How can I change this. thanks
You can't "directly" map keys in the pop-up menu, you'll have to use expression mappings
and the pumvisible()
function to check if the popup menu is visible.
inoremap <expr> <C-j> pumvisible() ? "\<C-n>" : "\<C-j>"
inoremap <expr> <C-k> pumvisible() ? "\<C-p>" : "\<C-k>"
If the popup menu is visible <C-j>
is mapped to <C-n>
to make it go to the next entry. If the menu isn't visible <C-j>
is mapped to <C-j>
.