Jump between changes

3.7
(363)

Vim tracks all of the changes you make during an editing session. You can undo and redo these changes with u and Ctrl-r. You can even navigate back and forth through history like a time traveller. But Vim has another useful change tracking feature: the changelist.

Vim keeps track of the position of every undo-able change and makes the last 100 available to you when you call :changes. You can navigate backwards and forwards to these positions in your file without undoing the change by using g; and g,:

  • :changes – Show position of last 100 changes
  • g; -Jump backwards to the position of the previous change
  • g, – Jump forwards to the position of the next change

Here’s a short screencast showing this in practice. Click through the gif if you want to watch a slightly longer version in video form. (👋Thank you for your feedback, everyone. Keep it coming.)

Next steps:

How useful was this post?

Average rating 3.7 / 5. Vote count: 363

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Written by

Andy Libby

22 Posts

Rides bikes. Codes ruby. Studies Vim.
View all posts

Leave a reply

Your email address will not be published. Required fields are marked *