Disabling autosave

I develop with meteor, which is an awesome web framework that supports live hot code pushes - that is, when a file in the project is updated, the meteor server updates the client, live - you don't even have to tell your users to refresh the page. This is awesome for rapid prototyping.

The problem is that with Webstorm's auto-saving, meteor would push changes way too often, frequently causing compile errors on the server side Node.JS, and sometimes breaking the server. I had to find a way to disable autosave. Here's how to do it.

1. In Settings -> IDE Settings -> General,

  • uncheck "Synchronize files on frame activation"
  • uncheck "Save files on frame deactivation"
  • if you can, uncheck "Save files if application is idle for". If it's greyed out, set it to 6442450 seconds (about 74 days). This is the maximum number of seconds that the autosave function can be disabled for, and I have absolutely no idea whatsoever why JetBrains picked this weird number.

Autosave is retarded.png
2. In IDE Settings -> Editor -> Editor tabs, check "Mark modified tabs with asterisk".
Mark modified tabs.png
Hope this helps,
Dan

"In communist Russia, the IDE saves the file for you"

9

My dislike of autosave for meteor work has nothing to do with habits.

It simply breaks code. Please see my original post in this thread.

7
Avatar
Permanently deleted user

This post helped me a lot.

I don't get why some people think that "auto save" is great. If it's that great why don't Visual Studio or Sublime Text follow suit?

Auto saving is nuisance than being helpful. Having worked on PC for decades, my fingers can press Ctrl+S swiftly whenever I want to save. I don't need software doing it for me. Auto saving backfires when I messed up to much and I simply want to reopen the file.

3
Avatar
Permanently deleted user

"Auto save" is great when executed correctly.

  • Correct: Google Docs/Sheets/Slides auto-saves every change instantly and keeps a complete version history including named versions. There are no "files" to speak of here, since this is a cloud-based service.
  • Correct: Microsoft Office auto-saves open documents to an internal disk cache at an interval. The default is every 10 minutes, but this feature is so useful I often change it to the minimum 1 minute interval.
  • Correct: Atom as well as Visual Studio Code auto-save the changed version of the file instantly to an internal disk cache and reloads the changed version as "changed" when restarted. I think they also do save the undo history as well, so you can still undo your changes as normal even after a restart.
  • WRONG: Jetbrains IntelliJ auto-saves directly into the file that is open. This is VERY WRONG because the master file is being modified without consent. Though there's a "local history" this is not very intuitive for first-timers encountering this odd kind of auto-save behavior.

Auto save can be very helpful when done correctly. It's just that the way Jetbrains decided to implement it made it a complete nuisance. It's Jetbrains that needs to follow suit of how other software is doing it right. Clearly there are many ways to skin a cat, and Jetbrains chose the way that make the cat scream the loudest.

You may be one of those peeps who press Ctrl+S ten times every few seconds for no real reason other than to make extra double triple sure the file is saved. Not everyone works like that, a correctly implemented auto-save feature is a boon to those who don't.

3
Avatar
Permanently deleted user

Making assumptions of someone you have never met, eh?

For clarification :

  • I only save when I want to build / compile or when I want to preview my work on browser, which ranges from 1 to 30 minutes.
  • I only press Ctrl+S once.
  • Yes. VS Code's method is fine because it only save 'states' rather than writing to the actual file. I remember Notepad++ does the same thing. Also VS Community has never saved a file without my consent. Good job MS.
3

You could just untick "Save files automatically" instead of entering such big number -- will have the same effect.

In any case --- the autosave you were referring to in other posts is a bit different thing -- it is about automatically saving the file when it is gets closed (when you close the tab or exit the app completely .. or when making changes to the app settings) and not about autosave on time interval or some basic event.

2
Avatar
Permanently deleted user

It appears that IDEA v12 (Ultimate, at least) has introduced a regression in this support.

I had autosave disabled in v11 and it was working the way we want but, ever since I started using v12 (I'm actually on v12.1 at the moment), IDEA appears to totally disregard the settings.  After just a few seconds, IDEA saves the file!
idea_save_settings.gif
IDEA behaves identically whether I have "Save files automatically" checked or not.

Is anyone else seeing this regression in v12?

Thanks,
Seth

2
Avatar
Permanently deleted user

JetBrains does this wrong.

  • IntelliJ saves every edit directly on to the actual file itself. This is quite terrible if:
  • I'm not using a VCS. Just blank a file in the editor and close it. You can say goodbye to whatever was there.
  • Or I have a tool that is set up with a trigger to compile code upon saving changes. The tool would work extra hard unnecessarily and bother me with compile errors while I'm trying to code the next big thing.

Atom does this right.

  • Files are never saved automatically. Instead, all changes are saved in Atom Editor's internal buffer.
  • The entire workspace can be closed and opened any time with all the modifications saved in internal buffer kept and restored. Atom doesn't ask "Would you like to save changes?" when exiting - it just dumps it in the buffer and gets out of your way.
  • You are in full control of saving the changes into the actual file.
2

Strange, the checkbox looked disabled here (grayed out) for some reason, but unchecking it actually worked.

Good to be able to disable that option.

As for saving on exit, the Principle Of Least Surprise suggsts the IDE should ask whether to save the file or not.

1

... maybe because quite a lot of people have some habits influenced by no-auto-save-available software (in this particular case), e.g.

  • editing wrong files (by mistake or on purpose) -- instead of creating new file which is similar to already existing one (via copy .. or new file and then copy-paste) they just editing existing file with idea of using "Save As" later or just cancel/undo all changes on close.
  • quickly testing/checking something in real/working code (instead of using separate file)
  • etc


You have to keep in mind that when almost all software will give you an option/warning you in such cases, such different approach (auto save) is definitely goes against already established routine (not every person is quick to adopt to the changes, whatever it may be (good or bad changes, forced or voluntarily etc) -- some people will fight to the end because in their mind the original approach is the only correct one) -- you can see it everywhere in real life not just in software only.

Habits is such a thing that requires some time in order to be changed, to get used to the new workflow/functionality/routine. I also was making such mistakes when I just started using PhpStorm .. but after few weeks -- no regrets -- it feels very natural now (I extremely rarely need to undo something after save (maybe once in a month or two), and Local History is the right tool in my situation).

1
Avatar
Permanently deleted user

IntelliJ is like Nvidia. I would instantly buy a nvidia card if they would support Freesync. I would buy and use IntelliJ if this stupid auto save feature could be disabled completely.

It makes absolutley no sense to force people to use this.

1

Hi Seth,

1) What kind of files are getting auto saved? All of them .. or specific (currently edited) files only?

