Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable autosave.cwd even if a session is already loaded #76

Open
noearchimede opened this issue Jul 23, 2024 · 1 comment
Open

Enable autosave.cwd even if a session is already loaded #76

noearchimede opened this issue Jul 23, 2024 · 1 comment

Comments

@noearchimede
Copy link

Hello, first of all thanks for your work on this plugin!

I was wondering if it is possible to have sessions based on the CWD be updated regardless of a "named session" being loaded.
As an example, I was thinking of the following use case:

  • open nvim
  • load a session "my_project" that (among other things) sets the CWD to ~/my/project/
  • add windows, buffers, etc. while working normally
  • close nvim -> here the cwd session whould be updated automatically

After this there would be two possibilities to continue working:

  • open nvim in ~/my/project/
  • load the cwd session for ~/my/project/
  • continue working from the exact same state as above
  • open nvim
  • load the "my_project" session
  • continue working form a "clean" starting session

I know that the docs for autosave.cwd say that "Automatically save session based on current (global) working directory
if no session has been loaded yet", but is it possible to bypass that caveat somehow in the config? Otherwise, is this something you would consider implementing?

@jedrzejboczar
Copy link
Owner

Hi, sorry for late response. This is not possible currently. I've quickly hacked some solution here: #77. I didn't really test it, but you can give it a try, hopefully it works. And if not, maybe someone will have a starting point for a proper solution. The final solution would have to consider possible edge-cases, as the autosave/load functionality got quite complicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants