nvim-lua / wishlist

A public catalogue of Lua plugins Neovim users would like to see exist
MIT License
235 stars 0 forks source link

Github-Branch based Auto-Session-Management #43

Open joehannes opened 2 years ago

joehannes commented 2 years ago

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:* ?

matu3ba commented 2 years ago

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

ariel-frischer commented 2 years ago

Auto session supports this feature now.