Run external command 'makeprg' and parse error messages
Example
Normal 0 / 3Command-line 1 / 3Hit-enter prompt 2 / 3Normal 3 / 3Run external command 'makeprg' and parse error messages.
Prepared diagnostic command
- makeprg
printf 'main.c:2:unknown identifier BROKEN\n'- errorformat
%f:%l:%m- autowrite
off
Current-window location list
- Entries
none
Command entered · ready to apply
Prepared diagnostic command
- makeprg
printf 'main.c:2:unknown identifier BROKEN\n'- errorformat
%f:%l:%m- autowrite
off
Current-window location list
- Entries
none
Command line
- Typed text
:lmake!- Insertion offset
7
The diagnostic command has finished. Vim waits at the shell-return prompt; the list has not been parsed yet.
Diagnostic command output
- printf stdout
main.c:2:unknown identifier BROKEN
Current-window location list
- Entries
none
Shell return prompt
- Prompt
Press ENTER or type command to continue
Acknowledge shell return. :lmake! parses the declared build output into the current-window location list; ! prevents a jump to the first error.
Diagnostic command output
- printf stdout
main.c:2:unknown identifier BROKEN
Current-window location list
- 1
main.c:2:unknown identifier BROKEN
Before & after
Before
Prepared diagnostic command
- makeprg
printf 'main.c:2:unknown identifier BROKEN\n'- errorformat
%f:%l:%m- autowrite
off
Current-window location list
- Entries
none
After
Diagnostic command output
- printf stdout
main.c:2:unknown identifier BROKEN
Current-window location list
- 1
main.c:2:unknown identifier BROKEN
Documentation-backed illustration. +quickfix; ordinary interactive terminal Vim with English messages, no :silent or queued/stuffed input; shell=/bin/sh, shellcmdflag=-c, shellquote and shellxquote empty; printf and tee available, shellpipe=2>&1 | tee, and makeef empty with a writable generated temporary errorfile; the displayed literal makeprg and errorformat; autowrite and autowriteall off, nowarn, no interfering autocommands; messagesopt=hit-enter,history:500; unrestricted shell execution; the diagnostic is emitted by printf, not an actual compiler; data only. :lmake! runs the prepared diagnostic command. After Enter acknowledges shell return, Vim parses the output into the current-window location list; ! prevents a jump to the first error. Primary help: :lmake.
int main(void) {
BROKEN
}Cursor on line 1, column 1Details & Vim help
Run external command 'makeprg' and parse error messages. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. The index spelling :lmak[e] puts the optional abbreviation suffix in square brackets; those brackets are not typed. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.