How do I install Plugins in NeoVim Correctly

Philip Mutua picture Philip Mutua · Feb 9, 2018 · Viewed 37.9k times · Source

Does NeoVim have it's own config file just like vim's .vimrc ? If so where can I get that file in the home directory to make my own custom changes.

Answer

prasutagus picture prasutagus · May 1, 2018

Both VIm 8.0 and Neovim have their own built-in package manager.

In VIm 8.0, create the following directories:

  • ~/.vim/pack/*/start (where * may be any name e.g. ~/.vim/pack/jimmy/start): Clone your required plugin into the start directory just as you would if you were installing it for Pathogen. You need nothing more and no commands in your .vimrc file.
  • ~/.vim/pack/*/opt (e.g. ~/.vim/pack/jimmy/opt) for plugins that only need to be loaded as required. For colours, add a directory to the opt directory and then your colours e.g. ~/.vim/pack/jimmy/opt/mycolors/colors/dracula.vim.

In Neovim, the directory structure follows the freedesktop's XDG Base Directory Specification. Your configuration file is in ~/.config/nvim/init.vim, but your plugins go into:

  • ~/.local/share/nvim/site/pack/*/start

See :h packages (VIm 8.0 and Neovim) for more information.