diff --git a/README.md b/README.md index 8ba88b7f..11f69548 100644 --- a/README.md +++ b/README.md @@ -575,6 +575,22 @@ Default: `{}` let g:ycm_filetype_specific_completion_to_disable = {} +### The `g:ycm_register_as_syntastic_checker` option + +When set, this option makes YCM register itself as the Syntastic checker for the +`c`, `cpp`, `objc` and `objcpp` filetypes. This enables the YCM-Syntastic +integration. + +If you're using YCM's identifier completer in C-family languages but cannot use +the clang-based semantic completer for those languages _and_ want to use the GCC +Syntastic checkers, unset this option. + +Don't unset this option unless you're sure you know what you're doing. + +Default: `1` + + let g:ycm_register_as_syntastic_checker = 1 + ### The `g:ycm_allow_changing_updatetime` option When this option is set to `1`, YCM will change the `updatetime` Vim option to diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index 8fb9c14d..6ecc4a9a 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -69,7 +69,10 @@ function! youcompleteme#Enable() call s:SetUpCompleteopt() call s:SetUpKeyMappings() - call s:ForceSyntasticCFamilyChecker() + + if g:ycm_register_as_syntastic_checker + call s:ForceSyntasticCFamilyChecker() + endif if g:ycm_allow_changing_updatetime set ut=2000 diff --git a/plugin/youcompleteme.vim b/plugin/youcompleteme.vim index 998e7408..84fe5822 100644 --- a/plugin/youcompleteme.vim +++ b/plugin/youcompleteme.vim @@ -76,6 +76,9 @@ let g:ycm_filetype_blacklist = let g:ycm_filetype_specific_completion_to_disable = \ get( g:, 'ycm_filetype_specific_completion_to_disable', {} ) +let g:ycm_register_as_syntastic_checker = + \ get( g:, 'ycm_register_as_syntastic_checker', 1 ) + let g:ycm_allow_changing_updatetime = \ get( g:, 'ycm_allow_changing_updatetime', 1 )