Windows 上的 GVIM:禁用 tmp 文件创建的方法 [英] GVIM on windows: way to disable the tmp file creation

查看:32
本文介绍了Windows 上的 GVIM:禁用 tmp 文件创建的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 上使用 gvim,我想知道一种禁用临时文件(以 ~ 结尾)文件创建的方法.如果我们这样做也有问题吗?

I use gvim on windows and I want to know a way to disable the temp file(ending in ~) file creation. Also is there a problem if we do it?

推荐答案

您可以通过将此行放在 .vimrc 中来禁用备份文件:

You can disable the backup file by putting this line in your .vimrc:

set nobackup

我几乎总是这样做,因为 ~ 文件更烦人,有用.这样做没有问题,您只会失去恢复到文件备份的能力.

I almost always do this, as the ~ file is more annoying that useful. There is no problem with doing this, you'll just lose the ability to revert to a backup of the file.

如果你也想摆脱临时 .swp(交换)文件,你也可以这样设置:

If you want to get rid of the temporary .swp (swap) file too, you can also set this:

set noswapfile

交换文件在您打开文件时创建,并提供一些备份/恢复安全性,以防 Vim 在编辑文件时崩溃.它还可以防止多个 Vim 编辑同一个文件.我通常也会关闭它,因为我很少使用它..swp 文件不像 ~ 文件那么烦人,因为当您关闭 Vim 时它会消失,但我仍然只是关闭了该功能.

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.

这篇关于Windows 上的 GVIM:禁用 tmp 文件创建的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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