使用Vundle管理Vim插件
附:仓库地址
附:我自用的vim配置文件,里面注释很多,仅供参考。
Vundle是一款Vim的插件管理软件(Linux),用起来很方便的原因有几点:
- 支持插件超多,可以来源于github、Vundle自带、Vim-scripts、本地仓库等等。
- 安装流程非常简单,配置好vimrc后一键安装/更新所有
- Vundle很容易上手,很方便
快速使用
请先自行安装git。
下载vundle到指定位置
$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
在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
最后打开vim,输入如下命令:
:PluginInstall
它现在正在根据vimrc中所指定的插件列表在自动下载并安装插件了,过程可能比较久,慢慢等。
帮助
在安装完成之后就可以使用如下命令查看Vundle的一些使用方法:
:h vundle
常用命令有如下四个:
:BundleUpdate
更新插件
:BundleClean
清除不再使用的插件
:BundleList
列出所有插件
:BundleSearch
查找插件,找到后按i
即可安装
针对某个插件如ctrlp.vim,可以用如下命令查看该插件的信息:
:h ctrlp
注:
:PluginSearch
指令所找出来的插件都在vim-scripts,这个仓库里可以找到一些插件的设置方法,文档说明等。- 关于vimrc应该怎么编写,请看Vundle的说明文档,或者仿照着写应该问题不大。
- Vundle本身也是vim的一个插件,原理就是插件管理着插件而已。
离线安装插件
你可能会自己写个插件,或者由于种种原因,无法直接使用网络方式安装,而是通过自己下载好了插件再让vundle管理,此时就需要另外的方法了。
首先是主题的安装,比如喜欢用molokai
这种主题,先下载到molokai.vim
这个文件,这个文件你可以去github或者其他地方找到,然后拷到本机的.vim/colors/
目录下,在.vimrc
中写一句Plugin 'molokai'
就可以了,这和在线安装是一样的,重启下vim就生效,无需再去PluginInstall。
其次是其他插件的安装,先找到这个插件的整个文件夹,下载后放在.vim/bundle/
目录下,直接整个文件夹放进去,然后在.vimrc
中写一句Bundle 'xxx'
就行了。举个例子,The-NERD-tree
这个插件用于在vim中查看目录树,如果想要离线安装它,先从github上将仓库clone下来,丢到.vim/bundle/
目录下,在.vimrc
中写上Bundle 'The-NERD-tree'
,重启vim就生效。要注意,这样其实插件还是让vundle管理的。
使用Vundle管理Vim插件的更多相关文章
- 用Vundle管理Vim插件
作为程序员,一个好用的Vim,是极其重要的,而插件能够使原本功能羸弱的Vim变得像其他功能强大的IDE一样好用.然而下载.配置插件的过程比较繁琐,大家往往需要自己进行下载/配置等操作,如果还涉及到更新 ...
- 使用pathogen管理Vim插件并托管到Github
参照文章[1][2]的办法,将vim打造成一个Python开发环境.文章中使用的是 pathogen + git 来管理 Vim 插件的.对这种方式还不太明白的同学可以参考[3]中的介绍.pathog ...
- [vundle]利用vundle工具来管理vim插件
转自:http://os.51cto.com/art/201507/484174.htm Vim是Linux上一款用途广泛的轻量级文本编辑工具.虽然对普通的Linux用户来说开始学用起来难度相当大,但 ...
- 菜鸟vimer成长记——第4.0章、Vim插件管理利器-Vundle
定义 Vundle是vim bunler和简称,它是一个vim插件管理器. Vim本身缺乏对插件的有效管理,安装插件并配置.vimrc文件非常不便.gmarik受到Ruby的bunler的启发,开发了 ...
- vundle 管理插件
前言:如果不使用vundle的话,进行插件的安装,配置和管理相对会麻烦,曾经没使用vundle的时候我经常遇到无法安装一些vim插件.但使用vundle后你只要在文件中添加一行你的插件名再安装就OK了 ...
- 常用vim插件的安装、使用和管理
1.Ctags Ctags工具是用来遍历源代码文件生成tags文件,这些tags文件能被编辑器或者其他工具用来快速查找定位源代码中的符号,入变量名,函数名等.比如,tags文件就是Taglist和 ...
- vim插件和配置
vim插件和配置 插件 pathogen 可以方便地管理vim插件 在没有pathogen的情况下,vim插件的文件全部都放在.vim目录,卸载插件很麻烦,pathogen可以将不同的插件放在一个单独 ...
- vim插件安装总结
vim插件安装总结 vim 插件 vundle 插件对于vim来说是一个杀手级别的神器助手,能自动补全,语法高亮,文件搜索等等,有效地提升了编程效率.下面就个人的一些安装和使用进行一个总结. 自动管理 ...
- 【原创】vim插件安装简介
一.安装vundle(vim插件管理软件): git clone https://github.com/VundleVim/Vundle.vim 拷贝目录到 ~/.vim/bundle/Vundle. ...
随机推荐
- 使用Java设计验证码生成程序
我们来设计一个简单的验证码生成程序:验证码一个由4位的数字.字母随机组合而成图像,为了避免被光学字元识别(OCR,Optical Character Recognition)之类的程序识别出图片中的数 ...
- 原生js实现拖动滑块验证
拖动滑块验证是现在的网站随处可见的,各式各样的拖动法都有. 下面实现的是某宝的拖动滑块验证: <!DOCTYPE html> <html lang="en"> ...
- ruby中数组的常用函数
在程序中定义一个数组 在程序中定义一个数组,因为我们在下面说明. fruits = ["apple", "orange", "lemon"] ...
- 安装完xampp启用时,计算机中丢失api-ms-win-crt-conio-l1-1-0.dll怎么办?
安装完xampp启用时,计算机中丢失api-ms-win-crt-conio-l1-1-0.dll怎么办 api-ms-win-crt-conio-l1-1-0.dll 第一步:我们需要下载缺失的这个 ...
- Winform 常用的方法
一,Winform 如何内嵌窗体 1,判断窗体中是否以还有内嵌窗体 private void ClosePreForm() { foreach (Control item in this.spCont ...
- [日常] nginx访问频率限制
去年的事,随便记记 ========================================================================= 2017年3月15日 记录: n ...
- Java Web应用开发工具
java Web应用开发工具详细地址:https://my.oschina.net/gitosc/blog/1538466
- Android属性动画的监听事件
整体很简单,直接上代码吧.activity_main.xml: <?xml version="1.0" encoding="utf-8"?> < ...
- flutter 生命周期
前言:生命周期是一个组件加载到卸载的整个周期,熟悉生命周期可以让我们在合适的时机做该做的事情, flutter中的State生命周期和android以及React Native的生命周期类似. 先看一 ...
- Object.defineProperty 与数据绑定的简单实现
对象是一个属性集合,对象的基本特征是属性名(name)和属性值(value).ES5 增加了属性描述符,包括数据属性描述符(configurable enumerable writable value ...