vim - 没有删除选项来删除 .bash_profile.swp
问题描述
我正在编辑一个 .bash_profile 文件,然后我不小心关闭了 bash 控制台。从那时起,每当我尝试使用 vim 打开 .bash_profile 时,都会收到 E325: Attention 错误。
我遇到了一个与此类似的问题,并且有一个答案,据说在给出的选项中选择 (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:
有没有其他方法可以解决这个问题?
解决方案
删除选项显示在较新版本的 vim 中,但即使较新版本有时也不会显示该选项。我不知道它在什么条件下显示。
我认为\rm ~/.bash_profile.swp
是这里最好的方式
推荐阅读
- mysql - MySQL远程时缓存如何工作?
- pass-by-reference - 为什么按值传递有时比按引用传递更好
- user-interface - 为 ubuntu 服务器 18.04.3 安装 GUI
- python-3.x - 如何根据两个以上的列条件在 pandas 中创建一列?
- javascript - 为什么 redux dispatch 在钩子值更新之前发生?
- javascript - 如何在 UI 线程和 service worker 之间共享 WebAssemly 模块?
- c# - 如果程序第一次在 C# 中运行,则显示一个消息框
- php - 将所有值传递给一个变量,然后拆分它们
- laravel - 如何使用 JWT 令牌使忘记密码更安全?
- haskell - GHCI 无法加载“System.Time”的接口