vim

VIM Plugins with VIM Vundle

Vim is a well-known console-based source code, and the text editor offers many advanced features. The most important feature of Vim is customization and extensibility using various plugins. As we know that it is a highly configurable tool; therefore, managing all these plugins manually is a very tedious job. For this purpose, you need a plugin manager to manage all configurations. Vundle is a plugin manager that manages all plugins.

In this article, we will discuss how to install the Vim Vundle plugin manager on the Ubuntu system and manage all plugins on the Vim text editor.

Installing Vundle on Ubuntu 20.04

Install the Git version control system, available in any Linux operating system official repository. Here in this article, we will use Ubuntu 20.04 package repository to install git.

Update the apt repository using the following command:

$ sudo apt update

Now, install the git by typing the following command:

$ sudo apt-get install git -y

After executing the above command, git to be installed on your Ubuntu system. Now, using the URL https://github.com/VundleVim/Vundle.vim access the official Vundle website.

The following web page to be displayed in your browser:

Click on the green button named “Clone or download”. The following popup dialog will appear’.

Click on the Copy icon. The URL of the git repository to be copied.

Now, access the terminal and follow the syntax as given below:

$ git clone URL-paste ~/.vim/bundle/Vundle.vim

You will paste the copied URL in the following command. The final command should look like the below command.

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

The Github repository to be cloned in the user’s home directory. In my case, the path of the directory is ‘/home/kbuzdar/.vim/bundle/Vundle.vim’.

Now, open the ~/.vimrc file using the following command:

$ vim ~/.vimrc

Now, if the ‘.vimrc’ file doesn’t exist before then. It will create and open an empty file.

Press Esc key and i to go in insert mode. Now paste the following code in this file:

syntax enable
set tabstop=4
set expandtab
set number
filetype indent on
set autoindent
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'

" Add plugins here which you want to add

call vundle#end()
filetype plugin indent on

Now save this file and exit vim using the following command:

:wq!

Now open the vim using the following command through terminal:

$ vim

Now, using the following command, we will install or initialize the Vim Vundle plugin manager:

:PluginInstall

The Vim Vundle plugin manager to be installed on vim. In the following output, you can see the installation of Vim Vundle plugin:

Search plugin

Using the Vundle plugin manager, you can search for newly available plugin by using the following syntax:

:PluginSearch <plugin-type or name>

How to install a plugin from GitHub using Vundle package manager?

You can install a plugin using the VIM Vundle package manager. For this purpose, we will open the plugin web page of Github. For example, we want to install the ‘powerline’ Github plugin from their repository.

Follow the following steps to install a plugin from the Github repository:

1. Open the plugin page of Github and copy the name section marked in the following output screenshot.

2. Now, open the file ~/.vimrc in vim and paste the line in it file as follows:

3. Install this plugin on vim using the following command:

The powerline plugin to be installed on Vim. Now, list the installed plugins using the following command:

:PluginList

As you can see, the powerline Github plugin has been installed on Vim.

Remove or delete plugin through Vim Vundle

You can also remove a plugin from the installed plugins list. Navigate to the particular line and press ‘Shift + D’. After that, the plugin to be removed from the list.

Now, also remove the plugin from the ~/.vimrc file as follows:

That’s all about the Vim Vundle plugin manager.

In this article, you learned using the VIM Vundle Plugin Manager. You can manage all VIM plugins easily and in a quick way. Moreover, you can search and install more Github plugins for installation. I hope you enjoyed this article.

About the author

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.