FAQ Desk: Autosaving "unnamed" `new 1` files

  • Hello, and welcome to the FAQ Desk. You have likely been directed to this page because you asked a question about autosaving “unnamed” files (which show up as new 1 and similar).

    The autosave feature for the “new #” tabs (and any other file that’s not saved) is found in Settings > Preferences > Backup.

    (Image Credit: @Scott-Sumner in “Forgetful Notepad” thread)

    If you enable ☑ Remember current session... and ☑ Enable session snapshot..., then even if you forget to hit save, it will make a backup; on your next load of Notepad++, the “unsaved” file will still be in the same state as it was before you closed Notepad++.

    If something happens, and Notepad++ doesn’t load your previous session after it’s made the session-snapshot of unsaved files, you might find it in %AppData%\Notepad++\backup\ (often c:\users\user.name\AppData\Roaming\Notepad++\backup\ on modern Windows, but see “FAQ Desk: What is %AppData%” for more details)

    HOWEVER: it is your responsibility to make sure files are properly saved and backed up. This feature is meant to temporarily protect you from forgetting to hit save; this is not intended as a long term solution for storing your critical data in “unnamed” files. Crashes can cause data loss. Relying on autosave of an unnamed file for critical data is a good way to set yourself up for a problem. Please, save the file to a named location, save early, save often, and backup.

    If you turn off ☐ Enable session snapshot..., then if you try to close Notepad++ with a file with unsaved changes (whether it’s a named file, or one of the unnamed “new #” files), Notepad++ will prompt you to save changes (Yes), lose your changes (No), or stop closing Notepad++ (Cancel). I personally find this a much safer situation: that way, named files are saved where you expect them to be, and all files must have a meaningful name. (Quick, when you’ve got “new 1” through “new 27” open, which file did you put your note about the project that your boss wants you to work on next week? Will you still remember that next week? Whereas, if it’s named “boss-priorities.txt”, it’s easily identifiable in the future.)