Vim插件之插件管理器Vundle
2016-05-08 20:01
435 查看
1、介绍下载
相比Sublime、Text2等现代编辑器,Vim缺乏默认的插件管理器,所有插件的文件都散布在~/.vim下的几个文件夹中,配置Vim的过程, 就是在网上不停的搜插件,拷贝到~/.vim下,发现更新,要重新下载重新拷贝,想要删除某个不需要插件,更是要小心翼翼的不要删错。配置出顺手的Vim, 需要极大的耐心和运气。一般情况下的VIM插件管理方式。Vundle(Vim bundle)是一个Vim的插件管理器。它是把git操作整合进去,用户需要做的只是去GitHub上找到自己想要的插件的名字,安装、更新和卸载都可有vundle来完成了。
GitHub:https://github.com/gmarik/Vundle.vim
2、安装使用
【下载】通过下面的命令可以从GitHub上面下载Vundle。
git clone https://github.com/gmarik/vundle.git
下载完毕后,进入"~/.vim/bundle/vundle"可以看到安装的地方。
【配置】
在".vimrc"文件中修改并按照下面例子加入相应需要的语句,样例代码如下所示:
set nocompatible " be iMproved
filetype off " required! /** 从这行开始,vimrc配置 **/
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My Bundles here: /* 插件配置格式 */
"
" original repos on github (Github网站上非vim-scripts仓库的插件,按下面格式填写)
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
Bundle 'tpope/vim-rails.git'
" vim-scripts repos (vim-scripts仓库里的,按下面格式填写)
Bundle 'L9'
Bundle 'FuzzyFinder'
" non github repos (非上面两种情况的,按下面格式填写)
Bundle 'git://git.wincent.com/command-t.git'
" ...
filetype plugin indent on " required! /** vimrc文件配置结束 **/
" /** vundle命令 **/
" Brief help
" :BundleList - list configured bundles
" :BundleInstall(!) - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..
Vundle分为三类:
在Github vim-scripts 用户下的repos,只需要写出repos名称
在Github其他用户下的repos, 需要写出"用户名/repos名"
不在Github上的插件,需要写出git全路径
备注:
Vim配置 | 简单说明 |
set nocompatible | 不要使用vi的键盘模式,而是vim自己的 |
filetype on | 侦测文件类型 |
filetype plugin on | 载入文件类型插件 |
filetype indent on | 为特定文件类型载入相关缩进文件 |
打开一个vim, 运行":BundleInstall"或者在命令行运行"vim +BundleInstall +qall",安装完成后插件就能用了。
其它常用命令:
更新插件":BundleUpdate"
清除不再使用的插件":BundleClean"
列出所有插件":BundleList"
查找插件":BundleSearch"
相关文章推荐
- html5绘制渐变图形-线性渐变
- 解析XML请求(明文模式)
- ssh导出数据库的数据到Excel表格
- shiro中的filterChainDefinitions
- (转)Android 如何全局获取Context
- mvn常用命令
- 嵌入式软件常用缩写
- 统计学习导论:基于R应用——第五章习题
- linux 基础运维
- java新手之每日学习篇
- SSH免密码登录
- Android开发学习之路--React-Native之初体验
- HTML5概述
- Android开发学习之路--React-Native之初体验
- Miracast Introduce v2 (Android 4.2 Wifi display)
- Android工具draw9patch使用点.9.png图片制作
- cacti安装配置
- Interference Signal 第八届
- 快排函数(手写)
- java下的token校验