Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to go back to lines edited before the last one in Vim?

Tags:

vim

People also ask

How do I go back to previous line in vim?

Example. To jump back to line # 300 or previous position press CTRL-O (press and hold Ctrl key and press letter O). To jump back forwards press CTRL-I (press and hold Ctrl key and press letter I).

How do I go to the beginning of a line in vi editor?

Press ^ to move the cursor to the start of the current line. Press $ to move the cursor to the end of the current line.

How do I jump to the beginning of a file in vim?

Type "gg" in command mode. This brings the cursor to the first line.

How do you jump in front of a line in vim?

Press 0 to go to the beginning of a line, or ^ to go to the first non-blank character in a line.


Try g ; and g ,. They jump backward and forward in the changelist.

See :help changelist for more details.


I use CTRL-O and CTRL-I to jump back and forth between recent points in files. It also goes through certain motion commands, but I find it usually takes me back to where I was editing.