Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using neocomplcache and clang_complete?

I'm trying to make clang_complete and neocomplcache to play along nicely. My problem is that when I open a cpp, c, objc or objcpp file I get the following error from neocomplcache

completefunc=ClangComplete^@^ILast set from ~/.vim/plugin/clang_complete.vim
Another plugin set completefunc! Disabled neocomplcache. 

clang_complete.vim has the following configuration line:

au FileType c,cpp,objc,objcpp call <SID>ClangCompleteInit()

My question is if there's a way so that I don't get this error anymore ? Is there a way I could use clang_complete and somehow still have access to let's say neocomplcache snippets ?

like image 890
Goles Avatar asked Oct 19 '12 13:10

Goles


2 Answers

This config fixed the problem (in my Vimrc)

if !exists('g:neocomplcache_force_omni_patterns')
    let g:neocomplcache_force_omni_patterns = {}
endif
let g:neocomplcache_force_overwrite_completefunc = 1
let g:neocomplcache_force_omni_patterns.c =
            \ '[^.[:digit:] *\t]\%(\.\|->\)'
let g:neocomplcache_force_omni_patterns.cpp =
            \ '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
let g:neocomplcache_force_omni_patterns.objc =
            \ '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
let g:neocomplcache_force_omni_patterns.objcpp =
            \ '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
let g:clang_complete_auto = 0
let g:clang_auto_select = 0
let g:clang_use_library = 1
like image 190
Goles Avatar answered Nov 06 '22 03:11

Goles


There is a compatibility patch for neocomplcache and clang_complete.

like image 36
Hai Feng Kao Avatar answered Nov 06 '22 03:11

Hai Feng Kao