sponsor Vim development Vim logo Vim Book Ad

basic Tip #209: backtracking your movements in a file

 tip karma   Rating 189/69, Viewed by 3475 

created:   February 1, 2002 10:35      complexity:   basic
author:   vim_power      as of Vim:   6.0

If you are jumping from one line to another a lot.
You may find the "Ctrl-o" command handy.
Usually u 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 u will go to your last cursor position.

Njoy

 rate this tip  Life Changing Helpful Unfulfilling 

<<Alter the display of buffers in the buffers menu | compiling the actual file with gcc >>

Additional Notes

[email protected], February 1, 2002 12:20
Similarly Ctrl-I in the reverse order. Ctrl-I is also as useful as Ctrl-o. Try it for yourself.
[email protected], August 21, 2002 15:06

type u<char> bookmarks the current position.  Type '<char> to return to that
position
[email protected], January 9, 2003 14:49
This is a wonderful tip. 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!
anonymous, February 13, 2003 22:36
Perhaps a goofy comment, but I use the mnemonic device of jumping "In" and "Out" of the jump list (<c-i>, <c-o>).
yuchung at ma il dot c om, June 1, 2003 13:51
sir, u (and vim) changed my life ... horey!!!
ackerdud -> yahoo.com, December 2, 2004 11:39
saisanthosh: I think that u<char> is actually m<char> :)
u is undo!
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
    stats
Sponsored by Web Concept Group Inc. SourceForge.net Logo