How can I (automatically, basically I shouldn't have anything to do apart from initial configuration) set vim cwd to the project root directory (if there's any) or to the current buffer directory (in an autochdir
fashion)?
Here is an example of a file path to expected cwd: ~/foo/bar/SOME_FILE
-> ~/foo
if there is a ~/foo/.git/
dir or a ~/foo/.hg/
dir otherwise ~/foo/bar/
I'm aware of airblade/vim-rooter but it doesn't quite work (e.g. it relies on specific file extensions, and I don't want this behavior).