Thanks for the great plugin!
I mostly program in Rust, and adding Cargo.toml to g:rooter_patterns usually works to find the correct project root when working in rust projects.
However, Rust supports workspaces with directories with Cargo.toml files. In this case, sometimes vim-rooter will stop at a Cargo.toml file in a subdirectory.
In such cases, I'd rather vim-rooter use the location of the .git directory to find the project root.
I was thinking about how vim-rooter might support this, and one possibility is to to allow setting g:rooter_patterns to multiple sets of patterns, which would be checked in order.
In my this case, I would use the following configuration:
let g:rooter_patterns = [['.git/'], ['Cargo.toml']]
vim-rooter would first search for a .git directory, and only if that failed search for a Cargo.toml file.
I think this would be a pretty simple change. A new configuration option, g:rooter_pattern_groups. If it was unset, it would default to [g:rooter_patterns], for backwards compatibility. And the implementation would be an additional for loop around the main for loop in plugin/rooter.vim.
Thanks for the great plugin!
I mostly program in Rust, and adding
Cargo.tomltog:rooter_patternsusually works to find the correct project root when working in rust projects.However, Rust supports workspaces with directories with
Cargo.tomlfiles. In this case, sometimesvim-rooterwill stop at aCargo.tomlfile in a subdirectory.In such cases, I'd rather
vim-rooteruse the location of the.gitdirectory to find the project root.I was thinking about how
vim-rootermight support this, and one possibility is to to allow settingg:rooter_patternsto multiple sets of patterns, which would be checked in order.In my this case, I would use the following configuration:
vim-rooterwould first search for a.gitdirectory, and only if that failed search for aCargo.tomlfile.I think this would be a pretty simple change. A new configuration option,
g:rooter_pattern_groups. If it was unset, it would default to[g:rooter_patterns], for backwards compatibility. And the implementation would be an additional for loop around the main for loop inplugin/rooter.vim.