正如您所说,quickfix有很多命令,但我倾向于发现我只使用其中的一小部分:
:copen " Open the quickfix window
:ccl " Close it
:cw " Open it if there are "errors", close it otherwise (some people prefer this)
:cn " Go to the next error in the window
:cp " Go to the previous error in the window
:cnf " Go to the first error in the next file
:.cc " Go to error under cursor (if cursor is in quickfix window)
我倾向于将其与:make
and一起使用:vimgrep
,因此我无法对 Javascript lint 检查器发表评论,但这应该可以帮助您入门。
关于 JavascriptLint 的一般使用,我不是 javascript 程序员,但看起来脚本公开了一个名为“JavascriptLint”的函数,所以如果你想手动调用它,可以使用:call JavascriptLint()
. 但是,它适用于文件的磁盘副本,因此必须先保存它。如果(且仅当)命令行jsl
适用于 html 文件,您应该能够:call JavascriptLint()
在 html 文件上使用来检查内部 javascript。你也可以这样做:
autocmd BufWritePost,FileWritePost *.html call JavascriptLint()
使其自动化。如果jsl
不支持 html 文件,那么(没有修补应用程序或要求作者更改它),这可能是一个失败的原因......