nvim-rooter.lua icon indicating copy to clipboard operation
nvim-rooter.lua copied to clipboard

Support searching greedily for root patterns

Open realSaltyFish opened this issue 7 months ago • 0 comments

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.

realSaltyFish avatar Jul 16 '24 15:07 realSaltyFish