Ⅰ. 插件描述
DEPRECATED use https://github.com/roxma/ncm2-pyclang insteadⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'roxma/clang-complete-would-can-one'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'roxma/clang-complete-would-can-one'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'roxma/clang-complete-would-can-one'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/roxma/clang_complete
Ⅳ. 文档说明
# This Project is DEPRECATED! Please Try ncm-clang Instead.
Introduction
The original clang_complete was
created by Xavier Deguillard and [Tobias
Grosser](https://github.com/tobig).
I'm maintaining this fork, with lots of code refactored and simplified, for
better integration with NCM.
Here's some of the work in brief.
- Builtin parameter expansion snippet engine removed in favor of ultisnips.
- Quickfix feature removed in favor of neomake or syntastic, etc.
- Builtin
omnifunc/completefuncwith threading, and some default insert
mode mapping removed, in favor of NCM.
Requirements
clanginstalled on your system. (eg.yum install clang clang-develor
apt-get install libclang-dev)
To get clang_complete working with
NCM you must install theneovim Python package for Python 2.
clang_complete is invoked with the Python 2 interpreter, not the Python 3
interpreter, because the clang Python bindings only support Python 2.
Installation
Assuming you're using vim-plug.
Plug 'roxma/clang_complete'Configuration tips
- Set the
clang_library_pathto the directory containing file named
libclang.{dll,so,dylib} (for Windows, Unix variants and OS X respectively)
or the file itself, example:
" path to directory where library can be found
let g:clang_library_path='/usr/lib/llvm-3.8/lib'
" or path directly to the library file
let g:clang_library_path='/usr/lib64/libclang.so.3.8'- Goto declaration.
" <Plug>(clang_complete_goto_declaration_preview)
au FileType c,cpp nmap gd <Plug>(clang_complete_goto_declaration)Compiler options can be configured in a
.clang_completefile in each project- Example of
.clang_completefile:
- Example of
-DDEBUG
-include ../config.h
-I../common
-I/usr/include/c++/4.5.3/
-I/usr/include/c++/4.5.3/x86_64-slackware-linux/- Makefile example for auto-generating
.clang_complete
.clang_complete: Makefile
echo $(CXXFLAGS) > $@If you are using cmake, unfortunately, I don't have a decent hack.
This
might work. Currently I use make VERBOSE=1 to show the compile command and
then edit the .clang_complete manually.
- Integrate with neomake
let g:neomake_cpp_enabled_makers = ['clang']
let g:neomake_c_enabled_makers = ['clang']License
See doc/clang_complete.txt for help and license.