Open recovery mode for a specific file.

Section: Recovery and swap workflows

Recover from a swap file

bash
bash
vim -r file.txt
nvim -r file.txt
Explanation

Useful after crashes or interrupted sessions.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Recovery and swap workflows
List recoverable swap files
Show swap files that can be recovered.
OpenIn sheetbashsame section
Write recovered contents elsewhere
Save a recovered buffer to a safe path first.
OpenIn sheetvimsame section
Open a file from shell
Start the editor on a file path.
OpenIn sheetbash1 tag match
Start in diff mode
Open two files side by side for comparison.
OpenIn sheetbash1 tag match
Open file at a specific line
Jump directly to a target line on startup.
OpenIn sheetbash1 tag match
Jump between diff hunks
Move to the next or previous change region.
OpenIn sheetvim1 tag match