Is it possible to apply vim configurations without restarting?

后端 未结 5 1180
南笙
南笙 2020-12-12 19:45

I want to edit .vimrc file from Vim and apply them without restarting Vim.

5条回答
  •  孤城傲影
    2020-12-12 20:02

    Yes, just use the :so % command while editing your .vimrc.

    If you want vim to auto-reload your configuration, you must add the following commands :

    augroup myvimrchooks
        au!
        autocmd bufwritepost .vimrc source $MYVIMRC
    augroup END
    

    the grouping of autocommand is here to avoid "exponential" reloading if you save several times your configuration.

提交回复
热议问题