Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install Plugins in NeoVim Correctly

Tags:

neovim

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.

like image 529
Philip Mutua Avatar asked Feb 09 '18 07:02

Philip Mutua


People also ask

Where does Neovim store plugins?

Nvim's data directory is located in ~/. local/share/nvim/ and contains swap for open files, the ShaDa (Shared Data) file, and the site directory for plugins.

Does Neovim have a plugin manager?

nvim: A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config.


1 Answers

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.

like image 79
prasutagus Avatar answered Sep 26 '22 23:09

prasutagus