Installing vim-plug

Installing vim-plug

Get the manager

vim-plug is a single Vimscript file. Install it into Neovim’s autoload directory:

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

Declare plugins

Add a plug block to your config. Every plugin is one Plug line naming a GitHub repository:

call plug#begin('~/.config/nvim/pack')

Plug 'tpope/vim-surround'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'lewis6991/gitsigns.nvim'

call plug#end()

The optional table after a plugin ({'do': ':TSUpdate'}) runs a command after install or update — treesitter uses it to compile its parsers.

The three commands you need

:PlugInstall   " install everything declared but missing
:PlugUpdate    " update installed plugins
:PlugClean     " remove plugins you deleted from the block

Declare, install, restart. That is the whole loop.