Append the following in your ~/.vimrc file

" Edit vimr configuration file
nnoremap confe :e $MYVIMRC<CR>
" Reload vims configuration file
nnoremap confr :source $MYVIMRC<CR>


Now just press Esc followed by confe to edit ~/.vimrc file. To reload type Esc followed by confr. Some people like to use the <Leader> key in a .vimrc file. So above mapping becomes:

" Edit vimr configuration file
nnoremap <Leader>ve :e $MYVIMRC<CR>
" " Reload vimr configuration file
nnoremap <Leader>vr :source $MYVIMRC<CR>


The <Leader> key is mapped to \ by default. So you just press \followed by ve to edit the file. To reload the ~/vimrc file you press \ followed by vr
And there you have it, you just reload .vimrc file without restarting vim ever.

Ця відповідь Вам допомогла? 0 Користувачі, які знайшли це корисним (0 Голосів)