Marks as Motions


Since we are on the topic of navigating, you can also use marks as motions when navigating. For example, if you want to yank or delete a chunk of text that doesn't quite fit any of the built-in motions or text-objects, you can always move to the text, mark it, then use that as a guide for the yank or delete.

Following the pattern

{operator}{motion}

in order to yank everything from the cursor to mark a one could use

y`a

and similarly to delete everything up to and including the line containing mark a one could use:

d'a