how to retrieve workspace root from .vimrc #1805
-
This is a basic VIM question.. I'm stumped and cannot figure this out.. I would like to retrieve the Git workspace root and setup the "path" variable appropriately from .vimrc let s = call('FugitiveWorkTree', []) But i get this error. Its clear i'm unable to access the Fugitve functions from .vimrc.. Lightline does something like this.. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The reason you can't call
Even better, change |
Beta Was this translation helpful? Give feedback.
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:Even better, change
.git/
to something more specific, likepom.xml
.