Vim + Vundle + YouCompleteMe 配置

动机:

为了安装YouCompleteMe插件,需要安装vim 较高版本,并使用Vundle安装YouCompleteMe,详细的可以参考github上的ReadMe

1. vim 安装

http://www.vim.org/git.php

git clone https://github.com/vim/vim.git
cd src
make distclean  # if you build Vim before
make
sudo make install
2.Vundle 安装

https://github.com/VundleVim/Vundle.vim

git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

在vimrc中写入:

filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
filetype plugin indent on
3. YouCompleteMe 安装

在vimrc中加入一行:

Plugin 'Valloric/YouCompleteMe'

重新进入vim并输入命令:PluginInstall

后续还有好多问题,现在继续解决。 重新申请了一个云主机,重新进行配置。
https://github.com/Valloric/YouCompleteMe#ubuntu-linux-x64

1. 源码编译vim

https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source
修改config参数:

./configure --with-features=huge \
            --enable-multibyte \
            --enable-pythoninterp=yes \
            --with-python-config-dir=/usr/lib/python2.7/config \
            --prefix=/usr

终于编译成功了
这里写图片描述

2.接下来就是安装Vundle

首先我们从github上找了一个比较好的vimrc配置文件
https://github.com/vgod/vimrc

接下来安装Vundle
https://github.com/VundleVim/Vundle.vim#about
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

set nocompatible              " be iMproved, required
filetype off                  " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
"Plugin 'L9'
Plugin 'git://git.wincent.com/command-t.git'
"Plugin 'file:///home/gmarik/path/to/plugin'
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
"Plugin 'ascenator/L9', {'name': 'newL9'}
call vundle#end()            " required
filetype plugin indent on    " required

这里我们注释了一些

3.添加YouCompleteMe
Plugin 'Valloric/YouCompleteMe'

Launch vimand run :PluginInstall
https://github.com/VundleVim/Vundle.vim#about

还需要 执行

apt-get install build-essential cmake
apt-get install python-dev python3-dev
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer

正常到这儿救可以了,但是cmake我这apt-get版本低了所以需下载cmake源码安装

wget https://cmake.org/files/v3.7/cmake-3.7.1.tar.gz
tar zxvf cmake-3.7.1.tar.gz
./bootstrap && make && make install

Success!
重新运行./install.py --clang-completer
妈的还是有问题, 直接删除了YouCompleteMe文件夹,重新来一遍。

发现了问题,是因为boost和gcc 4.版本的问题,先安装上gcc 4.8在说 。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值