gvim 安装YouCompleteMe插件

可以参考:YouCompleteMe#full-installation-guide

可以直接下载:

http://pan.baidu.com/s/1dDIq2Al 密码: si5q

确保vim支持python

1. 去vim官网下载7.4以上的gvim版本。

2. 去官网下载python2.7

3. 把python的路径添加到环境变量里,主要是 xxx\Python27\libs 这个路径添加进去。

4. 检验方法,在vim里输入下面指令,如果返回1说明没问题,否则就是环境路径没有设置正确。

:echo has('python') || has('python3')

不是1就不用往下看了。

安装git 及 Vundle

1. 去git官网下载并安装git。

2. 使用git下载vundle。(对于windows, 在我的电脑上, ~代表C:\Users\Administrator)

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

3. 修改vim的vimrc文件,windows下是_vimrc文件,在最顶上添加:

set nocompatible              " be iMproved, required
filetype off                  " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
call vundle#end()            " required
filetype plugin indent on    " required

4. 进入vim,输入下面命令,自此,vundle安装完成。

:PluginInstall

安装YCM插件

1. 使用git下载插件:

git clone https://github.com/Valloric/YouCompleteMe.git ~/.vim/bundle/YouCompleteMe

2. 然后进行下面操作:

cd ~/.vim/bundle/YouCompleteMe
git submodule update --init --recursive

3. 修改vim的_vimrc文件,在Plugin 'VundleVim/Vundle.vim'后添加:Plugin 'Valloric/YouCompleteMe',最后的内容像这样:

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

4. 进入vim,输入下面命令,自此,YMC安装完成。

:PluginInstall

这时,打开一个文件,会提示错误,这是因为还没有做完。

编译 ycm_core 库

1. 下载安装Cmake

2. 安装Visual Studio,免费社区版即可。

3. 新建一个文件夹 ycm_build

cd ~
mkdir ycm_build
cd ycm_build

 4. 开始编译, 下面的12根据你的安装版本,32位的把win64删掉

cmake -G "Visual Studio 12 Win64" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp

 如果编译不成功,那么就使用cmake的ui一个个的试

 

 

 

 

 

 
 

 

转载于:https://www.cnblogs.com/qiyuexin/p/6474429.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值