开发者

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 %
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