dhruvasagar / vim-prosession

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

default session #3

Closed briceburg closed 9 years ago

briceburg commented 9 years ago

Hi -- I really enjoy your plugin. Having sessions in a central location is important -- Do you think it's worthwhile to introduce an option to allow a "default" session to autostart (one that is not based off the current working directory where vim is instantiated from without arguments)?

Opening anoter issue re: session naming

dhruvasagar commented 9 years ago

Hi,

The problem with a 'default' session is that it then requires mentioning of a session name explicitly in case we need it. The only way a 'default' session could work would be that if we find that there is no session that already exists for the current directory I could launch the default session instead of creating a new one, but even in this case this breaks the flow since the most likely use case of launching vim from a certain directory is to work with files in that directory instead of some other.

briceburg commented 9 years ago

@dhruvasagar roger that. I think about it a bit differently -- I want to use the default session / last state (most times), and to explicitly start [better named] sessions for particular projects as needed, vs. on the fly.

Sometimes I'll enter vim from very odd directories :) -- the current behavior will create a lot of session files, that I thought could be cleaned up w/ a flag to allow default sessions.

dhruvasagar commented 9 years ago

Sure, I get it, i'll work on adding a flag to enable default sessions, in which case if a session for the current directory doesn't already exist it will just load the default session. Mind you, this applies also to the first time you launch vim, it will create this default session instead of a new one.

briceburg commented 9 years ago

This behavior would be great in my case -- as it would keep autocompletion of sessions to a minimum (and hopefully only to the default session and explicit ones I have created).

I want to understand how to create a new session that gets autoloaded when executing vim from the "session directory" under the new [default session] behavior. Would it work like:

" default session is currently loaded, lets start a new one for ~/projects/project
:Prosession ~/projects/project
:tabedit ~/projects/project/file.txt
:xa
cd ~/projects/project
vim

vim should be opened with ~/projects/project/file.txt loaded in a tab via the ~/projects/project Prosession.

??

dhruvasagar commented 9 years ago

Kindly have a look and let me know. It works as desired as per my tests. Raise a flag / issue if you find something wrong.