Vim: create marks across files?

A feature I often use in Vim is mark and jump-to-mark (')… But they only work within a file.

Is there any way to create a mark which works across files? For example, so I can create mark a on line 42 of foo.py, then jump to that mark while I'm editing bar.py?


Yes. Use capital letters for the mark.

http://vim.wikia.com/wiki/Using_marks

Marks can span across files. To use such marks one has to use upper-case registers i.e. A-Z. Lower-case registers are used only within files and do not span files. That's to say, if you were to set a mark in a file foo.c in register "a" and then move to another file and hit 'a, the cursor will not jump back to the previous location. If you want a mark which will take you to a different file then you will need to use an upper-case register. For example, use mA instead of ma.


Use the A-Z marks, they are available across files.