Ⅰ. 插件描述
c/c++ semantic highlighting, with Config file compatible with YCMⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'minrui-hust/color-cpp-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'minrui-hust/color-cpp-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'minrui-hust/color-cpp-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/minrui-hust/color-cpp.vim
Ⅳ. 文档说明
color-cpp: a c/c++ semantic highlighing plugin for vim8
Using the same config file .ycm_extra_conf.py with YouCompleteMe,
accurate highlighting is available for c/c++ variables, keywords, functions,
classes and so on.
before color-cpp enabled:
after color-cpp enabled:

Requirement
- >=Vim8.0(tested on Vim8.1), with
job, timer, python3(better to disable python2)enabled YouCompleteMeshould be installed with the latest version- Linux system(Ubuntu is suggested)
Installation
Assume Plug plugin manager is used, other plugin manager should be very similar
put this in you
.vimrc, AfterYCMPlug 'Valloric/YouCompleteMe' Plug 'minrui-hust/color-cpp.vim'- use vim command
:PlugInstallto install it first install YCM, go to YouCompleteMe folder run:
install.py --clang-completer
- you already have YCM installed, ignore this step
go to the color-cpp folder, run:
./install.bashIf no error happens, it means succeed, else please refer to FAQ
Usage
color-cpp use the same config file as YCM, which is .ycm_extra_conf.py,
so the least thing you have to do is to put a .ycm_extra_conf.py in you project top folder.
The one at server/.ycm_extra_conf.py(it is hidden on linux) works perfect with c/c++, for both YCM and color-cpp.
there is only one places you need to modify according to your project:
# set this to the directory which compile_commands.json exist
compilation_database_folder = '/home/mr/Workspace/loc/build'
# set this to the directory which compile_commands.json existAs you can see, that is the path of compile database file compile_commands.json
created by cmake with -DCMAKE_EXPORT_COMPILE_COMMANDS=yes.
Enjoy it!
FAQ
TODO