如何禁止vim在windows中生成临时文件
- 禁止vim生成备份文件
在 .vimrc中加入以下内容:
set nobackup
这样可以禁止生成带 ~ 的文件。当然,如果禁用后,vim自动备份的功能就失效了.
- 禁止.swp文件
在.vimrc中加入以下内容:
set noswapfile
The swap file is created when you have a file open, and provides some backup/recovery security, in case Vim crashes while editing a file. It also can prevent multiple Vims from editing the same file. I usually just turn this off too, because I rarely have a use for it. The .swp file isn’t as annoying as the ~ file, because it goes away when you close Vim, but I still just turn that feature off.
本文介绍如何在Vim编辑器中禁用生成备份文件和交换文件。通过在.vimrc配置文件中设置setnobackup和setnoswapfile选项,可以避免创建带有~后缀的备份文件和.swp交换文件。
202

被折叠的 条评论
为什么被折叠?



