How do you list all marks in Vim?
:marks
Use :marks to display all current marks with their line numbers, column positions, and file/text.
142 results for ":marks"
:marks
Use :marks to display all current marks with their line numbers, column positions, and file/text.
"a:'a,'by
Set marks with ma and mb, then yank the range between them into register a using "a:'a,'by.
:delmarks!
Marks accumulate as you work — ma, mb, mc and so on record positions for later jumps.
m{A-Z}
Uppercase marks (A-Z) are global marks that remember both the file and the cursor position.
:lockmarks
Many Ex commands silently adjust or delete marks as a side effect of modifying buffer content.
:keepmarks
When Vim executes commands that move or reorder lines — such as :sort, :%!sort, or :s/// across ranges — it automatically adjusts named marks to follow the
:lockmarks normal! >>
When you run editing commands from the command line, Vim usually updates special marks like '[ and '] to the changed text.
]'
The ]' command jumps to the start of the line containing the next lowercase mark in the file, while [' jumps to the previous one.
:'a,'b s/old/new/g
Marks can be used as range specifiers in any Ex command.
command-line #marks #command-line #ex-commands #ranges #editing
:keepmarks {command}
Many batch edits in Vim update special marks like '[ and '], which can disrupt follow-up motions or tooling that depends on those positions.
navigation #navigation #marks #command-line #refactoring #editing
'[ and ']
Vim automatically sets two special marks after every change, yank, or put operation: '[ and '].
`a vs 'a
Vim has two ways to jump to marks: backtick (` `) jumps to the exact line AND column, while apostrophe (') jumps to the line only, positioning the cursor at the
m<
Vim's ' marks record the start and end of the last visual selection and power the ' range used by Ex commands.
:'a,'bnormal! @q<CR>
When you need to replay a macro on a precise region, selecting lines manually can be slow and error-prone.
:keepmarks %s/pattern/replacement/g
The :keepmarks modifier prevents Vim from adjusting mark positions when a buffer-modifying command runs.
:'a,'bs/old/new/g
Named marks can serve as range endpoints for any Ex command, including :substitute.
]' and ['
The ]' and [' motions let you traverse every lowercase mark set in the current buffer without needing to remember which registers you used.
:set shada='200,<1000,s100,h
Default ShaDa settings are conservative, which can make long-running workflows lose useful context between sessions.
qama{edits}'aq
How it works When a macro needs to jump to different parts of the file and then return to a starting position, marks are the perfect tool.
` vs '
Vim offers two ways to jump to a mark, and the difference is crucial: the backtick (` `) jumps to the exact line and column where the mark was set, while the si