Reputation: 16059
I'm working on a compiled project in Vim (Typescript). make %
will build an individual file. I use this to check for errors. This is great for error checking, but it creates compiled files next to the source files that I don't need.
For my actual build process, I have a single command that compiles everything. This is in a Makefile.
I'd like to be able to map a key command to "build my whole project" in a generic way, so if I'm editing any .ts
file underneath my project directory, it runs that specific command.
How can I do this?
Upvotes: 1
Views: 440
Reputation: 392931
The trick would be to actually use a Makefile:
all: complete.exe
complete.exe: *.ts
somecompilation-command $^ -o $@
This way, you can just leave makeprg
at 'make':
:set makeprg&
And happily do:
:mak
Upvotes: 4