Managing VIM Plugins with Vundle

The vanilla VIM editor that comes pre-installed with Ubuntu is vim-tiny and not full vim. You can verify this by typing the following command in a terminal:


dpkg -l vim*

To install full fledged vim type:


sudo apt-get install vim

Vim is one of the most popular text editors in the *nix world. Its functionality can be extended by installing plugins and there are thousands of such plugins out there. Vundle is a plugin manager for vim much like pip is for Python. To install Vundle you will first need to install Git:

 

sudo apt-get install git

 

Clone Vundle:

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

Go to your home directory:

cd ~

And create the .vimrc file:

vim .vimrc

On top of the file put the following code:

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'
" 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

To add more plugins add them below the line:

Plugin 'VundleVim/Vundle.vim'
but before:
call vundle#end() " required

For example if you want to install the plugin YouCompleteMe, your .vimrc will look like:

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'
Plugin 'Valloric/YouCompleteMe'
" 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

After adding the name of the plugin to the .vimrc file you have to open vim and in the command mode type:


:PluginInstall

Similarly, to update the plugins:


:PluginUpdate

To list all plugins:


:Plugins

To search for a specific plugin:


:PluginSearch! plugin_name

To see all installed plugins:


:PluginList

To remove a plugin, first delete its entry from the .vimrc file and then issue the following command:


:PluginClean

Further Help: