4

使用 vi 我开始编辑一个 html 文件,但我不小心退出了会话,现在当我再次尝试编辑该文件时,我收到此消息:

E325:注意在打开文件“myfile.html”时发现名为“.myfile.swp”的交换文件日期:2012 年 7 月 3 日星期二 09:55:39

(1) 另一个程序可能正在编辑同一文件。如果是这种情况,请注意在进行更改时不要以同一文件的两个不同实例结束。退出,或谨慎继续。

(2) 此文件的编辑会话崩溃。如果是这种情况,请使用 ":recover" 或 "vim -r myfile.html" 来恢复更改(参见 ":help recovery")。如果您已经这样做了,请删除交换文件“.myfile.html.swp”以避免出现此消息。

交换文件“.myfile.html.swp”已经存在!

myfile.html 是否发生任何损坏?

我认为正在发生的是它在我退出会话(交换文件)时存储打开文件的副本?

4

1 回答 1

6

From the Vim documentation:

Vim stores the things you changed in a swap file. Using the original file you started from plus the swap file you can mostly recover your work.

The documentation also describes the recovery procedure in case you need it.

于 2012-07-03T15:00:02.363 回答