Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NeoVIm does not automatically load ~/.nvimrc file

Tags:

vim

debian

neovim

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?

like image 800
J. Doe Avatar asked Apr 19 '17 07:04

J. Doe


Video Answer


2 Answers

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
like image 82
Doktor OSwaldo Avatar answered Nov 09 '22 03:11

Doktor OSwaldo


Instead of referring to your rc file directly, consider using $MYVIMRC:

:e $MYVIMRC
:source $MYVIMRC

Reference: Learn Vim the Hard Way/Editing your vimrc

like image 25
Jim U Avatar answered Nov 09 '22 03:11

Jim U