:help marks Navigation marks allow you to mark spots in your buffer and jump back and forth between marks. This is useful if you find yourself moving around a buffer, say for table of contents, imports, or constructors.
Vim automatically creates these marks:
: jump back to previous position
: jump to last spot edited
Create your own named marks using a single letter
: create named mark
: jump to mark named
: See all available marks
The lowercase navigation marks
[a-z] are remembered as long as the file remains in the buffer list. If you remove the file, or delete the line that contains a mark, that mark is erased.
Use capital letters
[A-Z] as file marks that allows you to jump to different files. Vim will even open the file if it is closed. File marks are stored in
~/.viminfo and will persist between sessions. See the video in Buffer section for an example.