# vim-plug https://github.com/junegunn/vim-plug ### [Install for Neovim](https://github.com/junegunn/vim-plug#neovim) ```bash sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' # Run :PlugInstall then :qa vim # The following one-liner didn't work last time I tried, just do it manually if it doesn't work # vim +'PlugInstall --sync' +qall ``` ### Usage Add a vim-plug section to your `~/.vimrc` (or `stdpath('config') . '/init.vim'` for Neovim) 1. Begin the section with `call plug#begin()` 2. List the plugins with `Plug` commands 3. `call plug#end()` to update `&runtimepath` and initialize plugin system - Automatically executes `filetype plugin indent on` and `syntax enable`. You can revert the settings after the call. e.g. `filetype indent off`, `syntax off`, etc. ### Commands `PlugInstall [name ...] [#threads]`: Install plugins `PlugUpdate [name ...] [#threads]`: Install or update plugins `PlugClean[!]`: Remove unlisted plugins (bang version will clean without prompt) `PlugUpgrade`: Upgrade vim-plug itself `PlugStatus`: Check the status of plugins `PlugDiff`: Examine changes from the previous update and the pending changes `PlugSnapshot[!] [output path]`: Generate script for restoring the current snapshot of the plugins #### Example ```vim " Specify a directory for plugins " - For Neovim: stdpath('data') . '/plugged' " - Avoid using standard Vim directory names like 'plugin' call plug#begin('~/.vim/plugged') " Make sure you use single quotes " Shorthand notation; fetches https://github.com/junegunn/vim-easy-align Plug 'junegunn/vim-easy-align' " Any valid git URL is allowed Plug 'https://github.com/junegunn/vim-github-dashboard.git' " Multiple Plug commands can be written in a single line using | separators Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' " On-demand loading Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'tpope/vim-fireplace', { 'for': 'clojure' } " Using a non-default branch Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' } " Using a tagged release; wildcard allowed (requires git 1.9.2 or above) Plug 'fatih/vim-go', { 'tag': '*' } " Plugin options Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' } " Plugin outside ~/.vim/plugged with post-update hook Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } " Unmanaged plugin (manually installed and updated) Plug '~/my-prototype-plugin' " Initialize plugin system call plug#end() ```