Disable NeoComplCache based on file type

I am trying to configure vim so that when I edit a C or C ++ file, it uses the YouCompleteMe plugin for improvements and for everything else it uses NeoComplCache .

I start with v3.0 spf13 vim configuration .

I added the following to .vimrc.bundles.local :

 Bundle 'Valloric/YouCompleteMe' 

I added the following to my .vimrc.local :

 let g:ycm_filetype_whitelist = { 'c': 1, 'cpp': 1 } let g:neocomplcache_force_overwrite_completefunc = 0 

This disables YouCompleteMe for everything except C / C ++, however I am not sure how to disable NeoComplCache based on file type. I tried:

 autocmd FileType c,cpp :NeoComplCacheDisable 

However, it seems that NeoComplCache is not turned on until you do nothing in the buffer. What configuration is needed to disable NeoComplCache when opening a C or C ++ file in vim?

+4
source share
2 answers

This is how I disabled NeoCompleCache for my .vimrc :

 " Disable NeoComplCache for certain filetypes if has('autocmd') autocmd FileType pandoc,markdown nested NeoComplCacheLock endif 

Literature:

+2
source

This is what I use for editing markup files, it should work c, cpp.

 " Turn off completion, it more disruptive than helpful function! s:markdown_disable_autocomplete() if &ft ==# 'markdown' :NeoComplCacheLock endif endfunction autocmd MyAutoCmd BufEnter * call s:markdown_disable_autocomplete() 
+2
source

All Articles