diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index 6ecc4a9a..d9c37a47 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -67,6 +67,7 @@ function! youcompleteme#Enable() autocmd InsertEnter * call s:OnInsertEnter() augroup END + call s:SetUpCpoptions() call s:SetUpCompleteopt() call s:SetUpKeyMappings() @@ -153,6 +154,13 @@ function! s:AllowedToCompleteInCurrentFile() endfunction +function! s:SetUpCpoptions() + " Without this flag in cpoptions, critical YCM mappings do not work. There's + " no way to not have this and have YCM working, so force the flag. + set cpoptions+=B +endfunction + + function! s:SetUpCompleteopt() " Some plugins (I'm looking at you, vim-notes) change completeopt by for " instance adding 'longest'. This breaks YCM. So we force our settings.