准备
----unbuntu16.04
----Vim(7.4.1689)
sudo apt-get install vim
----git
sudo apt-get install git
-----Cmake
sudo apt-get install
一、Vim安装插件管理器Vundle
1.下载vundle
mkdir -p ~/.vim/bundle
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
2.配置Vim资源文件
vim ~/.vimrc
按下文修改文件内容
set nocompatible " 这是必需的
filetype off " 这是必需的
" 在此设置运行时路径
set rtp+=~/.vim/bundle/Vundle.vim
" vundle初始化
call vundle#begin()
" 或者传递一个 Vundle 安装插件的路径
"call vundle#begin('~/some/path/here')
" 让 Vundle 管理 Vundle, 必须
Plugin 'VundleVim/Vundle.vim'
" 下面是不同支持幅度的例子
" 保持 Plugin 命令 在 vundle#begin 和 end 之间
" plugin 在 GitHub 仓库
Plugin 'tpope/vim-fugitive'
" 来自http://vim-scripts.org/vim/scripts.html的插件
" Plugin 'L9'
" 未托管在GitHub上的Git插件
" Plugin 'git://git.wincent.com/command-t.git'
" 本地机器上的git软件库(即编写自己的插件时)
" Plugin 'file:///home/gmarik/path/to/plugin'
" sparkup vim脚本在名为vim的该软件库子目录下。
" 传递路径,合理设置运行时路径。
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" 安装 L9 并避免名称冲突
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}
"每个插件都应该在这一行之前
call vundle#end() " 这是必需的
filetype plugin indent on " 这是必需的
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
3.安装插件
另开一个终端
vim
在打开界面输入
:PluginInstall
安装成功显示如下画面
二、安装YouCompleteMe
1.安装python
sudo apt-get install python-dev
2.下载YouCompleteMe 终端输入
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
3.配置.vimrc文件
vim ~/.vimrc
在 call vundle#begin()下加入
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'Valloric/YouCompleteMe'
Bundle 'Valloric/ListToggle'
Bundle 'scrooloose/syntastic'
4.安装
另开终端
$:vim
:BundleInstall
类似与bundle安装的界面出现done 证明安装成功
5.配置
$:cd ~/.vim/bundle/YouCompleteMe
$:install.sh --clang-completer
安装完成后即可使用补全代码功能
参考http://tieba.baidu.com/p/2672605209
https://www.jianshu.com/p/1839f1fb3f08
https://www.jianshu.com/p/7c8d0510f1d6
-------第一次写博客 内容不连贯还望发邮件联系我 std.tr@qq.com