Frequently Asked Question

What are Vim marks and registers, and how do they differ?

A mark is a bookmark: a remembered position (line and column) in a buffer. Set one in normal mode with m followed by a letter, ma records the current cursor position as mark a. Jump back with `a (backtick for exact column) or 'a (apostrophe for the start of the line). Lowercase marks are local to the buffer; uppercase marks (A to Z) are global and jump across files, which is excellent for "remember this spot in the codebase" navigation. Numbered marks 09 track recent files automatically.

A register is a clipboard slot. Vim has many, the unnamed register " receives every delete and yank by default, the named registers "a"z let you have 26 manual clipboards, the system clipboard appears as "+ (and on Linux the X11 primary selection as "*), the search register is /, and :registers shows them all. To yank into a specific register, prefix the command: "ayy yanks the current line into register a. To paste from it, "ap. Capitalising the letter ("Ayy) appends rather than overwrites.

The mental model is straightforward: marks record where, registers record what. They combine well, yank into a named register, jump to a mark, paste, and form the basis of more advanced workflows like cross-file refactoring without leaving the keyboard.

Video

Further reading and video