Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you source neovim config file without restarting nvim?

Tags:

bash

vim

zsh

neovim

Is there a way to source the ~/.config/nvim/init.vim file from within nvim?

With vanilla vim you can source .vimrc with :so % : Is there an equivalent method do with similarly in neovim?

like image 711
alrob Avatar asked Oct 24 '20 11:10

alrob


1 Answers

$MYVIMRC is always available from inside vim or neovim, so you can just use

:source $MYVIMRC

and bind it to a convenient mapping:

nnoremap <Leader>sv :source $MYVIMRC<CR>

2021 update: If you are using neovim with a lua config, you can use :luafile $MYVIMRC

like image 131
alrob Avatar answered Sep 30 '22 01:09

alrob