"rest" of a single-line file message %O/P/Q
%p pointer line (finds a sequence of '-', '.', ' ' or
tabs and uses the length for the column number)
%*{conv} any scanf non-assignable conversion
%% the single '%' character
%s search text (finds a string)
The "%f" conversion may depend on the current 'isfname' setting. "~/" is
expanded to the home directory and environment variables are expanded.
The "%f" and "%m" conversions have to detect the end of the string. This
normally happens by matching following characters and items. When nothing is
following the rest of the line is matched. If "%f" is followed by a '%' or a
backslash, it will look for a sequence of 'isfname' characters.
On Windows a leading "C:" will be included in "%f", even when using "%f:".
This means that a file name which is a single alphabetical letter will not be
detected.
The "%b" conversion is used to parse a buffer number. This is useful for
referring to lines in a scratch buffer or a buffer with no name. If a buffer
with the matching number doesn't exist, then that line is used as a non-error
line.
The "%p" conversion is normally followed by a "^". It's used for compilers
that output a line like: >
^
or >
---------^
to indicate the column of the error. This is to be used in a multi-line error
message. See |errorformat-javac| for a useful example.
The "%s" conversion specifies the text to search for, to locate the error line.
The text is used as a literal string. The anchors "^" and "$" are added to
the text to locate the error line exactly matching the search text and the
text is prefixed with the "\V" atom to make it "very nomagic". The "%s"
conversion can be used to locate lines without a line number in the error
output. Like the output of the "grep" shell command.
When the pattern is present the line number will not be used.
The "%o" conversion specifies the module name in quickfix entry. If present
it will be used in quickfix error window instead of the filename. The module
name is used only for displaying purposes, the file name is used when jumping
to the file.
Changing directory
The following uppercase conversion characters specify the type of special
format strings. At most one of them may be given as a prefix at the beginning
of a single comma-separated format pattern.
Some compilers produce messages that consist of directory names that have to
be prepended to each file name read by %f (example: GNU make). The following
codes can be used to scan these directory names; they will be stored in an
internal directory stack. *E379*
%D "enter directory" format string; expects a following
%f that finds the directory name
%X "leave directory" format string; expects following %f
When defining an "enter directory" or "leave directory" format, the "%D" or
"%X" has to be given at the start of that substring. Vim tracks the directory
changes and prepends the current directory to each erroneous file found with a
relative path. See |quickfix-directory-stack| for details, tips and
limitations.
Multi-line messages *errorformat-multi-line*
It is possible to read the output of programs that produce multi-line
messages, i.e. error strings that consume more than one line. Possible
prefixes are:
%E start of a multi-line error message
%W start of a multi-line warning message
%I start of a multi-line informational message
%N start of a multi-line note message
%A start of a multi-line message (unspecified type)
%> for next line start with current pattern again |efm-%>|
%C continuation of a multi-line message
%Z end of a multi-line message
These can be used with '+' and '-', see |efm-ignore| below.
Using "\n" in the pattern won't work to match multi-line messages.
Example: Your compiler happens to write out errors in the following format
(leading line numbers not being part of the actual output):
1 Error 275 ~
2 line 42 ~
3 column 3 ~
4 ' ' expected after '--' ~
The appropriate