Skip to content

how to retrieve workspace root from .vimrc #1805

Answered by tpope
rameshsanth asked this question in Q&A
Discussion options

You must be logged in to vote

The reason you can't call FugitiveWorkTree() is because Vim loads your vimrc before it loads plugins. Rather than attempt to work around this, I am instead inclined to direct you to projectionist.vim, which provides a robust implementation of the exact behavior you're looking for. Here's an example config that does what you want:

let g:projectionist_heuristics = {
      \ '.git/': {'path': ['src', 'test']}
      \ }

Even better, change .git/ to something more specific, like pom.xml.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tpope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants