使用neocomplcache和clang_complete?

时间:2012-10-19 13:16:51

标签: vim clang-complete neocomplcache

我正在努力让clang_completeneocomplcache很好地相处。我的问题是,当我打开cppcobjcobjcpp文件时,我从 neocomplcache

收到以下错误
completefunc=ClangComplete^@^ILast set from ~/.vim/plugin/clang_complete.vim
Another plugin set completefunc! Disabled neocomplcache. 

clang_complete.vim具有以下配置行:

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

我的问题是,是否有办法让我不再收到此错误?有没有办法可以使用clang_complete并且仍然有权让我们说neocomplcache代码段?

2 个答案:

答案 0 :(得分:4)

此配置修复了问题(在我的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

答案 1 :(得分:2)

neocomplcache和clang_complete存在兼容性patch