因为vim编辑文档未保存。再次编辑同一个文件时出现报错的解决

因为vim编辑文档未保存。再次编辑同一个文件时出现报错的解决
因为vim编辑文档保存。再次编辑同一个文件时出现报错的解决

E325: ATTENTION
Found a swap file by the name ".oldboy.txt.swp"
owned by: root dated: Sun Dec 23 22:41:46 2018
file name: /oldboy/oldboy.txt
modified: YES
user name: root host name: oldboyedu01-nb
process ID: 8244 (still running)
While opening file "oldboy.txt"
dated: Sun Dec 23 22:47:55 2018
NEWER than swap file!

(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r oldboy.txt"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".oldboy.txt.swp"
to avoid this message.

Swap file ".oldboy.txt.swp" already exists!

解决方法

  1. 删除以上报错信息最后一行提示的".oldboy.txt.swp"
    命令:rm -f .oldboy.txt.swp
    注意:如果自定义了alias。
    命令则是:m -f .oldboy.txt.swp

  2. 重新编辑:vim oldboy.txt下的内容
  3. esc后:wq 保存。

免责声明:本网信息来自于互联网,目的在于传递更多信息,并不代表本网赞同其观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,并请自行核实相关内容。本站不承担此类作品侵权行为的直接责任及连带责任。如若本网有任何内容侵犯您的权益,请及时联系我们,本站将会在24小时内处理完毕。
相关文章
返回顶部