tpope / vim-vinegar

vinegar.vim: Combine with netrw to create a delicious salad dressing
https://www.vim.org/scripts/script.php?script_id=5671
2.22k stars 87 forks source link

Feature Request: go to the project root #107

Closed last5bits closed 5 years ago

last5bits commented 5 years ago

I absolutely love the "~" mapping that opens the home directory. What about having a similar mapping that opens the root of the current project? This can be defined as the closest parent directory that has .git inside of it.

tpope commented 5 years ago

That's a pretty limited definition, but if that's what you want, it's a one liner with Fugitive:

autocmd FileType netrw nnoremap <buffer> g~ :Gedit :/<CR>

Personally my needs are more elaborate than that and I'd rather have something Projectionist based:

autocmd FileType netrw nnoremap <buffer> g~ :edit `=projectionist#path()`<CR>

At any rate, I consider "project root" to be outside the scope of Vinegar.