Posts | About

Never Get Lost In Your Buffers Again | Vim Marks

vimcheat-sheetsvideo

Posted on 2024-11-17 by Matt.

Cheat Sheet

marks docs or :h mark-motions

Mark the current position in the buffer as mark a (local to buffer only)

ma

Mark the current position in the buffer as mark A (globally)

mA

Jump to mark a (start of line)

'a

Jump to mark a (line and col)

`a

Marks can be used as motions. Change everything from current position to mark a

c`a

Marks can be used in command Substitute "jpg" with "jpeg", from mark a to mark b

:'a,'b s/jpg/jpeg/g

See a list of all marks

:marks

See marks a, b, and c

:marks abc

Delete mark a

:delmark a

Preserving marks between sessions requires shada to be non-empty. See shada or :h shada