whatfileis.pro
Paste a filename and find out what it is, whether it is safe, and what opens it.

Vim E325: ATTENTION — What the Swap File Error Means

<code>E325: ATTENTION</code> means Vim found an existing <code>.swp</code> swap file for the document you're opening — left by a crash or a second open session. It's a safety warning, not corruption. If the prompt says a process ID is 'still running', another Vim really has the file open — quit that one. Otherwise press <strong>(R)ecover</strong> to get unsaved edits, then delete the swap. Details below.

Category
Safe to delete?
Opens with

What E325 is telling you

Vim writes a .swp while you edit and deletes it on a clean exit. When it starts and finds a leftover swap, it raises E325: ATTENTION and shows the swap's details — the owning host, the modified time, and whether the process is still running. Two very different situations trigger it:

  • 'process ID ... still running' — another Vim/Neovim genuinely has this file open. Don't recover; switch to that session (or close it) instead.
  • No running process — an edit session crashed and the swap is stale. This is the normal case; recover from it.

What to do, step by step

  1. Read the prompt. If it says the process is still running, press q to quit and find the other Vim.
  2. If it crashed, press r to recover. Vim rebuilds the buffer from the swap.
  3. Save to a new name so you don't overwrite the original: :saveas file.recovered.
  4. Compare: :diffsplit originalfile shows exactly what the swap held.
  5. Delete the swap so the warning stops: quit Vim and run rm .file.swp (hidden dotfile — ls -a), or press d at the prompt.

Stop E325 coming back

The warning repeats because the stale swap was never removed. Delete it as above. If swaps on scratch files annoy you, disable them with :set noswapfile (session) or set noswapfile in .vimrc (global) — at the cost of crash recovery for those files. To keep swaps but out of your working dirs, set a central folder: set directory=~/.vim/swap//.

FAQ

What does E325: ATTENTION mean in Vim?

Vim found an existing .swp swap file for the file you're opening, left by a crash or a second edit session. It's a safety warning, not a corrupted file. Recover from it if a session crashed, or switch to the other Vim if the prompt says a process is still running.

How do I get rid of the E325 swap file warning?

Recover anything you need first (press r, save to a new name, compare with :diffsplit), then delete the swap: quit Vim and run rm .yourfile.swp (it's a hidden dotfile), or press d at the prompt. The warning stops once the swap is gone.

E325 says the process ID is still running — what now?

Another Vim or Neovim really has the file open. Don't recover — press q to quit, find and close that other session, then reopen the file. Recovering while a live session holds it can clobber your work.

Other file types explained