xolox / vim-session

Extended session management for Vim (:mksession on steroids)
http://peterodding.com/code/vim/session/
961 stars 80 forks source link

Is there any way to suppress the 'args' line in a saved session? #111

Closed ghost closed 9 years ago

ghost commented 9 years ago

Win7/Win8, gvim 7.4. I use "gvim --remote-silent " regularly. Narrative:

So, the question: Is there any way to suppress the 'args' line when saving a session?
(Looking into sessionoptions, I didn't see any clear way to do it.)
Thanks --

ghost commented 9 years ago

I ended up hooking up, to the VimLeave event, a .cmd file that runs a PowerShell script that extracts all "args ...." lines. Slows down closing gvim slightly, and I am concerned there is no guarantee that my VimLeave handler will be called after"SaveSession default", but so far it is working as expected.

ghost commented 9 years ago

The heart of problem seems to be that vim-session (or perhaps it is the native mksession?) doesn't take the most direct route and save a list of loaded buffers when SaveSession is called.
The problem I was trying to solve was buffers that were opened during the session, but had been closed before the session was saved. Unfortunately, my stop-gap had the undesirable side-effect of removing buffers that had been opened during the session and were still open when SaveSession is called.