Setting Up Vim Plug Package Manager

Plug is currently the best package manager for Vim plugins. It does not require a lot of configuration and deals with Git submodules better (don’t worry if you don’t fully understand that last part). Once Plug is setup in your .vimrc you just need to add a line to setup and install any Vim plugin. All you need to backup is your .vimrc file.

But First …

Install the Apt Package: vim

Confirm you have the latest vim installed (should be 8 or higher). It is common for Linux distros to not include the full version of Vim by default.

vim -version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 10 2018 21:31:58)
Garbage after option argument: "-version"
More info with: "vim -h"

Consider setting up a GitLab project repo for your Vim configuration files if you have not already done so.

Step by Step

Read about vim-plug if you want to get familiar with it.

It’s easiest to just curl down the plugin to the right place, as recommended, but you could also just copy and paste the code from the source link above if you prefer.

curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

You might want to confirm at this point that your .vimrc directory is, in fact, a symbolic link to some project repo you are using to backup and store your Vim configuration.

ls -l ~/.vimrc
lrwxrwxrwx 1 rob rob 41 Mar 31 07:21 /home/rob/.vimrc -> /home/rob/repos/skilstak/config/vim/vimrc

Then you just have to add the Plug VimScript stuff to your .vimrc.

call plug#begin('~/.vim/plugged')
call plug#end()

You can use the ~/.vim/autoload/plug.vim file itself as a good reminder of what do add since it has great comments in it.

[Check for yourself.]

Now all you have to do is add the plugins by account and project repo name between the two calls.

I suggest you get at least the following:

call plug#begin('~/.vim/plugged')
Plug 'altercation/vim-colors-solarized'
Plug 'vim-pandoc/vim-pandoc'
Plug 'vim-pandoc/vim-pandoc-syntax'
call plug#end()

The last step is to run :PlugInstall from within vim.