+OK
  • Home
  • About
  • Categories
  • Tags
  • Archives

Vim Tutorial (4) Add Plugins by Vundle

Add Plugins

With Plugins, you can use Vim more efficiently. But you'd better be proficient with Vim before adding any plugins.

There are many ways to add plugins, but it would be hard to manage plugins. To solve this problem, the plugin manager Vundle will be helpful.

Vundle Set-Up

$ git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

Configure Plugins

Put this at the top of your .vimrc to use Vundle. Remove plugins you don't need, they are for illustration purposes.

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/'}
" Avoid a name conflict with L9
Plugin 'user/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

" Put your non-Plugin stuff after this line

Brief Instructions

  • :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
  • :h vundle for more details or wiki for FAQ

You may see some people use BundleXxxx instead of PluginXxxx. They are nearly the same but PluginXxxx is recommended since 2014. BundleXxxx still can be used only for compatibility reasons.

Share on: Twitter ❄ Facebook ❄ Google+ ❄ Email

So what do you think of it? Do I miss something? Leave your comments below...

Comments
comments powered by Disqus

Related Posts

  • Vim Tutorial (1) Start Using Vim
  • Vim Tutorial (2) Configure Vim
  • Vim Tutorial (3) Theme and Font
  • Edit LaTeX with Vim
  • Enable Alt Key Macros in LaTeX-Suite

  • « Vim Tutorial (3) Theme and Font
  • 毛氏红烧肉 »

Published

Oct 10, 2015

Last Updated

Oct 10, 2015

Category

Coding

Tags

  • config 1
  • mac 5
  • plugins 1
  • vim 7

Contact

  • Creative Commons License
    "+OK" by Joe is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
  • Powered by Pelican. Theme: Elegant by Talha Mansoor