Closed Chaitanyabsprip closed 2 months ago
+1 for git branch based sessions.
Stumbled via LazyVim over Persistence and it is working great! :) But I also would wish for branched based sessions.
+1 for session chooser and multiple sessions for same project directory :)
Came here to add my +1
I don't think multi-session management fits the purpose of this plugin, as it is a minimal wrapper for Vim's built-in session management routines. If we wand a feature-rich session manager, we should go with auto-session or persisted.
I think that there is a better/cleaner way how to achieve sessions per branch, and that is through git worktrees. Git worktrees enable you to have several worktrees (several branches) in one git repo at the same time and switch between them.
With this setup you should be able to switch git worktrees (git branches) and Neovim sessions will automatically switch also. I have not yet tried this, it's on my TODO list :)
The problem with that approach is that you're(the maintainer of the plugin) asking the users to change their workflow, spend time learning and getting used to it in order to make use of you're plugin. I believe some alternative should be considered.
@Chaitanyabsprip if you were answering my comment, I'm sorry but I'm not the maintainer of this plugin :) I just faced the same issue as you, but then I figured out that solving it through git worktrees is much cleaner.
If you really want to save sessions per branch, take a look at https://github.com/natecraddock/sessions.nvim . It's quite flexible and it probably allows to do what you want, although with a bit of code.
I did not mean that you are the maintainer. I was actually talking about the maintainer. For the session management per project per git part, I am not using a session manager anymore. I have also switched to git worktrees and I use harpoon to get to specific files.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Added:
opts.branch = true
for sessions per branchrequire("persistence").select()
I would like to see this plugin's functionality extended to have 1) a chooser of sessions and 2) ability to have multiple session for the current project(current directory). 2) can help in having separate sessions per branch as well.