Vim Swap Files Not Deleting

纵然是瞬间 提交于 2019-12-11 11:42:08

问题


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?

Thanks!


回答1:


You can capture a full log of a Vim session with vim -V20vimlog. After quitting Vim, examine the vimlog log file for suspect messages. I could imagine that even though Vim is able to create the swap files, it is somehow not able to delete them.




回答2:


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!



来源:https://stackoverflow.com/questions/28901886/vim-swap-files-not-deleting

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!