Vim E325: ATTENTION Found a Swap File

Workaround available Linux, macOS, Windows Updated October 21, 2026

Quick answer

A leftover .swp file from a crashed or still-open Vim session. Press R to recover, then delete the swap file, or press D/E if you have no unsaved work.

Most likely fix: Check for another running session first.

Symptoms

Opening a file shows 'E325: ATTENTION Found a swap file by the name .file.swp' with options [O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort.

Why it happens

  • The file is still open in another Vim window or SSH session
  • Vim, the terminal or the SSH connection crashed or was closed without quitting
  • Laptop went to sleep / Wi-Fi dropped while editing

How to fix it

Try these in order — the most common fix is first.

  1. 1. Check for another running session first

    1. Read the 'process ID' line in the warning
    2. If it says '(STILL RUNNING)', switch to that session and save/quit there instead
    3. Press Q to quit without touching anything
  2. 2. Recover unsaved changes

    1. Press R at the prompt (or run vim -r file)
    2. Compare with the saved file using :DiffOrig if available
    3. Save with :w if the recovered version is right
  3. 3. Delete the swap file

    1. After recovering (or if you have nothing to recover), quit Vim
    2. Run rm .file.swp in the file's directory (ls -a to see it)
    3. Or press D at the prompt when it is offered
  4. 4. Open anyway

    1. Press E to edit anyway or O to open read-only
    2. Be careful: two sessions editing the same file can overwrite each other

This guide also covers

  • vim found a swap file
  • e325 attention
  • vim swp file
  • how to delete vim swap file

Still not working?

If Vim keeps failing, you're not alone. See every Vim problem users report or the alternatives people switch to.

Other Vim errors