Guide · Open source
How to use vim-plug: install, configure and manage Vim plugins
Updated · written with AI from the project's own documentation and checked against our catalogue data
vim-plug is a plugin manager for Vim and Neovim. You list the plugins you want in your editor configuration file, and it downloads and updates them with commands such as PlugInstall and PlugUpdate. This guide walks through installing the single plug.vim file, writing a plugin section, and using the everyday commands, so you can manage plugins from your editor without a complicated setup.
Quick start
- 1Check prerequisites. Confirm that Vim or Neovim and git are installed on your machine.
- 2Download plug.vim. Run the curl or PowerShell command for your editor and operating system so plug.vim lands in the autoload directory.
- 3Add the plugin section. In ~/.vimrc or ~/.config/nvim/init.vim, add call plug#begin(), your Plug lines, and call plug#end().
- 4Reload and install. Reload the file or restart the editor, then run :PlugInstall.
- 5Update later. Run :PlugUpdate to install or update plugins, and :PlugDiff to review what changed.
- 6Clean unused plugins. Remove a Plug line you no longer need, then run :PlugClean to remove plugins that are no longer in the list.
What you need before you install vim-plug
vim-plug works only inside Vim or Neovim, and it installs plugins from git, so both Vim (or Neovim) and git need to be available on your system. vim-plug itself is distributed as a single file with no dependencies.
- Vim or Neovim
- git
Install plug.vim on Unix for Vim
Download plug.vim into the autoload directory. On Unix with Vim, run the command below. The source also notes you can automate this step by putting the command in your Vim configuration file, as described in the project's tips wiki.
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vimInstall plug.vim for Neovim, Flatpak or Windows
The README gives separate commands for Neovim on Unix and Linux, for the Neovim Flatpak build, and for PowerShell on Windows. For Vim on Windows, the file goes into the vimfiles autoload directory. Use the command that matches your setup.
- Vim on Windows (PowerShell): saves to $HOME/vimfiles/autoload/plug.vim
- Neovim on Linux: saves under the XDG data directory, in nvim/site/autoload/plug.vim
- Neovim Flatpak: saves to ~/.var/app/io.neovim.nvim/data/nvim/site/autoload/plug.vim
iwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |`
ni $HOME/vimfiles/autoload/plug.vim -ForceWrite a plugin section in your config file
Add a vim-plug section to your ~/.vimrc, or to ~/.config/nvim/init.vim for Neovim. The section has three parts: it begins with call plug#begin(), lists plugins with Plug commands, and ends with call plug#end(). Plugin names use the GitHub shorthand of user/repo, and you should use single quotes around them.
- Begin the section with call plug#begin()
- List each plugin with a Plug command
- End the section with call plug#end()
call plug#begin()
" List your plugins here
Plug 'tpope/vim-sensible'
call plug#end()Run the core commands to install and update
Reload the file or restart Vim, then run the commands from inside the editor. PlugInstall installs your listed plugins, PlugUpdate installs or updates them, PlugDiff shows the changes from the last update so you can review them, and PlugClean removes plugins that are no longer in your list.
- :PlugInstall installs the plugins
- `:PlugUpdate` installs or updates the plugins
- `:PlugDiff` reviews the changes from the last update
- `:PlugClean` removes plugins no longer in the list
Pin, delay or customise plugins with options
Each Plug line can take an options dictionary. The source shows how to use a tag (with a wildcard, which requires git 1.9.2 or above), a non-default branch, a custom install directory with dir, a post-update hook with do, a subdirectory with rtp, and on-demand loading with on (for a command) or for (for a file type). An unmanaged plugin path can also be listed, which vim-plug will not install or update.
- tag: pin to a tagged release, wildcard allowed
- branch: track a non-default branch
- dir: install into a non-default directory
- do: run a shell command or a function after install or update
- rtp: point to a plugin stored in a subdirectory
- on: load when a command runs
- for: load when a file type opens
" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
Plug 'fatih/vim-go', { 'tag': '*' }
" Using a non-default branch
Plug 'neoclide/coc.nvim', { 'branch': 'release' }
" On-demand loading: loaded when the specified command is executed
Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' }
" On-demand loading: loaded when a file with a specific file type is opened
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }Use vim-plug from Lua in Neovim
In Neovim you can write the configuration in an init.lua file instead of Vim script. The same plugin list is expressed with Lua tables, where option keys are written in square brackets, for example ['tag'] and ['branch'].
local vim = vim
local Plug = vim.fn['plug#']
vim.call('plug#begin')
Plug('junegunn/seoul256.vim')
vim.call('plug#end')What people use it for
- Managing a short list of Vim plugins such as tpope/vim-sensible from one config file
- Pinning a plugin to a tagged release or a non-default branch
- Loading a heavy plugin only when its command runs, such as NERDTreeToggle, to keep startup fast
- Installing and updating plugins in parallel with PlugInstall and PlugUpdate
- Keeping a Neovim configuration in Lua while using the same plugin manager
Frequently asked questions
How do I install vim-plug?
Download the plug.vim file into your autoload directory using the command for your editor and operating system. On Unix with Vim, the README uses curl with --create-dirs to save it to ~/.vim/autoload/plug.vim. Then add your plugin section to your config and run :PlugInstall.
What are the requirements for vim-plug?
The source lists Vim or Neovim and git as prerequisites. vim-plug works only inside those editors. It is a single file with no dependencies.
Is vim-plug free to use?
vim-plug is released under the MIT licence, as listed on its project page. Check the licence file in the repository for the full terms.
What is the difference between PlugInstall and PlugUpdate?
According to the README, PlugInstall installs the plugins in your list, while PlugUpdate installs or updates them. Use PlugDiff afterwards to review changes from the last update.
How do I remove a plugin with vim-plug?
Delete its Plug line from your configuration, reload, and run :PlugClean to remove plugins that are no longer in the list. You can add the bang, as in PlugClean!, to clean without a prompt.
What are the alternatives to vim-plug?
The project lists Vundle, Pathogen, packer.nvim and lazy.nvim as comparable projects. The source does not compare them in detail, so review each one's documentation for your needs.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
vim-plug suits Vim or Neovim users who want a small, simple plugin manager with a short configuration syntax, branch, tag or commit pinning, and on-demand loading. If you do not use Vim or Neovim, need plugins from sources other than git, or want a built-in package system, pick a different option.
Install options & downloads