Skip to content

Recovering edit buffer contents when browser crashes

Ghjuvan Lacambre edited this page Mar 28, 2024 · 2 revisions

When you edit a field with firenvim, it creates a temporary file for nvim to use. That file name is guaranteed unique. So, if your browser (or nvim) crashes after you've entered 100's of lines of text (that long email), you might want to recover what you can. The good news is that nvim is very good about saving data, so that even with a computer crash, you may not have lost much. But the firenvim workflow for recovery is a bit different.

  1. Find the directory for the files firenvim created for the text field. The location of this directory will vary by OS:
    • For Windows, it is in the env:LocalAppData\Temp\firenvim directory.
    • On Linux/Mac, it is in $XDG_RUNTIME_DIR/firenvim or $TMPDIR/firenvim or /tmp/firenvim.
  2. In that directory, find the appropriate file. There will only be files there for active firenvim sessions (or crashed sessions). They all start with the host name of the web page they originate from.
  3. Recover the file in the normal way, then save a copy of the file somewhere else. E.g. :write ~/Downloads/recovered-text.txt will work on most systems
  4. Go back to your browser, and activate firenvim on the same text area where the crash occurred. Likely, the contents will only be as current as when you started the last pre-crash session.
  5. Read in the recovered contents you saved above (e.g. :read ~/Downloads/recovered-text.txt), merge if needed, and continue normally.
Clone this wiki locally