Search code examples
neovim

How do I install Plugins in NeoVim Correctly


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.


Solution

  • 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.