Sagar Jain
Sagar Jain

Reputation: 7941

How to clear marks permanently in Vim?

:delm a-zA-Z0-9

does clear all marks, but when I close the file and reopen the marks still exists.How to clear all the marks permanently?

Upvotes: 2

Views: 2221

Answers (2)

luoluo
luoluo

Reputation: 5533

Try :delmarks!

If you delete a line containing a mark, the mark is also deleted.

If you wipeout a buffer (command :bw), all marks for the buffer are deleted.

The :delmarks command (abbreviated as :delm) may be used to delete specified marks.

Command         Description
:delmarks a     delete mark a
:delmarks a-d   delete marks a, b, c, d
:delmarks abxy  delete marks a, b, x, y
:delmarks aA    delete marks a, A
:delmarks!      delete all lowercase marks for the current buffer (a-z)

wiki for Using_marks

Upvotes: 3

Christian Brabandt
Christian Brabandt

Reputation: 8248

This can happen, if you have a second vim instance open, that will write the viminfo file and effectively re-adding the mark back to the viminfo file. So you either need to clear the mark in all vim instances, or try to synchronize the reading and writing of the viminfo file. This link from the faq should work.

Upvotes: 1

Related Questions