The program that will be run when the `:make` command is executed.
When you run the :make [arguments]
command, Vim runs the program defined in the makeprg
variable. The default for makeprg
is simply the "make" program (with the arguments as defined in the [arguments]
part of the command) but it can be changed.
It is common to have different makeprg
configurations for different file formats, see autocmd for information on how to perform this.
Since different programs may require extra arguments, you can use Vim expansions in makeprg
:
%
expands to name of the file being edited.#
expands to the name of the alternate file.%<
expands to the name of the current file without the extension.
Examples:
- Haskell:
set makeprg=ghc\ %<
- Python:
set makeprg=python\ %
See also: