zefei / vim-wintabs

Modern buffer manager for Vim
MIT License
325 stars 25 forks source link

Support obsession / global session option is required to work with vim sessions #35

Closed dylan-chong closed 6 years ago

dylan-chong commented 6 years ago

Not sure if this is the right place to put the issue, but it would be great if obsession was able to save all of the buffers so Vim is exactly the way it is left when reloading the session.

zefei commented 6 years ago

Support for vim sessions should be out of the box as long as you have the correct settings for vim session: sessionoptions should contain 'globals'. I'm not sure if vim-obsession is an edge case.

Let me know if this doesn't work for you. I'll need a minimal repro vimrc from you if that's the case.

dylan-chong commented 6 years ago

Hooray using the global session option works is!

I have one concern about using this option though. One benefit of using sessions is that if I am playing around with my Vim set up, and I want a clean reload of Vim (but still reopen all my files), I can just type :wqa<cr> then nvim -S.

If I enable the global session options then doing the above reload would not clean Vim very well, because there are a whole lot of global variables that are saved.

So basically, to get obsession working with this plug-in, there will be a much of side-effects.

I'm really not sure what the solution could be.

dylan-chong commented 6 years ago

I just found this by googling https://github.com/xolox/vim-session#the-gsession_persist_globals-option which allows persistence of specific global variables. I might have a play with this later tonight.

zefei commented 6 years ago

Yeah I use vim-session myself, and wintabs supports vim-session out of the box: you don't need to register the wintabs global.

dylan-chong commented 6 years ago

Nice ! Actually works perfectly!!

I was using obsession because that was the recommended session plug in for tmux-resurrect. I'm going to add instructions on how to use vim-session instead of obsession on that repo in this pull request that i will finish later https://github.com/tmux-plugins/tmux-resurrect/pull/257