加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

如何阻止Vim创建* -e文件

发布时间:2020-12-15 20:57:18 所属栏目:安全 来源:网络整理
导读:最近我的Vim一直乱丢我的文件夹,额外的文件以-e结尾.例如,如果我正在编辑一个名为test.php的文件,有时候(但并非总是如此!)我将结束另一个名为test.php-e的文件. 我不知道是什么导致了这个,但它相当烦人.据我所知,我最近没有改变任何事情.备份文件都在我的?/
最近我的Vim一直乱丢我的文件夹,额外的文件以-e结尾.例如,如果我正在编辑一个名为test.php的文件,有时候(但并非总是如此!)我将结束另一个名为test.php-e的文件.

我不知道是什么导致了这个,但它相当烦人.据我所知,我最近没有改变任何事情.备份文件都在我的?/ .vim / backups目录中,所以我不确定这些东西来自哪里.思考?

解决方法

set nobackup

或者将备份目录设置为/ tmp和不时清除.

来自VIM docs(:help nobackup)

'backup' 'bk'       boolean (default off)
            global
            {not in Vi}
    Make a backup before overwriting a file.  Leave it around after the
    file has been successfully written.  If you do not want to keep the
    backup file,but you do want a backup while the file is being
    written,reset this option and set the 'writebackup' option (this is
    the default).  If you do not want a backup file at all reset both
    options (use this if your file system is almost full).  See the
    |backup-table| for more explanations.
    When the 'backupskip' pattern matches,a backup is not made anyway.
    When 'patchmode' is set,the backup may be renamed to become the
    oldest version of a file.
    NOTE: This option is reset when 'compatible' is set.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读