wishlist icon indicating copy to clipboard operation
wishlist copied to clipboard

Github-Branch based Auto-Session-Management

Open joehannes opened this issue 2 years ago • 2 comments

What? I quite like advanced session management as in existing plugins (rmagatti/auto-session, jedrzejboczar/possession.nvim), but they lack one feature per default: automatic session management as of current git-branch (reflecting current working ticket). Additionally I'd like to see a picker as well, just in case an old task gets picked up again in a new (bugfix/chore/...)-branch and I want to reuse that old session of the old branch

Why? Session management is useful if you work on the same project, right? But inside of a project, I usually got different sessions/layouts/tabpages as per task, which is usually reflected by specific branches.

Potential existing implementations: https://github.com/superDross/ticket.vim

Potential pitfalls: ?

joehannes avatar Apr 29 '22 17:04 joehannes

This should be relative straightforward to implement with shell script wrappers around your start file that looks up 1. the git branch, 2. path to load the session file from predefined paths (nvim -S sessionfile) and conversely storing the session file with a lua command that calls :mksession/:mksession!.

Once you are done with this, you can convert the hacky solution into a lua plugin.

Personally I do optimize to get fast my files fast into the buffer and available to harpoon via https://github.com/asbjornhaland/telescope-send-to-harpoon.nvim and telescope search -> C-q -> :cfdo :badd %.

matu3ba avatar Jul 07 '22 20:07 matu3ba

Auto session supports this feature now.

ariel-frischer avatar Oct 23 '22 17:10 ariel-frischer