Ubuntu16.04 安装 VIM 代码自动补全插件 YCM

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配置”即可


  • 0
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我是唐

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值