Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Repeating a navigation command in vi

How do I repeat a navigation command in vi?

For example, I execute the command 20j which moves the cursor down 20 lines, and I tried hitting . to repeat that command, but it says "No command to repeat".

P.S. Also, what command goes to the next page in a document?

like image 375
Chetan Avatar asked Sep 08 '10 18:09

Chetan


1 Answers

There isn't a shortcut to repeat the last navigation command - you have to retype it, or set up some sort of shortcut of your own (:map or similar).

Page up (back) is Control-B; page down (forward) is Control-F. Half-pages are Control-U (up) and Control-D (down).

like image 59
Jonathan Leffler Avatar answered Oct 13 '22 04:10

Jonathan Leffler