使用新发布的csslint,我想尝试将其挂钩到vim作为.css文件的makefile.我很难让多行错误格式适用于输出.
到目前为止,我最好的结果是:
au BufRead *.css set makeprg=csslint\ %
au BufRead *.css set errorformat=%A%f:,%C%n:\ warning\ at\ line\ %l\,\ col\ %c,%C%m,%C%.%#,%C%.%#
但这并没有得到正确的行/列数.我在我的quickfix窗口中收到此输出:
|| csslint: There are 33 errors and warnings in bookie.css.
||
bookie.css|| 1: warning Too many font-size declarations (13),abstraction needed.
bookie.css|| 2: warning at line 3,col 3 Rule is empty. BODY {
bookie.css|| 3: warning at line 12,col 12 Values of 0 shouldn't have units specified. padding: .5em 0em;
bookie.css|| 4: warning at line 13,col 13 Values of 0 shouldn't have units specified. margin: 0em;
...
csslint的格式是:
csslint: There are 33 errors and warnings in bookie.css.
bookie.css:
1: warning
Too many font-size declarations (13),abstraction needed.
bookie.css:
2: warning at line 3,col 3
Rule is empty.
BODY {
有人看到我的efm有什么问题吗?或者有可能有用的东西?我试图不去编写另一个解析脚本来清理格式.谢谢您的帮助.
最佳答案
您需要使用双反斜杠来转义Vim错误格式中的逗号.
原文链接:https://www.f2er.com/css/427063.html