Vim Opening File E325 Attention Error

By closing the console without exiting Vim first, the Vim process got killed, and Vim didn’t have a chance to properly shut down. Vim uses swap files to store the last unpersisted changes to a buffer to avoid data loss in case of a crash; you can read the whole story at :help E325.

In your case, as you’ve consciously closed the console, there probably weren’t any pending changes to your .bash_profile [worth saving]. (But there’s still the swap file!) Therefore, when prompted

  Swap file ".bash_profile.swp" already exists!
  [O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort, (D)elete it:

answer with D to remove the outdated swap file. Alternatively, you can also search for the .bash_profile.swp (by default, it resides in the same directory as the edited file, likely $HOME in your case) and delete it manually. (It’s hidden; use ls -a in Bash, or Windows Explorer.)

In the future, please exit Vim (:qall[!]) before closing the console it runs in, to allow for a clean shutdown.

Leave a Comment