Its All Relative
Relative line numbers in Vim are fantastic but won’t work with wrapped lines if you remap
gk respectively… that is, unless you do this:
nnoremap <expr> j v:count ? 'j' : 'gj' nnoremap <expr> k v:count ? 'k' : 'gk'
Thus allowing you to still jump by a count (that’s the
v:count check part) and also move up and down to the visual next line. I haz cake and I eats it.
- //Posted: Jun 8, 2018