Vim + Vundle + YouCompleteMe 配置

来源:互联网 发布:淘宝店铺介绍大全 编辑:程序博客网 时间:2024/05/19 11:37

动机:

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

1. vim 安装

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

git clone https://github.com/vim/vim.gitcd srcmake distclean  # if you build Vim beforemakesudo make install

2.Vundle 安装

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

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

在vimrc中写入:

filetype offset 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, requiredfiletype off                  " requiredset rtp+=~/.vim/bundle/Vundle.vimcall 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()            " requiredfiletype 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 cmakeapt-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.gztar zxvf cmake-3.7.1.tar.gz./bootstrap && make && make install

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

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

0 0
原创粉丝点击