首先,我讲的是调试。不幸的是,没有特别简单的方法可以做到这一点,但是一个有用的可能性是运行make并将输出吐到一个文件中,然后:
:let &makeprg="cat ~/outputfile.log"
:make
关于生成错误格式,这需要一些尝试和错误。您可以将%a、%c和%z用于多行消息,也可以使用%g忽略内容。订单非常重要,请注意有时%c甚至%z会出现在%a之前!在您的情况下,您可能可以得到与EFM以下的地方。我倾向于使用
let &efm =
和
let &efm .=
而不是设置为你不必逃避每一个空格或引号,你可以逐步建立起来。它的可读性也更高。
" Start of the multi-line error message (%A),
" %p^ means a string of spaces and then a ^ to
" get the column number
let &efm = '%A%p^' . ','
" Next is the main bit: continuation of the error line (%C)
" followed by the filename in quotes, a comma (\,)
" then the rest of the details
let &efm .= '%C"%f"\, line %l: error(%n): %m' . ','
" Next is the last line of the error message, any number
" of spaces (' %#': equivalent to ' *') followed by a bit
" more error message
let &efm .= '%Z %#%m' . ','
" This just ignores any other lines (must be last!)
let &efm .= '%-G%.%#'