Reputation: 10902
I would like to "clear all marks".
Optional notes: (feel free to skip them)
Some numbered marks refer to files I haven't edited in a long time, I don't know why they are there, how they got created, how they could be useful and since they refer to files on networked drives, I suspect they may be part of a problem I have with my MacVim, which occasionally hangs with 100% CPU utilisation when closing and exiting. The latter is a potentially completely unfounded "superstition", but I have run out of things to check so I am resorting to blurting out nonsense in desperation.
Upvotes: 70
Views: 34468
Reputation: 481
If you are using neovim, and your marks are returning after deleting the marks, saving the file, closing and reopening it, then you have to do the following:
Delete the marks with :delm! | delm A-Z0-9
, then force the Shada write :wshada!
.
(In Neovim the mark information is stored in shada, and the marks are "permanent".)
You might want to use a plugin like chentoast/marks.nvim
to come around this issue.
Upvotes: 2
Reputation: 161984
:delm[arks]! Delete all marks for the current buffer, but not marks
A-Z or 0-9.
{not in Vi}
'A - 'Z
uppercase marks, also called file marks, valid between files'0 - '9
numbered marks set from .viminfo
file.To delete them:
:delmarks A-Z0-9
Note: ~/.viminfo
contains histories and marks, if you don't want them any more, you can delete this file. Vim will recreate it next time.
So, you can do this to clear all marks:
:delm! | delm A-Z0-9
Upvotes: 102
Reputation: 40947
Vim stores this type of information in ~/.viminfo. This file holds much more information than just marks by default. The exact information stored can be controlled by the 'viminfo' option.
See :help 'viminfo'
for more information about disabling specific features.
You may be able to "fix" your issue by removing this file and having vim recreate it when you start it again. Be aware that you'll lose the extra information stored there but I believe your marks should all be cleared.
Upvotes: 8