Apply vimrc changes without restarting
How can I have changes in my vimrc take effect without resta开发者_如何学Crting VIM?
You can just source it, like this:
:so ~/.vimrc
Also, for convenience, it usually gets mapped to something quicker to type:
nmap <silent> <leader>sv :so $MYVIMRC<CR>
And then of course, it would be nice to open vimrc a little quicker:
nmap <silent> <leader>ev :e $MYVIMRC<CR>
You can automate this by creating an autocmd that sources the .vimrc file every time it is saved:
autocmd BufWritePost .vimrc so %
If you are editing it,just type:
:so %
精彩评论