Shatur / neovim-session-manager

A simple wrapper around :mksession.
GNU General Public License v3.0
530 stars 52 forks source link

feature: delete current dir session #107

Closed adrianord closed 10 months ago

adrianord commented 10 months ago

Fixes: #104

Adds a delete_current_dir_session command.

A caveat to this command is that if autosave is turned on, it will end up saving the session again on exit. A simple work around for this is to delete all the buffers (e.g. :bufdo bd) before running the command. I think there may be a way around this, but feel it's out of scope of this PR.

pmatulis commented 10 months ago

If the new command won't effectively work without deleting all buffers beforehand when autosave is enabled why not include a check for this situation and do what's needed? Or maybe include an option to enable that extra behavior?

adrianord commented 10 months ago

@pmatulis I wanted to at least get the command out there to use.

Unfortunately getting it to work with autosave is a bit more tricky because we need to persist that we ran the command so when we exit and run autosave we know not to save. I'm sure it's possible, but I'm not a lua expert and wanted to at least get the command out. I might plug along later on this though, because I kind of want it, too.