dhruvasagar / vim-prosession

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

Does it support windows? #31

Closed alex-shamshurin closed 7 years ago

alex-shamshurin commented 7 years ago

I see my project dirs in ~/.vim/session. But when I want to switch to a project :Prosession myproject I got Directory myproject does not exists. How to solve it?

dhruvasagar commented 7 years ago

Hi, I haven't extensively tested on windows but it should work. This error message was added very recently and is to indicate that myproject isn't an existing directory on the file system. This would happen if you tried to invoke the same command but a session doesn't yet exist for that.

Did you try using the autocompletion for the command ? Is myproject a valid directory by itself (full qualified path) ?

alex-shamshurin commented 7 years ago

Hmm, why it needs valid PATH instead of directory name? What do we want? Load session and sessions are user-space global and they are under session folder. Why we need the path? Path must be in session file itself, I think.

dhruvasagar commented 7 years ago

If you use the command completion, you can type directory names (without fully qualified path), it will complete them to the fully qualified paths if there already exists a session for them.

The command completion also completes actual file system paths for you, relevant when you want to choose a path for which you don't already have a session.

If you specify just a directory name by itself it's not good by itself because people can have same directory names in different paths so there arises a scenario of conflicts.

Edit: So to simply things, you should use the completion, even for your myproject, so you can simply say :Prosession myproject<TAB>and it will get completed to the fully qualified path as long as there exists a session for myproject already, the completion will include multiple candidates in case the same myproject directory exists in different path trees.

alex-shamshurin commented 7 years ago

Whatever I do path is not found

dhruvasagar commented 7 years ago

Ok, I have a windows machine, i'll try setup vim and test it out, I am sure, some API I use may be unix specific and may be causing this issue. I'll link to this issue if I push a fix.

alex-shamshurin commented 7 years ago

May better to search for project name without path? It's like any IDE do. Just loop through each session name in session and parse it for last part which is a project name. If there are more than one, ask user what to open.

dhruvasagar commented 7 years ago

That doesn't work when there are multiple projects / directories with the same name. This happens a lot more often that you would think, and is in fact the reason for why we complete by complete paths and remove any scope of such ambiguity.

alex-shamshurin commented 7 years ago

If there are many dirs with same name just ask user what project should be opened. It there is only one just open. Is that a problem?

dhruvasagar commented 7 years ago

Well that approach requires more user intervention that is necessary...this way is just simpler, you dont have to type the full path anyways, because the completion completes it

in your case (I am guessing), it's probably more a question of some translation error between the path and the session file name somehow, or maybe something to do with just session home. I am setting up vim on windows will take a closer look tonight, been long due.

dhruvasagar commented 7 years ago

It might still take a day or more though

alex-shamshurin commented 7 years ago

Under windows 10 bash competition works. But working with project names will be nice. I would help with it, but now I do now know vimL

dhruvasagar commented 7 years ago

There is another request by ~someone~ you to provide an interesting way to provide the completion, i will try to go that way, providing a source for unite.vim / ctrlp.vim for session file completion

alex-shamshurin commented 7 years ago

Ok. but my ideas are

  1. Project lists window
  2. Open by project's name
  3. unite.vim / ctrlp.vim it's ok
alex-shamshurin commented 7 years ago

Closed, session selection is more easy with https://github.com/gikmx/ctrlp-obsession