Swap File
Temporary & DownloadsSWP commonly names Vim swap data for recovering unsaved changes, distinct from a simple BAK. Check for another active editing session and preserve both original/swap. Save recovered text separately and compare before overwriting or discarding anything.
- What it is used for
- Recovering in-progress text editing
- What the file contains
- Partial / temporary data
All sections, questions and sources
Content reviewed: · Editor:Kai
Opening steps
Choose your environment or purpose to see its steps.
Menu labels and support vary by app, OS and version. Preserve the original before making changes.
Troubleshooting by symptom
- Existing-swap warning: distinguish active editing from a crash remnant.
- Several candidates: inspect dates, original path and modification status.
- Missing-line markers: retain the original and compare gaps against the intended work.
- ATTENTION warning: inspect another live editing session as well as crash recovery.
- Questionable markers: compare recovery problems/missing sections with source.
- Renamed SWP is not readable text: use Vim recovery.
Vim SWP → separately saved recovered text
- Preserve originals and recover trusted swap data through Vim.
- Write separately, compare changes/gaps and adopt only verified content.
- Save recovered text separately and validate differences/missing content before adopting it.
Recovery is not guaranteed; do not load untrusted swap data merely to inspect it, and distinguish other SWP uses.
Active editing versus crash residue
Warnings can identify source, user, host and process; avoid simultaneous editing while another session remains active.
For crash recovery keep source/swap together and save the result separately rather than deleting it merely to dismiss warnings.
Source for these steps:Vim · recover.txt — Recovery after a crash / Vim · editing.txt — backup files
Verify recovery by comparison
Recovery may be incomplete; compare source, intended edits, line counts and problem markers.
Reopen the verified saved file before deciding candidate retention and keep recovery notes for diagnosis.
Source for these steps:Vim · recover.txt — Recovery after a crash / Vim · editing.txt — backup files
Related-format differences
| Format | Main role | What to check |
|---|---|---|
| SWP | Editing/recovery state | Identify producer/live session |
| BAK | Saved backup | Coverage can differ from unsaved edits |
| Source text | Normal editable file | Compare with recovery |
Handling and security
Vim documents swap recovery as intended for trusted data; avoid experimental recovery of unknown files.
Questions and answers
Is SWP the original text?
It uses recovery structures rather than ordinary plain text.
Should I delete it when warned?
Check active editing and unsaved changes first.
Overwrite immediately after recovery?
Save separately and compare for missing content.
Does deleting SWP resolve the issue?
You may lose unsaved work; identify active editing and recovery needs first.
Is every SWP a Vim swap?
Identify the producer rather than assuming every SWP belongs to Vim.
Format facts: name, steward and MIME type
- Formal name
- Vim swap file; other application uses possible
- Steward / specification
- Vim / producer-dependent
- MIME type
- Depends on the producer or server; an extension alone does not establish a MIME type.
Primary and official sources
- Project documentationrecover.txt — Recovery after a crash
Documents SWP recovery, comparison and limitations.
Vim · Link checked: - Project documentationediting.txt — backup files
Distinguishes backup files from editing swap files.
Vim · Link checked: