如何在不重新启动 VIM 的情况下使我的 vimrc 中的更改生效?
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>
您可以通过创建一个 autocmd 来自动执行此操作,该 autocmd 每次保存时都会获取 .vimrc 文件:
autocmd BufWritePost .vimrc so %
如果您正在编辑它,只需键入:
:so %
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.