Is there a way to tell vim to run the makeprg
in a specific directory? I use per-project .vimrc files, and they would seem the perfect place to inform vim of where each project should be built, regardless of the current directory.
:let &makeprg='(cd /tmp && make)'
seems to work nicely for me
:se makepgr="(cd %:h/.. && make)"
to make it go to the parent directory
The above worked on windows when I tried it; Today on linux I found out that I somehow had to use the following incantations to get the same to work:
:let &makeprg='(cd %:h/.. && make)'
Note I'm assuming you don't actually use make, because that would be a simple
:make -C /tmp
awayNote most other automated build systems have a similar option, e.g.
:!scons -C /tmp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With