History
Article Edit this page Discussion

Backtracking your movements in a file

From Vim Tips Wiki

Jump to: navigation, search

Tip 209 Previous Next Created: February 1, 2002 Complexity: basic Author: vim_power Version: 6.0


If you are jumping from one line to another a lot, you may find the "Ctrl-O" command handy.

Usually you can set markers in a buffer to keep track of your movements.

But Ctrl-O makes it even easier. it takes you back sequentially to all your previous cursor locations in a buffer.

Just press ctrl-O in normal mode and you will go to your last cursor position.

Similarly Ctrl-I goes in the reverse order. Ctrl-I is also as useful as Ctrl-O.

[edit] Comments

type m<char> bookmarks the current position. Type '<char> to return to that position.


Of course you can see the jump list with :jump, and set markers to allow one to jump between files (not just within a buffer) with '[A-Z], but this is tip is great because it just follows your history. Wonderful!


Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto Wiki
Doctor Who
Legend of Zelda Wiki
Terminator Wiki
Everquest II Wiki
Mystery Science Theater 3000
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions
Send this article to a friend
"Backtracking your movements in a file"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation