nvim-rooter.lua
nvim-rooter.lua copied to clipboard
Support searching greedily for root patterns
Suppose my project located at /project
has a git submodule /project/module
. Setting manual = false
will result in Rooter cd'ing to /project/submodule
every time I open a file in the submodule, causing some inconvenience.
Greedy search could be a handy option, i.e. go up in the hierarchy until it hits a directory not containing .git
, and set the root to the last seen directory containing .git
. In this example, it would not stop at /project/submodule
, and would instead continue looking for .git
in /project
, then /
. Since /
doesn't contain a .git
directory, the project root shall be set to /project
.