-
The problem i'm having is, I open a project folder, i navigate to some subfolder, or a plugin sets the cwd to some other dir when i use it (neorg in my case). After that, when I run SaveSession, I'd like it to just overwrite whatever session I opened last. Current behaviour is, SaveSession just writes the session file with the same name as cwd, which just clutters my session folder with a bunch of sessions i never wanted. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Something I've been meaning to implement for a while now is cwd tracking. It's now possible because Neovim provides a What this would do is track that the cwd changed within the plugin and then do something with that information. That something would probably be to ignore a SaveSession happening when a cwd changes to start with. |
Beta Was this translation helpful? Give feedback.
Something I've been meaning to implement for a while now is cwd tracking. It's now possible because Neovim provides a
DirChanged
andDirChangedPre
aucmds.https://sourcegraph.com/github.com/neovim/neovim/-/blob/src/nvim/auevents.lua
What this would do is track that the cwd changed within the plugin and then do something with that information. That something would probably be to ignore a SaveSession happening when a cwd changes to start with.