进行一定数量的更改时自动保存

发布于 2024-12-13 05:35:10 字数 151 浏览 4 评论 0原文

是否可以在 .vimrc 中设置,每次我更改(插入、删除、修改)一定数量的字符(不是在时间间隔之后)时,vim 都会保存文件。

我有一个坏习惯,每次进行一些小编辑时都会按 :w,我想改掉这个坏习惯。

谢谢

Is it possible to set in .vimrc that vim saves the file every time I will change (insert, delete, modify) certain number of characters (not after time interval).

I have a bad habit to press :w every time I make some small edit and I'd like to get rid of this bad habit.

thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

好多鱼好多余 2024-12-20 05:35:10

一般来说,在实际完成编辑或需要一些外部程序才能查看文件的当前状态之前,您不必使用 Vim 保存。 Vim 定期(根据时间和变化量)保存 交换文件< /a> 用于您正在编辑的缓冲区。因此,如果 Vim 或您的计算机崩溃并且您尚未保存,您仍然可以

In general, you don't have to save with Vim until you're actually done editing or need some external program to be able to see the current state of the file. Vim periodically (both based on time and how much has changed) saves a swap file for the buffer you're editing. So, if Vim or your computer crashes and you haven't saved, you'll still be able to recover a relatively recent version of your file by restoring from the swap file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文