Replies: 1 comment 2 replies
-
Neotree should restore the cwd as-is, so I wonder why persistence.nvim does not save the root dir. If you want to restore with the project root, I advise you to try to make persistence save the root dir in the first place and not try to do something on restore. We are having discussions on how to restore neo-tree's state when restored with auto-session, so this might give you a hint. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to make neo-tree always open the root of the project instead of cwd.
Sometimes, when I am using https://github.com/folke/persistence.nvim, and restore the session neotree changes the root to the folder of restored file, which is suboptimal. I want to always bind to the root. I want to be able to calculate it like any file with .git or yarn.lock or package-lock etc... How can I achieve that with neo-tree?
I checked the dir option, but the dir option is supposed to be a vim.fn.expand string which only allows to use file modifiers. And I want something that will allow me to use vim.fs.find('.git', {upward: true, type: "directory"...}) kind of stuff.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions