How create autosave in komodo editor


#1

I don’t talk about the auto-backup but the real autosave that just saves your files progressively when your write new code.


#2

This feature doesn’t exist but you could easily write a user script that saves your file periodically. The follow code will save your file ever 5 seconds after your last key press.

var _ = require("contrib/underscore");

var debounce_saveMyFile = _.debounce(
    () =>{require("ko/views").current().koDoc.save(true);},
    2000
);
//window.removeEventListener("editor_text_modified", debounce_saveMyFile);
window.addEventListener("editor_text_modified", debounce_saveMyFile, false);

When creating the Userscript make sure you set it’s Trigger property to “On Startup”. If you manually run it you need to uncomment that second to last line.

  • Carey