1. vim执行过程
此图包含
vim正常执行过程
vim故障常见原因
vim发生故障时候流程图
需要上传图1
2. 故障产生原因
1.同时打开1个文件
2.之前的文件没有正常保存退出 导致的
E325: ATTENTION
Found a swap file by the name "/tmp/.sds.txt.swp"
owned by: root dated: Mon Apr 8 11:47:56 2019
file name: /tmp/sds.txt
modified: YES
user name: root host name: oldboyedu59
process ID: 8012
While opening file "/tmp/sds.txt"
dated: Mon Apr 8 11:36:21 2019
(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 /tmp/sds.txt"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/tmp/.sds.txt.swp"
to avoid this message.
Swap file "/tmp/.sds.txt.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
3. 解决方案
方案1 删除这个临时文件(推荐)
错误提示中 有这个文件的名字。
方案2 把临时文件的内容恢复(不推荐)
4. 故障重现
echo oldboyedu.com >/tmp/oldboy.txt
vim /tmp/oldboy.txt
断开连接然后重新连接。
[root@oldboyedu59 ~]# vim -r /tmp/oldboy.txt
oldboyedu.com
guoav.com
guoav.com
guoav.com
guoav.com
guoav.com
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"/tmp/oldboy.txt" 6L, 64C written
[root@oldboyedu59 ~]#
[root@oldboyedu59 ~]# cat /tmp/oldboy.txt
oldboyedu.com
guoav.com
guoav.com
guoav.com
guoav.com
guoav.com
[root@oldboyedu59 ~]# rm -f /tmp/.oldboy.txt.swp
[root@oldboyedu59 ~]# vim /tmp/oldboy.txt
oldboyedu.com
guoav.com
guoav.com
guoav.com
guoav.com
guoav.com
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
[root@oldboyedu59 ~]#
作者:老男孩教育_李导
链接:https://www.jianshu.com/p/075fee704e76
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。