标签:
Vim 下的自动补全,最好的工具莫过于 YouCompleteMe,官方文档在这里 http://valloric.github.io/YouCompleteMe/
安装稍显复杂,以下记录我的过程。
1. 安装 Vundle
Vundle 是 Vim 下的一个插件管理器,如果之前你配置 Vim 是手动放置 xxx.vim配置文件到相应目录,那么现在你要安装 Vundle, 因为 YouCompleteMe 是基于 Vundle 安装的,
Vundle 的 github 地址: https://github.com/VundleVim/Vundle.vim
- git 克隆插件 $ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
- 添加如下内容到 ~/.vimrc 文件最前面,
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For Vundle Start
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin(‘~/some/path/here‘)
" let Vundle manage Vundle, required
Plugin ‘VundleVim/Vundle.vim‘
" Install YouCompleteMe
Plugin ‘Valloric/YouCompleteMe‘ " 注意,这就是要安装的插件 YouCompleteMe
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For Vundle End
保存关闭。
- 启动 Vim,执行命令 :PluginInstall 将出现如下安装画面,(YouCompleteMe 插件较大,请耐心等待)
标签:
原文地址:http://www.cnblogs.com/gaowengang/p/Vim.html