when exiting vim and then re-entering, all bookmarks have gone
have found out how to remember last position between files, but not how to remember bookmarks after having exited.
is there a way to configure vim so that bookmarks are remembered for a file?
To set a mark, type m followed by a letter. For example, ma sets mark a at the current position (line and column). If you set mark a, any mark in the current file that was previously identified as a is removed. If you set mark A, any previous mark A (in any file) is removed.
To Save a Session ( :mksession , :mks )vim file on the directory where the current Vim execution was started. Using exclamation mark, :mks! the command overwrites Session. vim file if it exists in the directory. You can specify a custom file name to save the session :mks!
You can save the current session (or buffer layout) by giving the command :Obsession . If you don't supply an argument, it writes a session file called Session. vim by default. To reload a session, either use vim -S <session-name> or :source <session-name> if you're inside Vim already.
Yes. Add the following to your .vimrc
:
:set viminfo='1000,f1
But note:
Lowercase marks 'a to 'z are remembered as long as the file remains in the buffer list. If you remove the file from the buffer list, all its marks are lost. If you delete a line that contains a mark, that mark is erased.
So you'll need to use uppercase or numeric marks.
See:
:he 21.3
:he E20
...for more information.
You may also find :mksession
useful if you want to save session state.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With