How create autosave in komodo editor

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

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
2 Likes

After having to use PHPStorm for a client project I really got used to the auto save. Thanks for this little script it works great. I do prefer Komodo. Its a great tool for me.

Thanks for this sir, it only takes 3 seconds to auto save