无法获得“Syntastic” vim 插件可以工作
我已经在 vim 中安装了 Syntastic 插件。我无法让它工作。我尝试过 :SyntasticEnable
但没有运气。 SyntasticEnable python<我的 vimrc
中的 /code> 也不起作用(事实上,它甚至不解析命令,当我尝试将其添加到我的
.vimrc
时,会显示错误: 不是编辑器命令:SyntasticEnable python
)。
我怎样才能知道发生了什么事?当我从 vim 调用 Syntastic 时,它没有显示错误。第一个错误(.vimrc
中的 not and editor command
)是否表明了我不知道的内容?
我的 .vimrc 中有:
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_enable_signs=1
let g:syntastic_auto_loc_list=1
我在 ~/.vim/syntax_checkers
中也有一个 python.vim
。我已经可以使用 Pyflakes 来处理 python 文件,它可以工作 太棒了,但我希望在开发应用程序时需要的其他文件/扩展中具有 Syntastic 功能。
I've installed Syntastic plugin in vim. I can't get it to work. I've tried :SyntasticEnable
but no luck. SyntasticEnable python
in my vimrc doesn't work either (in fact, it doesn't even parse the command, an error is shown when I try to add it to my .vimrc
: Not an editor command: SyntasticEnable python
).
How can I know what's going on? Syntastic isn't showing errors when I call it from vim. Does the first error (not and editor command
in my .vimrc
) indicates something I'm unaware of?
I have in my .vimrc:
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_enable_signs=1
let g:syntastic_auto_loc_list=1
I have a python.vim
in ~/.vim/syntax_checkers
as well. I can already use Pyflakes for python files, it works GREAT but I would like to have Syntastic functionality in other files/extensions I need when developing applications.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
pyflakes 是否在您的环境路径上?如果不是,那么您必须将其添加到您的路径中,或者修改syntax\checkers\python.vim 并将完整路径添加到二进制文件。
您必须修改两行:
以及
在我的情况下。我希望 Syntastic 在我的 Windows 机器上使用 PHP。因此,我必须将 php.vim 中的这两行类似的行修改为:
和
如果您的路径包含空格,则必须在 makeprg 变量中将它们用双引号引起来。另外,对于 html.vim,makeprg 中的单引号必须替换为双引号(您必须重新转义其中的所有内容)。
和
Is
pyflakes
on your environment path? If it is not, then you must add it to your path, or modify syntax\checkers\python.vim and add the full path to the binary.There are two lines you have to modify:
and also
In my case. I wanted Syntastic to work with PHP on my Windows machine. So I had to modify those two similar lines in php.vim to be:
and
If your path contains spaces, you'll have to surround them in double quotes in the makeprg variable. Also with html.vim, the single quotes in makeprg must be replaced with double quotes, (you'll have to re-escape everything inside).
and
您是否尝试过确保 Vim 为 $PATH 设置了正确的值?
如果没有,请尝试将其放入 .vimrc 中:
然后关闭并重新启动 vim。如果它有效,您将不必手动更新插件的源文件来手动包含可执行文件的路径。
(通过以下方式找到: https://superuser.com/questions/380535/getting-man-path -通过-vim )
Have you tried to make sure Vim has the right value set for $PATH?
If not, try putting this in your .vimrc:
Then shutdown and restart vim. If it works, you won't have to manually update the plugin's source files to manually include the path to the executables.
(found this via: https://superuser.com/questions/380535/getting-man-path-through-vim )