在 vim 中禁用交换文件创建 [英] Disabling swap files creation in vim

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

问题描述

有没有办法在 vim 中禁用 .swp 文件创建?或者至少将它们全部创建在一个地方,以便我可以轻松找到和删除它们.

当我在编辑的同时复制父目录时,我发现它们特别烦人.当然我知道我可以使用 find -exec 来查找和删除它们.但我想要一个更实用的解决方案.

解决方案

要在 vim 中禁用交换文件,请键入

:set noswapfile

要永久禁用交换文件,请将以下内容添加到您的 ~/.vimrc 文件

设置 noswapfile

有关详细信息,请参阅 Vim 文档关于交换文件

Is there a way to disable .swp files creation in vim? or at least create them all in one place so I can find and delete them easily.

I find them especially annoying when I copy the parent directory while editing at the same time. Of course I know that I can use find -exec to find and delete them. But I want a more practical solution.

解决方案

To disable swap files from within vim, type

:set noswapfile

To disable swap files permanently, add the below to your ~/.vimrc file

set noswapfile

For more details see the Vim docs on swapfile

这篇关于在 vim 中禁用交换文件创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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