How do I set a bookmark that takes me back to a specific line in any file?
mA
Uppercase marks (A–Z) are global marks in Vim — they persist across files and even across sessions (when viminfo or shada is configured).
142 results for ":marks"
mA
Uppercase marks (A–Z) are global marks in Vim — they persist across files and even across sessions (when viminfo or shada is configured).
`< and `>
The ` ` marks automatically track the boundaries of the last visual selection.
:lockmarks keepjumps keeppatterns %s/\s\+$//e
Bulk cleanup commands are easy to automate, but many implementations quietly damage editor state by moving marks, polluting the jumplist, or replacing your last
mA and 'A
Vim has two tiers of marks.
:lockmarks keepjumps keeppatterns %s/foo/bar/ge
Large substitutions are efficient, but they often leave side effects: your last search changes, your jumplist gets noisy, and marks can shift in ways that break
command-line #command-line #editing #substitution #navigation
:'<,'>
Vim automatically sets two special marks whenever you make a visual selection: ' (end).
ma and 'a
The ma command sets a mark named a at the current cursor position.
]`
Most users jump to marks directly ('a, ` a `), but when a file has many lowercase marks, stepping through them in order is faster than remembering each name.
mA / 'A
Uppercase marks (A-Z) are global marks — they remember not only the line and column position, but also the file where they were set.
navigation #navigation #marks #normal-mode #buffers #productivity
mA to set, 'A to jump
Uppercase marks (A–Z) are global marks — they persist across files and Vim sessions.
g;
The g; command moves backward through the change list, jumping to positions where edits were made.
'0
Pressing '0 in normal mode jumps to the exact cursor position in the most recently edited file, even after closing and reopening Vim.
' vs `
Vim provides two distinct ways to jump to a mark, and they behave differently: the apostrophe ' jumps to the first non-blank character of the marked line, while
:'[,']normal! =
When you need to run a command on exactly the text you just changed, yanked, or pasted, Vim's automatic marks are faster and safer than reselecting manually.
command-line #command-line #marks #indentation #ex-commands #normal-mode
`[ and `]
The ` [ ` and ] ` marks automatically track the boundaries of the last changed or yanked text.
\%'m
Vim's \%'m regex atom matches the exact position of mark m in a search pattern.
`"
The " mark is an automatic mark Vim sets whenever you leave a buffer — switching to another file, hiding the buffer, or quitting Vim (with viminfo/shada enabl
d'a
Named marks are not just jump destinations — they serve as motion targets for any operator.
navigation #navigation #marks #editing #motions #normal-mode
g'{mark}
Vim's standard mark-jump commands ('a, ` a `) always add the current position to the jumplist before leaping to the mark.
`[v`]
The ` [v] sequence visually selects the exact region of text that was last changed, pasted, or yanked into the buffer.
visual-mode #editing #visual-mode #marks #paste #productivity