63
votes

Some code editors, such as WebStorm, have an option to auto-save when the editor loses focus. I've searched for an option like this in the Atom Editor but haven't found anything yet.

Does the Atom Editor have a setting that allows for auto-save of edited files when it loses focus? If so, where can this be set? If not, how would one go about writing a plug-in that does that?

7

7 Answers

74
votes

Yes there is auto save package. You can enable autosave in package settings.

enter image description here

20
votes
20
votes

Just add this to your ~/.atom/config.cson

autosave:
  enabled: true
6
votes

There's also the save-session plugin which makes Atom behave more like Sublime: the current state of each file is remembered across application instances. This is slightly different than the original request, but also extremely useful.

3
votes

It's late answer, but In case someone needs it. auto save package save something when a it's lose focus or get close. If you want auto save right after every type, You can install autosave-on-change by ChexWarrior. Check this link. It will auto save right after every type. You can install it from package installer of atom. Hope it helps.

0
votes

It seems that the auto-save feature is now embedded in 1.8.0.

But doesn't always work. See issue here.

In order to use it, enable "Back Up Before Saving" in settings.

enter image description here

0
votes

I had installed the autosave and activated package but it does not work in atom.

I installed the autosave-onchange package, and it works perfect, I recommend it. . . The only difference besides that works well for me, is that you record at all times as soon as you make a change . . .