How to jump back and forward in Vim

Scrolling left, right, up and down is easy in Vim using the hjkl keys. But, you can also move around by jumping between the results of a search or many other non-scrolling methods to change positions. It is easy to jump back and forward among these jump locations in Vim.

To jump back to an older jump position, press Ctrl-o

To jump forward to a newer jump position, press Ctrl-i

To view the jump list of cursor positions maintained by Vim, type :jumps

For more information see jump-motions in the Vim help documentation.

Tried with: Vim 7.3 and Ubuntu 12.04 LTS

Advertisements

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.