dhruvasagar / vim-prosession

Handle vim sessions like a pro
254 stars 22 forks source link

Feature to start new session #57

Closed erlandsona closed 5 years ago

erlandsona commented 5 years ago

Somewhat related to https://github.com/dhruvasagar/vim-prosession/issues/36 https://github.com/dhruvasagar/vim-prosession/issues/3

When I first added vim-prosession I had nvim opened to my .dotfiles directory and I tried to do this :Prosession ~/code/my_project_root and that leaves me in one of two places depending on whether or not there was a :terminal buffer open in the previous session.

If there was a terminal buffer then the new session is open to seemingly the same terminal buffer and if I esc and open netrw I'm in the directory I passed to Prosession.

If there was not a terminal buffer than I start in an empty buffer and if I open netrw I'm in the directory I passed to Prosession.

I'm expecting that if I pass a new directory with no session to :Prosession that it'll start in whatever file-explorer I have installed. <- not sure this is even reasonable, but it's sort of what I expected at first.

Now I just sort of deal with it so make of this what you want :) :+1:

dhruvasagar commented 5 years ago

The terminal buffer thing is likely a kinda glitch in the way vim's native :mksession works, problems like these exist for other such special buffers, netrw included and few others like it from plugins which are setup in a way that vim wouldn't care about their existence as they are likely throw away and the plugins that create them manage their life cycle / content.

dhruvasagar commented 5 years ago

I would recommend to tap into ProsessionPost user autocmd exposed from prosession, this is triggered by prosession after switching sessions. You can open an explorer, or perform any other action as you want.