Marks across buffers
Lowercase marks like 'a and 'b are local to the buffer you’re currently in. This is nice, because it means that different buffers can have a completely different set of marks. But what if we want to set marks that move us between buffers? It’s much more common in a large codebase to want to jump between files rather than to different places in the same file.
Vim’s got our back. Capital letters, when used as marks, mean global marks. For example, the 'A mark not only represents the row and column where it was set, but the file too!
So, you can set a mark with mA and jump back to it from any buffer with 'A (or, as we just learned, `A).
Let’s try this in the editor. We’re going to work with two buffers this time. Set the 'A mark in the initial buffer with mA, then edit the marky file with :e marky. Then set the 'B mark in the marky file.
Once you’re done, try hitting 'A and 'B to jump between the two buffers!
Hint: remember that the capital letter is how Vim knows we’re speaking about a global mark.