leafOfTree / vim-project

A vim plugin to manage projects and sessions
The Unlicense
23 stars 2 forks source link

Add current path to Project Manger #6

Closed ooing closed 1 year ago

ooing commented 1 year ago

Do not enter the full path the path, may be too long can add new command ?

leafOfTree commented 1 year ago

Good point, thanks. The current path is also added to project_base with https://github.com/leafOfTree/vim-project/commit/83a57a2dc60a9aed910921b18f471e207f881cfa. Now you can add the project under the current path by its folder name directly.

ooing commented 1 year ago

I ues plug

Plug 'leafOfTree/vim-project',{'on':['Project','ProjectList','ProjectSearchFiles','ProjectFindInFiles']}

Unable to take effect for the first time

leafOfTree commented 1 year ago

Please update vim-project to the latest via your plugin manager, as I just added some changes to support ../ in path.

To clarify, the current path is also called the working directory (the output of :pwd). It can be changed by :cd. Also see the option autochdir.

It becomes a bit confusing when opening a directory other than a file. It depends on which directory browse plugin (netrw, nerdtree, fern, etc.) you use, so remember to check it via :pwd.

For example, with the file structure

- tmp/
   |- abc/
   |- package.json

Open tmp or package.json, make sure :pwd is /path/to/tmp, then I can run :Project abc to add the project abc.

I also can run :Project ../tmp to add the project tmp. Another way is to call :cd .., then I can just run :Project tmp.

ooing commented 1 year ago

@leafOfTree thanks