tpope / vim-obsession

obsession.vim: continuously updated session files
http://www.vim.org/scripts/script.php?script_id=4472
1.74k stars 68 forks source link

Toggle obsession also with filename #77

Closed hacktivateit closed 1 year ago

hacktivateit commented 1 year ago

Right now it's possible to toggle the recording of a session only with the command Obesssion with no parameter, allowing to start and stop the tracking with the exact same command (really useful because i only need one mapping)

But if i want to save the session file with a different name i need two different commands, one with the filename to start the tracking and one without to stop it Obsession .session.vim -> Start tracking Obesssion -> Stop tracking

Wouldn't it make more sense to allow the toggling of the tracking with the exact same command also when a filename is specified? Obsession .session.vim -> Toggle the tracking

tpope commented 1 year ago

I think it would be confusing if :Obsession myfile.vim didn't start writing the session myfile.vim. If you want to rig up a toggle map, I imagine you could achieve it by fiddling with the internal variable g:this_obsession. Just make sure it's an absolute path.