Skip to content

Commit

Permalink
Add ctrl-j/k navigation in popups (braintreeps#103)
Browse files Browse the repository at this point in the history
What
===
Add ctrl-j/k navigation in popups.

Why
===
We use `jk` to navigate in normal mode. When a popup displays like for
autocompletion these lines will allow `ctrl` `jk` to navigate up and
down the list without needing to move hands to the arrow keys or to the
further away `np` keys.
  • Loading branch information
leighmcculloch authored Apr 25, 2018
1 parent 25a7b25 commit c0036eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ function! MyTabLabel(n)
return file
endfunction

" CTRL-J/K navigation in popups
inoremap <expr> <c-j> (pumvisible()?"\<C-n>":"\<c-j>")
inoremap <expr> <c-k> (pumvisible()?"\<C-p>":"\<c-k>")
set tabline=%!MyTabLine()

" ========= Aliases ========
Expand Down

0 comments on commit c0036eb

Please sign in to comment.