Vim: Marks Cheat Sheet

m{a-zA-Z}Set mark {a-zA-Z} at cursor positionDoes not move the cursor, this is not a motion command.
m'm\`Set the previous context markThis can be jumped to with the '' or `` command. Does not move the cursor, this is not a motion command.
:[range]ma[rk] {a-zA-Z}:[range]k{a-zA-Z}Set mark {a-zA-Z} at last line number in [range], column 0Default is cursor line.
'{a-z}To the first non-blank character on the line with mark {a-z} (linewise)
'{A-Z0-9}To the first non-blank character on the line with mark {A-Z0-9} in the correct file
`{a-z}To the mark {a-z}
`{A-Z0-9}To the mark {A-Z0-9} in the correct file
:marksList all the current marks (not a motion command)
:marks {arg}List the marks that are mentioned in {arg} (not a motion command). For example:

Leave a Reply

Your email address will not be published. Required fields are marked *