简体   繁体   English

Vim合成错误消息总是隐藏

[英]Vim syntastic error messages always hidden

Syntastic does not seem to work properly for me. Syntastic似乎不适合我。 It is installed, :SyntasticInfo says everything is fine (active mode enabled, filetype cpp, checker is ycm). 它已安装,:SyntasticInfo表示一切正常(启用主动模式,文件类型为cpp,检查程序为ycm)。 At first glance everything seems to be fine because it looks like this: 乍一看,一切似乎都很好,因为它看起来像这样:

1

I have my signs on the left and the location list at the bottom. 我左边有我的标志,底部有位置列表。 But as soon as I move the cursor, the signs as well as the loc-list disappear and it looks like that: 但是一旦我移动光标,标志和loc-list就会消失,看起来像这样:

2

The only exception to this rule being entering insert mode right at startup. 此规则的唯一例外是在启动时立即进入插入模式。 But of course once I leave it, everything disappears. 但当然,一旦我离开它,一切都会消失。

Now I know that there are commands like :SyntasticCheck or :Errors and they do exactly... nothing. 现在我知道有一些命令:SyntasticCheck:Errors ,它们确实......没有。 I type them, I execute them and that's it. 我输入它们,我执行它们就是这样。 Like I hadn't done anything at all. 就像我没有做任何事情一样。 Naturally saving the file doesn't yield any result either. 自然地保存文件也不会产生任何结果。

My .vimrc looks like this: 我的.vimrc看起来像这样:

let g:syntastic_enable_signs = 1
let g:syntastic_auto_loc_list=1
let g:syntastic_check_on_open = 1
let g:syntastic_cpp_compiler_options = ' -std=c++11 -Wall'

If I remove these lines I don't even have the signs and loc-list on startup. 如果我删除这些行,我甚至没有启动时的标志和loc-list。 So yea, I am really at a loss here. 所以,我在这里真的很茫然。

Turns out this was more of a YouCompleteMe problem than it was Syntastic. 事实证明,这更像是一个YouCompleteMe问题,而不是Syntastic。 YCM automatically sets itself as the checker for syntastic (for compatible languages) and also requires a .ycm_extra_conf.py which should contain the compile flags for the ycm compiler. YCM自动将其自身设置为合成的检查器(对于兼容的语言),并且还需要.ycm_extra_conf.py ,其中应包含ycm编译器的编译标志。 Without these flags it is not capable of compiling the code or detecting any errors. 没有这些标志,它就无法编译代码或检测到任何错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM