Mac下如何解决vim ~/.bash_profile 报错 E325: ATTENTION Found a swap file by the name ".bash_profile.swp"

当你 输入vim ~/.bash_profile设置立即生效时候会报这个错误

这个是没有关系:

  • 这是由于在编辑该文件的时候异常退出了,因为vim在编辑文件时会创建一个交换文件swap file以保证文件的安全性。

解决办法:

  • 输入 q(退出)
  • 然后在终端出入:rm -f ~/.bash_profile.swp
  • 最后你在终端输入 vim ~/.bash_profile  就可以了
原文地址:https://www.cnblogs.com/chenyablog/p/14498769.html