Thursday, February 28, 2008

More Marks

Most people know the basics of using marks in Vim; however, there are some special mark locations you may not know about.

`. - move cursor to the line and column of your last edit
'. - move cursor tot the line of your last edit
`' - move to last jump position
`" - move to location before file file was last closed

:marks - show entire mark list
:mark x - show mark stored in register x
:jumps - show the entire jump list

ctrl-o - move cursor to older position in jump list
ctrl-i - move cursor to newer position in jump list

In case you don't know basic marks, in normal mode, press m followed by a-z to set a given mark to your current position in the file. To jump back to that position type `a, `b, etc...

A jump is executed whenever you move the cursor to an arbitrary position in the file, i.e., 123G (line 123).

1 comment:

Tim D said...

Minor Correction

:marks x - show mark stored in register x