Vim 您是否具有完整的和通俗的兼容性?

Vim 您是否具有完整的和通俗的兼容性?,vim,Vim,我想做的是让YouCompleteMe做补全和Syntastic来检查错误,但看起来这两种方法并不一致 当YouCompleteMe被禁用时,Synatstic会工作,反之亦然。 但当两者都启用时,完成就不起作用,syntastic也不会显示任何错误 我需要什么配置才能使其工作 以下是我的选项:(注意向下滚动查看所有选项) ” “你完成了我的选择 " 让g:ycm\u注册为\u syntastic\u checker=1 “YCM将在具有诊断集的线路上的Vim槽中放置图标。 “关闭此选项还将关闭

我想做的是让YouCompleteMe做补全和Syntastic来检查错误,但看起来这两种方法并不一致

当YouCompleteMe被禁用时,Synatstic会工作,反之亦然。 但当两者都启用时,完成就不起作用,syntastic也不会显示任何错误

我需要什么配置才能使其工作

以下是我的选项:(注意向下滚动查看所有选项)

”
“你完成了我的选择
"
让g:ycm\u注册为\u syntastic\u checker=1
“YCM将在具有诊断集的线路上的Vim槽中放置图标。
“关闭此选项还将关闭YcmErrorLine和YcmWarningLine
“突出显示
设g:ycm\u启用\u诊断\u符号=1
设g:ycm_启用_诊断_高亮显示=0
让g:ycm\u始终\u填充\u位置\u列表=1“默认值0
设g:ycm\u open\u loclist\u on\u ycm\u diags=1“默认值1
设g:ycm_complete_in_strings=1“默认值1
让g:ycm_从_标记_文件收集_标识符_=1“默认值0
设g:ycm_path_to_python_解释器=“”“默认值”
让g:ycm_server_使用_vim_stdout=0“默认值0(登录到控制台)
设g:ycm_服务器_日志_级别='info'”默认信息
让g:ycm_global_ycm_extra_conf=''在哪里搜索.ycm_extra_conf.py(如果找不到)
让g:ycm\u确认\u额外\u配置=1
设g:ycm_goto_buffer_command='same buffer'['same buffer','水平拆分','垂直拆分','新选项卡']
设g:ycm_filetype_whitelist={'*':1}
让g:ycm\u key\u invoke\u completion=''
"
“语法设置
"
设g:syntastic_enable_signs=1
设g:syntastic\u auto\u loc\u list=1
设g:syntastic\u check\u on\u open=1
设g:syntastic\u always\u populate\u loc\u list=1
设g:syntastic_cpp_checkers=['gcc']
设g:syntastic\u auto\u jump=1
设g:syntastic_enable_ballogs=1
设g:syntastic_cpp_编译器='g++'
设g:syntastic_cpp_编译器_options='-std=c++11-Wall-Wextra'
设g:syntastic\u cpp\u check\u header=1
设g:syntastic\u cpp\u auto\u refresh\u includes=1
“设b:syntastic_cpp_cflags='-I/home/user/dev/cpp/boost_1_55_0”
设g:syntastic_cpp_include_dirs=[
\“/opt/boost_1_55_0”,
\“/opt/cryptopp-5.6.2”,
\“/opt/llvm_安装/include/llvm”,
\“/opt/llvm_安装/include/clang”]

这是我修改过的.vimrc(仅YCM设置)文件,因此现在有了这些设置,您就可以完成所有功能了+我不再需要任何syntastic功能,因为它不需要,除了2个,这是自动打开位置列表和自动跳转到错误

"
" YouCompleteMe options
"

let g:ycm_register_as_syntastic_checker = 1 "default 1
let g:Show_diagnostics_ui = 1 "default 1

"will put icons in Vim's gutter on lines that have a diagnostic set.
"Turning this off will also turn off the YcmErrorLine and YcmWarningLine
"highlighting
let g:ycm_enable_diagnostic_signs = 1
let g:ycm_enable_diagnostic_highlighting = 0
let g:ycm_always_populate_location_list = 1 "default 0
let g:ycm_open_loclist_on_ycm_diags = 1 "default 1


let g:ycm_complete_in_strings = 1 "default 1
let g:ycm_collect_identifiers_from_tags_files = 0 "default 0
let g:ycm_path_to_python_interpreter = '' "default ''


