是否可以在不重新启动的情况下应用 vim 配置? [英] Is it possible to apply vim configurations without restarting?

查看:47
本文介绍了是否可以在不重新启动的情况下应用 vim 配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从 Vim 编辑 .vimrc 文件并应用它们而无需重新启动 Vim.

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

推荐答案

是的,只需在编辑 .vimrc 时使用 :so % 命令.

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

如果你想让 vim 自动重新加载你的配置,你必须添加以下命令:

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.

这篇关于是否可以在不重新启动的情况下应用 vim 配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