Vim's errorformat is ignored

564 views Asked by At

I have a problem with Vim's (v7.3) errorformat. Trying to set it to extract my C errors into quickfix. The error pattern is probably well-known:

<file>:<line>:<column>: error: <message>

I am setting this errorformat:

:set errorformat=%f:%l:%c:\ error:\ %m

Then I run :make (and I have a modified :makeprg too). But the errorformat setting does not work. It's like it's completely ignored, since the quickfix is filled up with more or less the entire compilation log file (not only errors).

I even try to set the errorformat to some nonsense, like this:

:set errorformat=sdkljfsldkfjsdlsdsd

Still, same result. The quickfix is filled up with hundreds of lines.

Am I missing some magic turn on/off the errorformat setting?

1

There are 1 answers

0
Peter Rincker On

Vim comes with many 'makeprg' and 'errorformat' settings that are already defined for different compilers/linters. To use these settings use the :compiler command. You can use tab-completion (or <c-d> to list out the options) to select one of the predefined definitions.

:compiler gcc

For more help see:

:h :compiler
:h 'makeprg'
:h 'errorformat'
:h errorformat