I want to run my app under vim using make
, and I want the quickfix
window display my errors.
So I have this format, which first starts with Error:
and then filename, line and column separated by :
and then on the next line, there's gonna be a multi line message with no special formatting, then the message will end with ErrorEnd
.
So here's an example:
Error: /somefile/something/something.c:12:123
SOME MESSAGE
ANOTHER HELPFUL MESSAGE
ANOTHER MESSAGE
ErrorEnd
I'm kinda lost in the documentation to how to make it match those lines. Everything seems so confusing and the examples aren't like this one. I know how to make it match the first line, but no idea how to make it match the next lines as the error message. So the question is what would be a errorformat string that could parse it all.
You can capture multiple lines of text in the error message by using the %+
prefix as described at :help efm-ignore
in combination with the multi-line errorformat specifier %E
, %C
, %Z
, etc. described at :help errorformat-multi-line
. In your specific example, the following seems to work:
let &l:efm='%EError: %f:%l:%c,%-ZErrorEnd,%+C%.%#'
Note the %+C
item which matches any text on the line and adds it to the error message. Note also how I had to put the %-Z
item before this item for it to be used, since the first matching errorformat item will be used when parsing the line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With