GnikDroy / projections.nvim

A map to your filesystem
GNU General Public License v3.0
236 stars 8 forks source link

Keep track of current project #30

Open Gazareth opened 1 year ago

Gazareth commented 1 year ago

As requested in #27

This brings in some changes which make switcher more responsible and keep track of the projects its opened. Some functionality is moved away from session into switcher.

I know you want to keep projections.nvim very tiny which I appreciate, however I hope you will consider that this paves the way for potential future functionalities like:

The implementation in this PR already allows some cool functionality, e.g. I am showing in my statusline that I'm inside a project:

image

Or not

image

And now a session is not overwritten when browsing a file within a workspace project that you didn't use projections.switcher to open!

Let me know if you want anything tidying up, I was treating this as a proof of concept for the majority of the time so some things might be loosely named etc.

GnikDroy commented 1 year ago

Sounds promising. Thank you for the PR. I will take a look at integrating this in a few days (am busy for a few days) 😄

One thing I noticed is - doc/projections.txt. This file doesn't need to be updated, since it is generated from README automatically.

Gazareth commented 1 year ago

Sounds promising. Thank you for the PR. I will take a look at integrating this in a few days (am busy for a few days) 😄

One thing I noticed is - doc/projections.txt. This file doesn't need to be updated, since it is generated from README automatically.

Cheers for looking. I converted it to draft because I was having some trouble with some autocmds, turns out it was due to directory paths being inconsistent (darn Windows and its "\" separator).

Also added a check within the switcher to make sure the project is a valid one by reusing the workspace logic found in Session.

GnikDroy commented 1 year ago

Apologies for being a bit late. But I will take a look at this today. 😄