color-cpp.vim


Ⅰ. 插件描述

c/c++ semantic highlighting, with Config file compatible with YCM

Ⅱ. 基本信息

创建日期:  2019-04-03
使用用户:  1
Github星:  3
插件作者:  minrui-hust

Ⅲ. 安装方法

使用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

Ⅳ. 文档说明

996.icu
LICENSE

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:
image
after color-cpp enabled:
image

Requirement

  • >=Vim8.0(tested on Vim8.1), with job, timer, python3(better to disable python2) enabled
  • YouCompleteMe should 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

  1. put this in you .vimrc, After YCM

    Plug 'Valloric/YouCompleteMe'
    Plug 'minrui-hust/color-cpp.vim'
  2. use vim command :PlugInstall to install it
  3. first install YCM, go to YouCompleteMe folder run:

  4. install.py --clang-completer

  5. you already have YCM installed, ignore this step
  6. go to the color-cpp folder, run:

    ./install.bash

    If 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 exist

As 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

添加新评论