如何调用一个shellcript语法检查器(通过/ with syntastic和pathogen)?

问题描述 投票:1回答:2

当我使用bash / sh脚本时,病原体会启动并正确加载~/.vim/bundle/syntastic/syntax_checkers/sh/中的所有内容。我在命令行模式下使用:scriptnames进行了检查。包括shellcheck.vimcheckbashism.vimbashate.vim等。

启动vim会话正确检测到filetype并加载相应的捆绑语法检查脚本。

但是,如何使用/usr/bin/shellcheckbashatecheckbashism?在~/.vimrc,没有什么是明显的。

可以同时调用多个语法检查程序吗?例如。 shellcheckbashate可以一起工作吗?谢谢。

bash vim static-analysis vim-syntax-highlighting shellcheck
2个回答
3
投票

在您的设置中,病原体的唯一作用是在Vim启动时将每个插件的路径和子路径附加到'runtimepath'选项。没有更多,没有更少。

至于Syntastic,用于shell脚本的the default checkersshshellcheck。阅读:help syntastic-checker-options以了解如何定义自己的检查器列表。


1
投票

从romainl只链接到(the relevant parts of links should be quoted when answering):

通过将变量'g:syntastic__checkers'设置为检查器列表,例如,您可以通过将变量'g:syntastic__checkers'设置为合成器来判断哪些检查器针对给定的文件类型运行。

let g:syntastic_php_checkers = ["php", "phpcs", "phpmd"]

至于关于调用的问题:根据the FAQ,“命令行是使用名为makeprgBuild()的内部函数构造的,它提供了许多选项,允许您自定义运行的命令的每个部分。您可以使用全局变量“。 (See this answer。)

© www.soinside.com 2019 - 2024. All rights reserved.