NeoVIm does not automatically load ~/.nvimrc file

J. Doe picture J. Doe · Apr 19, 2017 · Viewed 7.8k times · Source

I was looking to get into learning a text editor for programming. However, I've quickly run into a little snag that I can't seem to find a solution to.

I have modified my /home/user/.nvimrc file to add some plugins and I can load it using :source ~/.nvimrc, however, it never loads automatically. :scriptnames shows a list of scripts in /usr/, but mysteriously absent from the list is the .nvimrc file in my home directory. Again, I can load it in the command line, but I'd like to not have to use :so ~/.nvimrc every time I open a file.

I am not using sudo to run vim.

How can I solve this problem? Is this something everybody has to do?

Answer

Doktor OSwaldo picture Doktor OSwaldo · Apr 19, 2017

Could be this issue: https://github.com/neovim/neovim/issues/3530

Summary:

New location is ~/.config/nvim/init.vim

To keep ~/.nvimrc you can source it from the new location:

mkdir -p ~/.config/nvim
echo 'source ~/.nvimrc' > ~/.config/nvim/init.vim