2) What plugins do you have installed? I mean -- do you use Live Edit and/or File Watchers plugins?

0
Avatar
Permanently deleted user

Hi Andriy.  Thanks for replying.

1) Every file that I edit and change in IDEA is getting autosaved.  .sql files, .java files, ... all types.

2) I don't have either of those plugins installed; in fact, every plugin that I have installed is listed as "Bundled."

0

Well .. I'm not IDEA user ( PhpStorm only ), so I do not know what plugins are actually bundled. But those 2 are official JetBrains plugins (File Watcher is bundled with PhpStorm/WebStorm while Live Edit only with WebStorm)

My suggestion is (if you do not mind checking this out, actually):

  1. Backup and delete (or just rename) all IDEA config/cache folders: http://devnet.jetbrains.com/docs/DOC-181
  2. Launch IDE -- it will recreate all defaults
  3. Do the basic (very minimal) configuration and try to work on your files -- see if it will behave the same or will it be any different.
  4. You can always restore your current settings from backups


Other than that -- no other real ideas from me right now.

0
Avatar
Permanently deleted user

Here's what I did:

  1. Renamed my C:\Users\seilbott\.IntelliJIdea12\system\caches directory
  2. Started IDEA
  3. Checked the configuration and saw that the settings that I showed above were still in effect.
  4. Played around with the settings, especially the "Save files automatically" values and checked state, to no avail.


I really appreciate the suggestion; however, it unfortunately does not seem to have made a difference.

(Now... I actually only just noticed from your reply that I was posting in the "PhpStorm / WebStorm" area of this community.  I guess I should I look in the "IntelliJ IDEA" area, instead? )

0

You should have renamed this folder C:\Users\seilbott\.IntelliJIdea12  instead. Right now you just got rid of caches only but the actual settings were left as is.

Now... I actually only just noticed from your reply that I was posting in the "PhpStorm / WebStorm" area of this community.  I guess I should I look in the "IntelliJ IDEA" area, instead? )

May help :D. But since they all share the same codebase, I would expect similar behaviour as well.

0
Avatar
Permanently deleted user

Bazzik wrote:

You should have renamed this folder C:\Users\seilbott\.IntelliJIdea12  instead. Right now you just got rid of caches only but the actual settings were left as is.

Now... I actually only just noticed from your reply that I was posting in the "PhpStorm / WebStorm" area of this community.  I guess I should I look in the "IntelliJ IDEA" area, instead? )

May help :D. But since they all share the same codebase, I would expect similar behaviour as well.


Ohhh....  ?:|  I definitely misinterpreted the scope of what you meant.  I did what you really said and renamed the .InelliJIdea12 folder, went through the setup and all and... still no joy.  IDEA was misbehaving just as before.

BUT, one of my coworkers sent me this:

One of the new features of version 12 is an auto-build compiler somewhat like eclipse has.

I wonder if the "Make project automatically" also forces the file saves, so I turned that off. My quick test didn't get an autosave.

I just turned this off as well... and now IDEA is behaving again!

idea_compiler_settings.gif

0

Mystery solved. Case closed. Lesson learned (IDEA is not PhpStorm and may behavse differently as it has other/more/different features).

0
Avatar
Permanently deleted user

Use Local History which is active even if you aren't using version control. 

0
Avatar
Permanently deleted user

Well it's fun, isn't it?

Thanks for the clarifications.

0

FWIW, I (and the rest of the team) spent about 40% of my work time on Meteor in PhpStorm (current version) and this has never been a problem: apparently actual disk writes only happen if one presses ^S (or ⌘S when I'm on macOS), or some time interval elapses. 

Admittedly it takes some time to unlearn pressing ^S after each typed word, but it's actually convenient, and this never broke a build for us.

0
Avatar
Permanently deleted user

I just reset the editor (RubyMine) to defaults because I thought introduced this behavior. I agree, it is pretty unbelievable to not allow autosaving to be turned off. I guess I found something I don't like about RubyMine.

0

Absolutely stupid idea to change master file on disk by saving it with every key stroke without asking for permission.

0

Hrvoje Lončar: what are you talking about? IntelliJ doesn't do that. Here are the autosave settings as of WebStorm 2024.2.1:

Autosave is useful in many cases, but has unwanted consequences in others - namely when external processes watch files for changes and take actions you're not ready for them to take, such as recompiling when there are syntax errors still, or restarting servers when you haven't finished looking at the log output yet.

JetBrains has made this feature optional. Case closed.

0
Avatar
Permanently deleted user

The autosave feature of Jetbrains' IDE's are among my favorite features about them. The autosave feature is unobtrusive and intuitive I simply don't have to worry about it. In the 9 years I have been using IntelliJ I have never had it save a file when I wish it hadn't. Why wouldn't you want changes to be saved?

-11

请先登录再写评论。