如何禁止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.