vim-plug: A beautiful and minimalist vim plugin manager for Linux/Unix users

A vim plugin manager is a must for any die-hard vim user. You can find a few option available out there. My personal favorite is vim-plug which is a beautiful and minimalist plugin for vim. Let us see how to install and use this plugin on Linux or Unix-like system.

ADVERTISEMENTS

How to install vim-plug

Naturally, you must have vim installed on your system. For demo purpose I am using Ubuntu and MacOS. Simple download plug.vim and put it in the “autoload” directory:
$ mkdir -p ~/.vim/autoload/
$ cd ~/.vim/autoload/

Let us grab the plug.vim either using wget command or curl command:
$ wget https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
OR
$ curl -O https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

How do I configure vim-plug vim plugin manager for Linux or Unix?

The syntax is as follows in ~/.vimrc:

" Specify a directory for plugins 
call plug#begin('~/.vim/plugged')
 
" Any valid git URL is allowed for plugin
Plug 'valid git URL'
 
" Shorthand notation for plugin
Plug 'foo/bar'
 
" Initialize plugin system
call plug#end()

Example

Let us say you want to use a vim plugin named ansible-vim for syntax highlighting Ansible’s common filetypes. You need to append the following in your ~/.vimrc file:

call plug#begin('~/.vim/plugged')
" Install ansible plugin 
Plug 'pearofducks/ansible-vim'
" Make vim pretty with nova-vim
Plug 'sheerun/vim-polyglot'
Plug 'trevordmiller/nova-vim'
call plug#end()

Save and close the file.

Install ansible-vim and other plugin

Start the vim text editor:
$ vim
To see status type:

:PlugStatus
vim-plug - An awesome vim plugin manager for Linux and unix

vim-plug in action

To install ansible-vim type:

:PlugInstall

Sample session:

Animated gif 01: Vim-plug in action

Animated gif 01: Vim-plug in action

To update plugins type:
:PlugUpdate
To upgrade vim-plug itself type the following within vim session:
:PlugUpgrade

Conclusion

Of course, if you are happy with vundle or pathogen, then no need to switch. However, I liked this one better. For more information see the following pages:

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
5 comments… add one

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.