Is there a way to temporarily disable/reenable the YouCompleteMe Plugin for vim? Syntastic has a nice way of doing so with the SyntasticToggleMode command (useful for when I know I'm writing code that won't compile and just don't want to see error messages at the moment).

I tried writing a quick Vim function that toggles the g:ycm_show_diagnostics_ui variable but it doesn't seem to work as I'd like even though the value of the variable changes.

Note: this works statically (i.e. if I set the g:ycm_show_diagnostics_ui variable to zero in my vimrc but doesn't work dynamically).

  • After you've sourced your plugins YCM is loaded. The only way to disable it to my knowledge would have to be a feature of YCM itself. – Tumbler41 May 23 '18 at 18:21

After you toggle the value of g:ycm_show_diagnostics_ui, run :YcmRestartServer and then reload the file with :e.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.