projectile
projectile copied to clipboard
Add variable to remember most recent project
I think it would be useful to provide a variable such as projectile-most-recent-project
that remembers the most recent project that you were working in. It is common that I am working on a project and then I switch to a buffer that is related to what I am doing even though it is not a member of any project. Unfortunately when I try to switch projectile buffers again I get "You're not in a project".
If such a variable existed I could easily write my own projectile wrapper functions that default to the most recent project.
I am not the only person that has wanted a way to access the most recent project: #664
I looked into opening a PR that adds this variable, but I could not figure out which function should set this variable so it works reliably across all of projectile. If you could give me some advice on how to do this I would be happy to make the change myself!
PR welcome!
I think it'd be probably best to update this somewhere in projectile-switch-project
, but making the tracking reliable will be hard as someone can switch between projects just by opening a new file or switching to some open buffers without using projectile-switch-project
.
making the tracking reliable will be hard as someone can switch between projects just by opening a new file or switching to some open buffers
This is exactly the problem I ran into when I tried to implement this myself, and this functionality is pointless to add if it does not work when switching buffers and opening files.
Well, depends on how people normally use Projectile. I always use switch-project
, so something like this will work just fine for me. :D
There's even a hook that'd be handy for this projectile-after-switch-project-hook
.