Show the name of the current swap file
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2Show the name of the current swap file.
Buffer
- File
/demo/notes.txt- swapfile
on
Vim messages
Empty
Command entered · ready to apply
Buffer
- File
/demo/notes.txt- swapfile
on
Vim messages
Empty
Displays this buffer's swap-file path; it neither flushes the text nor recovers a file.
Buffer
- File
/demo/notes.txt- swapfile
on
Vim messages
/demo/.notes.txt.swp
Before & after
Before
Buffer
- File
/demo/notes.txt- swapfile
on
Vim messages
Empty
After
Buffer
- File
/demo/notes.txt- swapfile
on
Vim messages
/demo/.notes.txt.swp
Subject: :swapname. Documentation-backed illustration; assumes swapfile enabled and this named file has exactly the displayed swap path; not replay-verified. Displays this buffer's swap-file path; it neither flushes the text nor recovers a file.
notes
Cursor on line 1, column 1Details & Vim help
Show the name of the current swap file. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. The index spelling :sw[apname] puts the optional abbreviation suffix in square brackets; those brackets are not typed. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.