如果我在崩溃后重新启动 vim,它会告诉我我的文件有一个交换文件,并询问我该怎么做——仍然打开、恢复文件、退出、中止等。有时它会给我删除交换文件的选项,这通常是我需要的选项。然而,其他时候,出于某种原因,它不给我这个选项。这是为什么?我怎样才能让 vim 允许我从 vim 中删除交换文件?(因为手动删除它很麻烦。)
答案1
从:help swap-exists
:
D Delete the swap file. Use this when you are sure you no longer need it.
For example, when it doesn't contain changes, or when the file itself is
newer than the swap file.
On Unix this choice is only offered when the process that created the
swap file does not appear to be running.
因此听起来 Vim 似乎以某种方式相信另一个 Vim 进程仍在该文件上积极运行。