1. 安装用到的软件包
楼主使用的系统版本是ubuntu16.04,以下的python,Git 和 cmake 需要安装 ,如果其他软件版本不新的话,也需要更新
sudo apt-get install vim
sudo apt-get install git
sudo apt-get install subversion
sudo apt-get install python-dev libxml2-dev libxslt-dev
sudo apt-get install gcc
sudo apt-get install cmake
- 1
- 2
- 3
- 4
- 5
- 6
如果提示还缺什么软件的话,就apt-get安装就行了
2. 安装Vundle
clone一个Vundle,前提是安装了git。
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
- 1
将下面的配置选项添加到~/.vimrc
中:
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
call vundle#end() " required
filetype plugin indent on " required
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
3. 安装YouCompleteMe
第一步:
使用源码安装
#下载YouCompleteMe源码
git clone https://github.com/Valloric/YouCompleteMe.git ~/.vim/bundle/YouCompleteMe
cd ~/.vim/bundle/YouCompleteMe/
#获取YCM的依赖包
git submodule update --init --recursive
#然后在在vimrc文件中加入
Plugin 'Valloric/YouCompleteMe'
- 1
- 2
- 3
- 4
- 5
- 6
- 7
第二步:
快速安装
支持C系列的命令
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
- 1
- 2
4. YouCompleteMe配置:
这个大家可以在百度上搜索配置即可,直接搜索“
YouCompleteMe配置”即可