Vim Scoops / Lessons / E325: ATTENTION (swap file)

E325: ATTENTION, found a swap file

E325 means Vim found a swap file for this file: either another Vim has it open, or an earlier session crashed. If it's open somewhere else, press Q and go back to that one. If Vim crashed, press R to recover your unsaved work.

The keys

KeysWhat they do
OOpen read-only, just to look
EEdit anyway (risky if it's open elsewhere)
RRecover the unsaved changes from the swap file
DDelete the swap file (only offered if nothing's using it)
Q / AQuit / abort without opening

Vim saves your unsaved changes as you go in a hidden swap file next to the original, like .notes.txt.swp. It's normally deleted when you quit, so if one is left over, something didn't close cleanly.

After R, check the text is what you expect and :w to save it. Then delete the old swap file, or this message comes back next time: reopen the file and press D.

Related

Want all of Vim, in order? Vim Scoops is a free game that starts at h j k l and builds up to macros.

Play the full game