2013-07-11 14 views
1

我想写EFM此:为jshint(带有示例)Vim的错误格式运用于

file: app/assets/javascripts/topbar.js 
    line 17, col 3, Missing semicolon. 
    line 19, col 19, 'is_mobile' was used before it was defined. 
    line 21, col 1965, Expected '{' and instead saw 'check'. 
    line 25, col 18, 'onScroll' was used before it was defined. 
file: app/assets/javascripts/trends.js 
    line 2, col 55, Missing semicolon. 
    line 6, col 27, 'trendTypeSelected' was used before it was defined. 
    line 7, col 32, Expected '===' and instead saw '=='. 
JSHint check failed 

,但我认为我丢失的文件在不同行的概念。有人可以帮我与 这个?

这是我迄今为止,它不工作:

%-Pfile:\ %f,line\ %l\,\ col\ %c\,\ %m 

谢谢!

解决方案:

set efm=%-Pfile:\ %f,%*[\ ]line\ %l\\,\ col\ %c\\,\ %m,%-Q,%-GJSHint\ check\ failed 

回答

1

Vim中提供%P,其推动解析的文件(%f)压入堆栈,见:help errorformat-separate-filename

所以对于你的错误输出,这将是像%+Pfile: %f,...

+0

我知道,但由于某种原因,这是行不通的。让我用我现在拥有的东西编辑问题。 – lzap

+0

好吧我想我需要阅读该手册。没关系:-)至少我试过了:-D – lzap

+0

对不起,我对errorformats没有太多的经验,也没有。最好看看现有的编译器插件。祝你好运! –