A Developer In The mountains having fun

Working with and using VIM marks

Marks are a quick way in vim of marking and moving to a place in the document.

Create a mark

Uppercase marknames are instance wide and lowercase are buffer/document wide. This means that if you use an uppercase letter to create a mark that when you recall it you will go back to that line in that document no matter which document you are currently in. I love this as its very quick to move around files.

m{char} - creates a mark names {char}

    example: `ma` creates a mark names "a"

Move to a mark

'{char} - moves to the mark of name {char}

List Marks

:marks - lists all current marks

Deleting marks

if you delete a line containing a mark that mark is also deleted.

:delmarks{char} - deletes a mark of name {char}

:delmarks! - deletes all marks for the current buffer (file)

More places to find me
follow me on Mastodon