作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我最近根据本指南通过病原体安装了 Syntastic https://github.com/scrooloose/syntastic#installpathogen .
但是,Syntastic 不适用于 C++。但是它确实适用于 c。我不确定原因是什么,当我打开 .cpp 文件并故意创建错误时,没有任何报告。
这是我的 vimrc:
:syntax on
:set number
:set autoindent
:set cindent
set t_Co=256 "sets vim to 256 color
if &term =~ '256color'
" disable Background Color Erase (BCE) so that color schemes
" render properly when inside 256-color tmux and GNU screen.
set t_ut=
endif
"Synastic
let g:syntastic_cpp_compiler = 'clang++'
let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++'
let g:syntastic_cpp_check_header = 1
nmap <F8> :TagbarToggle<CR> "maps f8 to tagbar toggle
execute pathogen#infect()
:colorscheme mustang
最佳答案
这可能在其他地方也得到了回答。您是否尝试调试 Syntastic?
尝试将 let g:syntastic_debug=1
设置到您的 .vimrc 中,运行检查器,并检查 :mes
的输出以调试任何问题或者,您可以键入 :SyntasticInfo
,这将输出如下内容:
Syntastic version: 3.4.0-134
Info for filetype: cpp
Mode: active
Filetype cpp is active
Available checkers: clang_check clang_tidy gcc
Currently enabled checkers: -
因此,您可以通过将它们添加到您的 .vimrc 来启用您想要的适当检查器:let g:syntastic_cpp_checkers = ['clang_check', 'gcc']
,或者您可以指定您自己的规则。为此,您可以通过键入 :h syntastic
查看手册。
关于vim - Syntastic 不适用于 C++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27539658/
我是一名优秀的程序员,十分优秀!