From 0040afbaf688a8fa17adaf42da77c55e5abaa83c Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Sun, 29 Jul 2012 21:13:09 -0700 Subject: [PATCH] Adding support for ycm to the cpp filetype Conflicts: syntax_checkers/cpp.vim --- syntax_checkers/cpp.vim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/syntax_checkers/cpp.vim b/syntax_checkers/cpp.vim index 7be44e37..587c8a9b 100644 --- a/syntax_checkers/cpp.vim +++ b/syntax_checkers/cpp.vim @@ -10,6 +10,13 @@ " "============================================================================ +" NOTE: IF you are using the YouCompleteMe plugin +" (https://github.com/Valloric/YouCompleteMe), everything will 'just work' +" (if you configured YouCompleteMe properly that is). +" Ignore all the below g:syntastic_cpp* options, YCM does not use them. If you +" are NOT using YCM, then continue reading. +" +" " in order to also check header files add this to your .vimrc: " " let g:syntastic_cpp_check_header = 1 @@ -80,7 +87,7 @@ if !exists('g:syntastic_cpp_compiler_options') let g:syntastic_cpp_compiler_options = '' endif -if !executable(g:syntastic_cpp_compiler) +if !executable(g:syntastic_cpp_compiler) && !exists('g:loaded_youcompleteme') finish endif @@ -92,6 +99,10 @@ if !exists('g:syntastic_cpp_config_file') endif function! SyntaxCheckers_cpp_GetLocList() + if exists('g:loaded_youcompleteme') + return youcompleteme#CurrentFileDiagnostics() + endif + let makeprg = g:syntastic_cpp_compiler . ' -x c++ -fsyntax-only ' . \ g:syntastic_cpp_compiler_options let errorformat = '%-G%f:%s:,%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: '.