How to jump down X amount of lines, over and over

The solution to this gave me the idea to use noremap to map 10j (or any other number) and 10k to my up and down arrows. I don't know if anyone would be interested in something obscure like this but figured I would comment.

added to .vimrc:

noremap <Up> 5k
noremap <Down> 5j

Here's a plugin to do what you want. It maps ; to repeat the last motion command given with a count.


Instead of 10j, you can run:

:+10

Then you can repeat the last ex-mode command with @:.


There is no plugin or edit to .vimrc here, but I've found this simple and low tech method works pretty well because it requires no control keys and you can keep both hands stationary while scrolling up or down in any increment of lines or order (e.g. down, down, up):

Let's say you want to move down in increments of 44 lines at a time.

44j   (of course)

Now just leave your left index finger above the "4" key and repeat this to continue scrolling down in increments of 44 lines. Although it's 3 keystrokes, you can do this very quickly as long as you stick to numbers like 22, 33, etc.

Now what is nice about this is that you can quickly reverse direction with no hand movement by just hitting "k" instead of "j", e.g.

44j
44j
44j   (oops, too far, lets go back now...)
44k

Also, you can start with a higher number like 55 (for speed scrolling) and then drop to 22 or 11 to home in on your target. Unfortunately numbers like 77 don't work as well b/c you want to do the number with your left hand, although you could still do higher numbers like 77 with your left hand, it's just that you have strayed from standard touch typing hand position at that point.

Tags:

Vim