← All lessons

14. Marks

Step 2 of 8

User-defined marks

In the last section, I lied a little bit.

I said that we can set ‘a mark’ with mm. This is true, but we can also set a mark with ma. And mb. And mc!

You get the idea. Vim gives us a unique mark for every letter in the alphabet! This means that you can set as many marks as you’d like, for each different letter, and jump between them with 'a, 'b, etc.

I like to choose letters that have some meaning relevant to where they’re placed. For example, I often use the 'w mark to keep track of where I’m currently working. I also use the 'i mark to store the location of something I think might be interesting.

Let’s experiment in the editor. Try setting marks 'a, 'b, and 'c on the specified lines with ma, mb, and mc respectively. Then try jumping between them with 'a, 'b, and 'c.

Loading editor…