let g:ycm_server_use_vim_stdout = 0 "default 0 (logging to console)
let g:ycm_server_log_level = 'info' "default info


let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'  "where to search for .ycm_extra_conf.py if not found
let g:ycm_confirm_extra_conf = 1


let g:ycm_goto_buffer_command = 'same-buffer' "[ 'same-buffer', 'horizontal-split', 'vertical-split', 'new-tab' ]
let g:ycm_filetype_whitelist = { '*': 1 }
let g:ycm_key_invoke_completion = '<C-Space>'


nnoremap <F11> :YcmForceCompileAndDiagnostics <CR>
如果您进行GTK+编码,则此列表可能会对您有所帮助。 顺便说一句,如果您想知道include dir之前的-isystem是什么意思,这意味着YouCompleteMe(clang/clang++编译器)现在将显示来自这些头的警告和错误。(99%的时间是误报)

顺便说一句,Sinastic检查是用clang编译器(后台编译)完成的,而构建它本身当然可以用任何编译器类型完成


谢谢!

阅读
:h youcompleteme为什么ycm停止使用syntastic进行诊断显示
。基本上ycm提供了
syntastic
的所有功能,所以应该没有理由使用语法。我相信ycm也尝试禁用syntastic,尽管我可能对此有错误,这可能解释了为什么事情会发生变化eird.谢谢,你实际上通过指导我在哪里查找问题解决了我的问题。我发现了一些有用的YouCompleteMe变量,这些变量使syntastic根本不需要插件。更多信息可以在git网站上找到。我建议将你的发现作为答案发布,以便其他有相同问题的人可以看到是什么解决了你的问题。是的tnx,我添加了我所有的信息。
"
" YouCompleteMe options
"

let g:ycm_register_as_syntastic_checker = 1 "default 1
let g:Show_diagnostics_ui = 1 "default 1

"will put icons in Vim's gutter on lines that have a diagnostic set.
"Turning this off will also turn off the YcmErrorLine and YcmWarningLine
"highlighting
let g:ycm_enable_diagnostic_signs = 1
let g:ycm_enable_diagnostic_highlighting = 0
let g:ycm_always_populate_location_list = 1 "default 0
let g:ycm_open_loclist_on_ycm_diags = 1 "default 1


let g:ycm_complete_in_strings = 1 "default 1
let g:ycm_collect_identifiers_from_tags_files = 0 "default 0
let g:ycm_path_to_python_interpreter = '' "default ''


let g:ycm_server_use_vim_stdout = 0 "default 0 (logging to console)
let g:ycm_server_log_level = 'info' "default info


let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'  "where to search for .ycm_extra_conf.py if not found
let g:ycm_confirm_extra_conf = 1


let g:ycm_goto_buffer_command = 'same-buffer' "[ 'same-buffer', 'horizontal-split', 'vertical-split', 'new-tab' ]
let g:ycm_filetype_whitelist = { '*': 1 }
let g:ycm_key_invoke_completion = '<C-Space>'


nnoremap <F11> :YcmForceCompileAndDiagnostics <CR>
flags = [
'-Wall',
'-Wextra',
'-std=c++11',
'c++',

#Standard includes
'-isystem',
'/usr/include/c++/4.7',



#GTK includes
'-isystem',
'/usr/include/gtk-3.0',
'-isystem',
'/usr/include/glib-2.0',
'-isystem',
'/usr/include/glib-2.0/glib',
'-isystem',
'/usr/lib/i386-linux-gnu/glib-2.0/include',
'-isystem',
'/usr/include/pango-1.0',
'-isystem',
'/usr/include/cairo',
'-isystem',
'/usr/include/gdk-pixbuf-2.0',
'-isystem',
'/usr/include/atk-1.0',
'-isystem',
'-I/usr/include/gio-unix-2.0',
'-isystem',
'-I/usr/include/freetype2',
'-isystem',
'-I/usr/include/pixman-1',
'-isystem',
'-I/usr/include/libpng12',

#current dir
'-I',
'.',

#custom libraries
'-I',
'/opt/boost_1_55_0',
'-I',
'/opt/cryptopp-5.6.2',
'-I',
'/opt/llvm_install/include'
]