Faster vertical movement

1 Point

Andrew Radev Andrew Radev

9 years ago

While you could use <c-f> or <c-d> for scrolling, this feels a bit too choppy to me. Having <c-j> and <c-k> mapped to moving in larger increments feels very convenient. I usually just hold on to the modifier key (in this case, Ctrl, though I prefer Shift) while moving and marking things, and let go of it for precision. Once you get used to the motions, it provides a very comfortable flow.

Note that you could use 5gj and 5gk instead, in order to always move in visible lines. Obviously, you could also vary the count to fit your taste.

nnoremap <c-j> 5j
nnoremap <c-k> 5k
xnoremap <c-j> 5j
xnoremap <c-k> 5k

Antoine Snyers

Antoine Snyers 5 years ago

Alternatively: set scroll=5 and use <c-u> and <c-d> without custom key mappings