is there an autosave function/plugin for notepad++?

To date, there are two AutoSave plugins available.

To download, click on the Plugins menu and select Plugin Manager (or Plugins Admin). It will pop-up a window with a list of plugins.

  1. Autosave by Franco-stellari — This autosaves files. Option available to configure timing after autosave, or autosave when npp loses focus.

  2. Autosave2 by www.scout-soft.com - This autosaves files by creating copy of the file. This is useful in case you retain previous saves, such as for incremental development.

Select either of the two AutoSave plugin available and click on Install. If the plugins are not listed, use the links above, and save the .dll to npp's plugins folder according to instructions on the sites.

Update:

in the newest version of Notepad++:

  1. save the plugin's .DLL in Notepad++'s plugins\[plugin name] folder,
  2. go SettingsImportImport Plugin(s)... and select the .DLL you just saved,
  3. Restart N++. The plugin should appear in the "Plugins" menu.

UPDATE 2022

For those who look for answear on similar question, I`ll try to give detailed description.

I`m personnaly use integrated backup/autosave for Notepad++ which, I think cover any needs for this functionality and better option can be only files versioning tools like git/hg etc.

So... Go to:
Settings / Preferences / Backup

This will open settings which containe two section:

  1. Session snapshot and periodic backup
  2. Backup on save

First option in first section is Remember current session for next launch:

After enable this, on restart NP++ will be open all session related instances, like opened files, project in projects panel etc, from previous session. But this may did not help if NP++ for some reason was unexpectedly closed(the process freezes, the power supply of the computer is interrupted, etc.) and as result you lost unsaved state of your files.

To partially protect against such an unpleasant accident, you can use the following option: Enable session snapshot and periodic backup:

After enable this, NP++ will after the interval specified in the option Backup in every N seconds, check all open and UNsaved in NP++ files, and save a copy of them with a timestamp in the file name extension(if in Windows explorer display extensions dissabled you can't see timestamp and see only filename wo extension), to the folder specified in the Backup path option.

d:\Temp\ff_stickers.js
d:\SYNCFOLDER\Settings\NP++\backup\ff_stickers.js@2022-04-19_141352

After you save original file, NP++ immediately delete this backup copy.
Also, enabling this option allows you to exit NP++ without saving opened and unsaved files. When you close the NP++, it does not prompt you to save opened and unsaved files, and the next time you open it, it displays them in the same way as before close - marked as unsaved.

Regarding the option Backup path - you cannot change this path, because it depends on where the NP++ configuration files are stored. By default, this is the folder backup in same folder where NP++ itself is located. In my case (on my screen), this path is located in the same place as the configuration files path, specified in the Cloud option:

Which was added to be able to synchronize NP++ settings.


The next options, already in the second section:
None
Simple backup
Verbose backup

With option Simple backup:

while you save original file in NP++, it will add *.bak file with previous saved state, next to the original:

d:\Temp\ff_stickers.js
d:\Temp\ff_stickers.js.bak

This *.bak remains the only one and is replaced on every save of original file.

With option Verbose backup:

while you save original file in NP++, it will add subfolder nppBackup next to the original file, and save there *.bak file with previous saved state.

d:\Temp\ff_stickers.js
d:\Temp\nppBackup\ff_stickers.js.2022-04-19_141952.bak

These files are not replaced when you save the original, and there are remain as many of them as you save the origanal file.

d:\Temp\ff_stickers.js
d:\Temp\nppBackup\ff_stickers.js.2022-04-19_141952.bak
d:\Temp\nppBackup\ff_stickers.js.2022-04-19_142717.bak
d:\Temp\nppBackup\ff_stickers.js.2022-04-19_142718.bak
d:\Temp\nppBackup\ff_stickers.js.2022-04-19_142719.bak
d:\Temp\nppBackup\ff_stickers.js.2022-04-19_142720.bak
d:\Temp\nppBackup\ff_stickers.js.2022-04-19_142721.bak
d:\Temp\nppBackup\ff_stickers.js.2022-04-19_142722.bak
d:\Temp\nppBackup\ff_stickers.js.2022-04-19_142723.bak
d:\Temp\nppBackup\ff_stickers.js.2022-04-19_142732.bak

And last option Directory, allows you to save *.bak files to a directory of your choice(here you can specify an arbitrary path).

d:\Temp\ff_stickers.js
d:\taravasya\BackUps\NPpp\ff_stickers.js.2022-04-19_143305.bak

Hope it help to use this great app and will save someone a lot of time and nerves))


You can find a Notepad++ plugin called AutoSave for autosaving your files here: https://github.com/francostellari/NppPlugins/tree/main/AutoSave

(Used to link to https://sites.google.com/site/fstellari/nppplugins but that's no longer online, cached version is still available here)

It autosaves every minute, but it's configurable, and allows you to choose to save only the current document or all open documents.


From Notepad++ 6.6 or later there are in core and don't need any plugin.
Via menu => Settings => Preferences => Backup => Enable session snapshot and periodic backup