MaikoID
MaikoID

Reputation: 5007

VIM - How can I store vim bookmarks in sessions files?

How can I store the bookmarks belonging to a session not belonging to a file ? I want to have multiple sessions and each one have different bookmarks for the same files. I want to mimic an IDE behavior.

BR

Upvotes: 0

Views: 214

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172748

File marks are stored in the viminfo file, not in sessions, and there's unfortunately no value in 'sessionoptions' that would enable that.

So, there's no easy solution, just workarounds that are more involved. Some ideas:

  • You can write separate viminfo files via :wviminfo [file], and then read them via :rviminfo. You could use that (maybe with a tweak to the 'viminfo' option to reduce what gets written) in addition to session files.
  • Write / find a bookmark plugin that persists in an uppercased global variable, which is captured in a session via the globals value.
  • Extend a plugin like session.vim - Extended session management for Vim that does post-processing of the written session, anyway, and add the marks info (via :call setpos("'[mark]", ...) in there.

Upvotes: 2

Related Questions