Vim插件管理器——Vundle
文章目录
- Vim插件管理器——Vundle
- Vundle简介
- 如何安装
- 1 确保已经安装git
- 2 安装Vundle
- 3 配置
- 4 运行
- 几个常用的Vundle命令
Vim插件管理器——Vundle
众所周知,Vim是一款非常优秀的编辑器,然而很多人除了对他的操作望而生畏之外,对他的配置也是焦头烂额。
我用了vim有几年了,由于项目上更多的是在各种IDE中使用vim,所以现在能熟练使用vim的命令,然而却没有怎么安装vim插件,这几天有空就决定折腾一下。
要先安装插件,首先需要一个插件管理器,Vundle就是一款非常优秀的插件管理器。
Vundle在github上的地址在这里:https://github.com/VundleVim/Vundle.Vim
Vundle简介
Vbundle 是 Vim bundle 的缩写,它是一款vim插件管理器。
Vbundle允许你可以做:
- 在.vimrc中跟踪和配置插件
- 安装配置的插件(a.k.a. scripts / bundle)
- 更新配置的插件
- 按名称搜索所有可用的Vim脚本
- 清理未使用的插件
- 使用交互模式在单个按键中运行上述操作
Vundle可以自动化地:
- 管理已安装脚本的运行时路径
- 安装和更新后重新生成帮助标签
目前Vundle正在进行界面更改,请及时了解最新信息。
如何安装
1 确保已经安装git
Vundle的安装依赖于git,确保你的Linux系统上已经安装了git。
2 安装Vundle
安装Vundle其实就是将github上的项目clone到本地,执行以下命令来进行安装:
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
3 配置
成功安装之后,接下来需要配置Vundle到Vim之中,打开.vimrc文件:
vim ~/.vimrc
将以下这段copy到.vimrc文件中的首部,即最开始的位置。
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'" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
" Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
" Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" 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
保存推出
注意: 这里的内容与github主页上的内容并不完全相同,如果copy官方的配置会报两个错误并安装失败:
[131205 15:35:35] Bundle git://git.wincent.com/command-t.git |~
[131205 15:35:35] $ git clone --recursive 'git://git.wincent.com/command-t.|~
git' '/home/p/.vim/bundle/command-t' |~
[131205 15:35:35] > fatal: read error: Connection reset by peer^@Cloning in|~
to '/home/p/.vim/bundle/command-t'...^@ |~
[131205 15:35:36] |~
[131205 15:35:36] Bundle file:///Users/gmarik/path/to/plugin |~
[131205 15:35:36] $ git clone --recursive 'file:///Users/gmarik/path/to/plu|~
gin' '/home/p/.vim/bundle/plugin' |~
[131205 15:35:36] > Cloning into '/home/p/.vim/bundle/plugin'...^@fatal: '/|~
Users/gmarik/path/to/plugin' does not appear to be a git repository^@fatal:|~Could not read from remote repository.^@^@Please make sure you have the co|~
rrect access rights^@and the repository exists.^@
这是由于下面这两句话引起的:
Bundle git://git.wincent.com/command-t.git
Bundle file:///Users/gmarik/path/to/plugin
上面的配置已经将这两句话注释掉了,可以放心复制。
关于这个问题,可以参考这儿:Stack Overflow
4 运行
打开vim,在终端直接执行vim。
vim
在vim中执行
:PluginInstall
这时就会安装刚才我们写在.vimrc文件中的插件了,耐心等待片刻,就可以正常使用vim了。
几个常用的Vundle命令
命令 | 解释 |
---|---|
:PluginList | 列出.vimrc文件中配置的插件 |
:PluginInstall | 安装插件;后面跟"!"可以更新或者仅执行:PluginUpdate |
:PluginSearch foo | 搜索foo;后面跟"!"可以刷新本地缓存 |
:PluginClean | 确认清楚未使用的插件;后面跟"!"可以自动批准清除 |
Vim插件管理器——Vundle相关推荐
- Linux Vim插件管理器Vundle安装和使用
Vundle是vim的一个插件管理器, 同时它本身也是vim的一个插件.插件管理器用于方便.快速的安装.删除.Vim更新插件.vim Vundle插件官方地址:https://github.com/V ...
- vim插件管理器:Vundle的介绍及安装(很全)
背景 Vim缺乏默认的插件管理器,所有插件的文件都散布在~/.vim下的几个文件夹中,插件的安装与更新与删除都需要自己手动来,既麻烦费事,又可能出现错误. Vundle简介 Vundle 是 Vim ...
- Vim安装插件管理器Vundle
安装vundle $ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim 默认安装在/.vim ...
- VIM妙用及linux使用技巧(包括vim插件管理器、指令与键盘映射、打开多个文件、奇偶删除行、vim替换等)
前言 vim 是个非常高效.非常好用的工具,很多人一旦开始使用 Vim 之后就再也无法自拔.然而, Vim 仍然有其自身缺陷,对于普通用户来说,很难在入门的时候就体会到Vim的所谓高效性,同时,为了展 ...
- vim 中的杀手级插件: vundle (vim 插件管理器)
From:http://zuyunfei.com/2013/04/12/killer-plugin-of-vim-vundle/ vundle.txt:https://github.com/Vundl ...
- vim插件管理器:Vundle的介绍及安装(很全)(转载)
转载自:https://blog.csdn.net/zhangpower1993/article/details/52184581 背景 Vim缺乏默认的插件管理器,所有插件的文件都散布在~/.vim ...
- Vim使用(二)——插件管理器vundle及nerdtree和ctags插件
文章目录 一.vim插件管理器. 1.1 安装步骤 1.2 使用方式 二.ctags插件的安装 2.1 安装步骤: 2.2 使用方式: 一.vim插件管理器. 插件管理器可以方便管理vim插件的安装. ...
- Vim插件管理工具Vundle以及常用插件
1. Vim插件管理工具Vundle 虽然拥有大量的插件,却缺少一个 确之有效的插件管理器.所幸,Vundle的出现解决了这个问题. Vundle可以让你在配置文件中管理插件,并且非常方便的查找.安装 ...
- vim插件管理器minpac安装及使用
文章目录 写在前面 安装与配置 插件的安装与删除 安装插件 更新插件 删除插件 自定义命令 示例:`pydiction`补全插件的安装与使用 写在前面 本文介绍一下安装Vim插件管理器minpac的方 ...
最新文章
- iOS多线程编程之NSOperation和NSOperationQueue的使用
- 机器学习算法加强——聚类实践
- Oracle 11g新特性:Result Cache
- 爬虫python下载视频_用python做爬虫下载视频
- 工作377-处理url拼接里面的参数方法
- $.each()、$.map()区别浅谈
- 【TensorFlow】实现、训练并评估简单的回归模型和分类模型
- 二.编写第一个c#程序(注释,命名空间,类,Main方法,标识符,关键字,输入,输出语句,)...
- [转载] Python中NumPy简介及使用举例
- 统计学第八版贾俊平课后答案
- 部分 MP4 视频在谷歌浏览器无法播放
- 网络安全应急响应事件一
- 英语12个月份的英文和缩写
- 列表解析式,生成表达式
- 计算机桌面调音量的图标不见了,声音图标不见了,音量图标不见了怎么办?
- android 简单快速 倒计时动画
- HTML网页获取当前定位经纬度/地理位置定位/百度定位/高德定位
- 用js实现加载本地图片并显示并将图片信息上传至服务端
- python 12306抢票_Python爬虫实战:12306抢票开源!
- JAVA毕业设计Web网上购书后台管理系统计算机源码+lw文档+系统+调试部署+数据库