Vim交换文件未删除 [英] Vim Swap Files Not Deleting
问题描述
退出时,Vim不会删除.swp文件.我在iTerm(macvim)中使用vim,并使用:q
或:wq
或:qa
退出.我的交换文件似乎仍然存在.我不得不在我的.gitignore上添加*.swp *.swo *.swn
,这至少可以说是令人沮丧的,而且我敢肯定,这使我的客户和同事感到困惑.他们正在用不必要的文件填充我的计算机.当然,每次打开文件时,我都必须通过交换文件存在"警告.
Vim is not deleting .swp files when I quit. I am using vim in iTerm (macvim) and quitting with :q
or :wq
or :qa
. My swap files seem to be sticking around. I have had to ad *.swp *.swo *.swn
to my .gitignore which is becoming frustrating to say the least and I'm sure it's confusing my clients and coworkers. They are filling my computer with needless files. And of course I have to step through the "Swap file exists" warning every time I open a file.
我希望交换文件在退出时删除.失败了,我想找到一种自动清除它们的方法.
I'd like swap files to delete on quit. Failing that I'd like to find some way to clean them up automatically.
我可以使用哪些方法来诊断/解决此问题?
What are my options for diagnosing/solving this problem?
谢谢!
推荐答案
我在Linux机器上遇到了相同的问题.
由于某种原因,在特定目录下编辑文件后,vim并未删除.swp文件. vimlog
没有提供有用的信息.
但是,删除~/.viminfo
可以解决问题!
I came across the same problem (on a linux machine).
For some reason, after editing files in a specific directory vim didn't delete the .swp files. The vimlog
provided no useful information.
However, deleting ~/.viminfo
fixed it!
这篇关于Vim交换文件未删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!