How do I manually set the visual selection marks to define a precise Ex command range without entering visual mode?
m<
Vim's ' marks record the start and end of the last visual selection and power the ' range used by Ex commands.
m<
Vim's ' marks record the start and end of the last visual selection and power the ' range used by Ex commands.
:'<,'>
Vim automatically sets two special marks whenever you make a visual selection: ' (end).
'[ and ']
Vim automatically sets two special marks after every change, yank, or put operation: '[ and '].
mA
Uppercase marks (A–Z) are global marks in Vim — they persist across files and even across sessions (when viminfo or shada is configured).
mA and 'A
Vim has two tiers of marks.
g'{mark}
Vim's standard mark-jump commands ('a, ` a `) always add the current position to the jumplist before leaping to the mark.
]'
The ]' command jumps to the start of the line containing the next lowercase mark in the file, while [' jumps to the previous one.
' 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
'0
Pressing '0 in normal mode jumps to the exact cursor position in the most recently edited file, even after closing and reopening Vim.
mA to set, 'A to jump
Uppercase marks (A–Z) are global marks — they persist across files and Vim sessions.
:lockmarks
Many Ex commands silently adjust or delete marks as a side effect of modifying buffer content.
`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
: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.
`< and `>
The ` ` marks automatically track the boundaries of the last visual selection.
`[ and `]
The ` [ ` and ] ` marks automatically track the boundaries of the last changed or yanked text.
``
The double backtick jumps to the exact position before the last jump.
`{mark}
The backtick command ` ` followed by a mark name jumps to the exact line and column of that mark, unlike the single-quote ' which only goes to the line.
m{A-Z}
Uppercase marks (A-Z) are global marks that remember both the file and the cursor position.
g;
The g; command moves backward through the change list, jumping to positions where edits were made.