[vim tip] Bookmark your place in a file

I’m current editing a manuscript in vim, to be compiled in \LaTeX. It’s about 404 lines long and compiles to about 30 pages with figures. Jumping around by line number is not really an option, and scrolling back and forth is not that fun. Enter bookmarks in vim, yet another of hundreds of wonderfully useful features for fast editing.

To bookmark your current place, you can assign any lower case letter to the bookmark by pressing ma to bookmark a. My version of vim (7.2) doesn’t appear to give any confirmation of the created bookmark.

To retrieve the bookmark, you’ll use the back tick (not a single quote) ` and type a:


You can also go to the last edited line with a back tick and period:



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s