gennaro-tedesco / nvim-possession

📌 the no-nonsense session manager
MIT License
215 stars 7 forks source link

Add auto save on event, i.e: VimExit? #6

Closed tmpm697 closed 1 year ago

tmpm697 commented 1 year ago

manually saving can be tedious, how about auto-save when VimExit?

This also mean that you don't need to have user input a name and then restore it later, can just use some kind of default from nvim like: /s/p/d/abc/session-folder.

gennaro-tedesco commented 1 year ago

Yes, this can be done too, I will look into it.

can just use some kind of default from nvim like

I would ideally implement this for the cases when a session is loaded already, so that a name and a session file already exists and it's evident the user is still working on it. As such, what is needed is just an autocommand to re-save the session on VimExit.

tmpm697 commented 1 year ago

yes, autocmd to watch on PreDirChange and DirChange would cover switching sessions and VimExit should cover exit vim event.

gennaro-tedesco commented 1 year ago

Correct, that shouldn't be too hard, I will give it a go later!

gennaro-tedesco commented 1 year ago

Autosave mechanism is now merged on main after v0.0.3

Still to work on the switch and dir change, but we are getting there :)