folke / persistence.nvim

💾 Simple session management for Neovim
Apache License 2.0
638 stars 26 forks source link

multiple session per directory. #9

Closed Chaitanyabsprip closed 2 months ago

Chaitanyabsprip commented 2 years ago

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.

osenvosem commented 1 year ago

+1 for git branch based sessions.

nikbrunner commented 1 year ago

Stumbled via LazyVim over Persistence and it is working great! :) But I also would wish for branched based sessions.

benjaminls commented 10 months ago

+1 for session chooser and multiple sessions for same project directory :)

Angelelz commented 10 months ago

Came here to add my +1

b0ae989c commented 9 months ago

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.

Dom324 commented 4 months ago

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.

  1. Use plugin like https://github.com/ThePrimeagen/git-worktree.nvim
  2. Hook that plugin such that when you switch git worktree (branch), it will send signal to Persistence.nvim (or to a different session management plugin) to switch sessions

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 :)

Chaitanyabsprip commented 4 months ago

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.

Dom324 commented 4 months ago

@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.

Chaitanyabsprip commented 4 months ago

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.

github-actions[bot] commented 2 months ago

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.

folke commented 2 months ago

Added: