Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

vim

I'm using 10j to jump down 10 lines, but I want to easily jump 10 lines over and over. I don't want to have to perform the jump with a macro qv10jq@v@@..

I wish there was a method for repeating down keys like motion has f then ; to continually jump (, to go back) to the next character(s).

is there anything shorter than my macro?

like image 765
tester Avatar asked Jun 02 '11 21:06

tester


People also ask

How do you jump between lines in vim?

If we are in the vim editor, then simply do this, “Press the ENTER key, write the Line number, and press Shift+ g”: Again the output is the same.

How do you jump over a line in Python?

Just add # at the beginning of all the lines you want to skip.

What command do you use in vim to move the cursor down by 10 lines?

j and k move down and up one line, so 10j and 10k move down and up ten lines. You can repeat any motion by putting a number before it.


2 Answers

Instead of 10j, you can run:

:+10 

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

like image 69
nelstrom Avatar answered Sep 20 '22 18:09

nelstrom


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

like image 36
Karl Bielefeldt Avatar answered Sep 21 '22 18:09

Karl Bielefeldt