Using plug-ins, we can extends the functionality of Vim. Vim supports many plug-ins and most of them are available freely. This chapter is about Vim plug-ins and we will discuss following items −
This section discusses plug-in management. Vim provides various plug-ins managers but we won’t be using any plug-in manager, instead we’ll be doing all these steps manually for better understanding. Once you understand these steps, you can go with plug-in manager.
To install any plug-in perform following steps −
Let us install badwolf plug-in in Vim. It is a color scheme for vim.
$ mkdir -p ~/.vim/bundle $ cd ~/.vim/bundle/ $ git clone https://github.com/sjl/badwolf.git $ echo "set runtimepath^ = ~/.vim/bundle/badwolf" > ~/.vimrc
Now plug-in is installed, so we can use badwold color scheme as follows −
If we observe carefully, plug-in is a just collection of files and if we want to update that plug-in then just update appropriate plug-in directory from ~/.vim/bundle.
Removing plug-in in Vim is really simple. To remove plug-in perform following steps −
Below is list of some useful Vim plug-ins
|Sr.No||Name & Description|
Disassemble C/C++ code
Indenting for AWK script
Vim package manager
Automatically save and load vim session based on switching of git branch
Provide liniting for python files