← All lessons

15. The Changelist Jumplist And Tag Stack

Step 1 of 5

Vim’s built-in lists

We’ve already seen how we can use marks to save locations that we might want to return to later. We’ve also seen how Vim automatically sets some marks for us, like the position of the last edit. Marks have some limitations, though:

Fret not, though — Vim has some more robust tools for navigating called the changelist, jumplist, and tag stack. At a glance, these are like ‘marks on steroids’.

In this lesson, we’re going to explore each of these in order. We’ll take a look at what they are first, then we’ll learn how to use them. Generally speaking, these tools are more useful than marks for most situations primarily because they are automatic. You don’t have to worry about managing them yourself.

To kick us off, let’s understand where Vim’s marking system breaks down. We’re going to try this in the editor. Make a few edits on each of the lines, then try using the '. command in normal mode to jump to the ". mark (which keeps track of the last edit). You’ll notice that the '. command will only ever take you to where the most recent change took place. You can’t go any further back!

This is a good illustration of the limits of marks, and this is where the changelist, jumplist, and tag stack come in handy.

Loading editor…