我正在编辑.bash_profile文件,然后我不小心关闭了bash控制台。从那时起每当我尝试使用vim打开.bash_profile时,我都会收到E325:注意错误。
我经历了一个与此类似的问题,并且有一个答案,据说在给出的选项中选择(D)elete。但我没有看到这个选项。
While opening file "/Users/hareentej22/.bash_profile"
dated: Fri May 18 02:20:07 2018
(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 /Users/hareentej22/.bash_prof
ile"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/Users/hareentej22/.bash_prof
ile.swp"
to avoid this message.
Swap file "~/.bash_profile.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:
还有其他方法可以解决这个问题吗?
答案 0 :(得分:4)
删除选项显示在较新版本的vim中,但即使是较新版本,有时也不会显示该选项。我不知道它在什么条件下表现出来。
我认为\rm ~/.bash_profile.swp
是最好的方式