Save vim tabs without saving vim environment / Reload vim environment

0

My vim environment occasionally becomes corrupted because of plugin/user errors (e.g. :bdelete in the NERDCommander window), and I'd like to "reload vim".

:mksession allows vim to "save" tabs for reopening, but it also saves the broken environment.

I'm thinking any of these could solve the problem:

  1. :mksession in a way that discards the current vim environment
  2. Somehow load an environment from a fresh vim startup
  3. Automate my manual solution: Export currently open tabs, restart vim, and reopen each tab

Kache

Posted 2013-08-05T02:23:00.453

Reputation: 821

Answers

0

You can influence what :mksession persists via the 'sessionoptions' setting. For instance, by removing options from it, changed options and mappings aren't persisted any more.

Also, the saved session is just a Vim script. You can manually / automatically filter out stuff that is broken or not needed. The session.vim - Extended session management for Vim plugin does this sort of postprocessing, too.

Ingo Karkat

Posted 2013-08-05T02:23:00.453

Reputation: 19 513