Last Updated: February 25, 2016
·
1.242K
· andrewjsledge

Tips for using markers in vim

Within vim's command mode

ma

Sets the marker "a" at the current cursor position.

marks

Shows you the markers you have placed.

Moving around

'a

Moves to the first non-blank character on the line for maker "a".

`a

Moves to the first character (blank or otherwise) on the line for marker "a".

Uses

d'a

Will delete everything from the current cursor position all the way up to and including the line containing maker "a".

y'a

Will yank everything from the current cursor position all the way up to and including the line containing "a".

Fun uses

'as/Lorem/lorem/g

Replaces "Lorem" with "lorem" at marker "a".

,'ds/Lorem/lorem/g

Replaces "Lorem" with "lorem" from the current cursor position all the way up to and including the line containing marker "d".