vimtricks.wiki Concise Vim tricks, one at a time.

How do I install vim-plug plugin manager?

Answer

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

Explanation

vim-plug is a minimalist plugin manager for Vim. It downloads and manages plugins with a simple configuration syntax.

How it works

  1. Install vim-plug by downloading plug.vim to the autoload directory
  2. Add call plug#begin() and call plug#end() to your vimrc
  3. List plugins between these calls
  4. Run :PlugInstall to install them

Example

call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-fugitive'
Plug 'junegunn/fzf.vim'
Plug 'preservim/nerdtree'
call plug#end()

Tips

  • :PlugInstall installs new plugins
  • :PlugUpdate updates installed plugins
  • :PlugClean removes unused plugins
  • :PlugStatus shows plugin status
  • Plugins are stored in ~/.vim/plugged/ by default

Next

How do you yank a single word into a named register?