Skip to main content

Disable auto save in JetBrains IDE software (IntelliJ IDEA, PyCharm, PhpStorm)

JetBrains provides the following IDE software:
  • IntelliJ IDEA
  • PhpStorm
  • PyCharm
  • RubyMine
  • WebStorm
  • AppCode
  • CLion
Google also provides Android Studio which is powered by the IntelliJ platform.

If you come from a different IDE such as Eclipse, you will be unpleasantly surprised to find that JetBrains-branded IDEs automatically save everything the moment you look away. The proponents argue that as you work on your project, you should not have to worry about saving files. But to others, this auto-save behavior which is enabled by default is a curse that catches them by surprise, and a shocking departure from the workflow they are very much used to.

You can change the behavior by altering some settings.
After the change:
  • Modifications are no longer automatically saved when you're just editing.
  • They are saved when you press Ctrl+S.
  • They are saved when you build, compile or run.
  • Refactoring that affect files that are not open are still automatically saved without opening those files.

But first, some caveats:
  • There is no Save for individual tabs. The shortcut Ctrl+S is for "Save All" which will save all modified tabs/files. Be careful and remember this.
  • The "modified" indicator on the tab is slightly different. Instead of something obvious like a real asterisk next to the file name or a color change, the indicator is a subtle asterisk image that appears on top of the file icon (in the tab bar). You may have to look a bit longer at the tab to notice it.
  • Closing a tab with a modified file will not ask you whether to save or discard the changes. Instead the file is maintained in "Local History" in a modified state. When you open the file again, your changes (along with undo-redo history) are retrieved from the Local History. The actual file itself is not saved with your modifications.
  • There is no option to revert changes to the state of file on disk in the IDE user interface.
    • You can force a revert quickly by touching the file (or simply editing it insignificantly in an external editor and saving it) and then switching to the IDE. It will prompt how to resolve the conflict, on which you can select "Load File System Changes".
    • You can also undo your edits until the asterisk disappears, or revert to an older revision in VCS > Local History. (Note that "File > Synchronize" option acts similar to "Save All" and is not a way to revert.)
How to disable auto-save:
  1. Go to File > Settings (Ctrl+Alt+S).
  2. Go to Appearance & Behavior > System Settings.
  3. Make sure the two are unchecked:
    • Save files on frame deactivation
    • Save files automatically if application is idle for x sec.
  4. Go to Editor > General > Editor Tabs
  5. Put a checkmark on "Mark modified files with asterisk"
  6. (Optional but recommended) Under "Tab Closing Policy", select "Close non-modified files first". You may also want to increase the number of allowed tabs.
  7. Click Apply > OK.
That's it.

JetBrains IDEs are built around the idea that workflows should be centered around a VCS (version control system) where files are logical abstractions of changes, and that VCS should not be an afterthought as it is in the kind of workflows we are used to in other IDEs and programs - manually saving changes to a file in disk, then separately committing changes to VCS. Thus the IDEs come with instant auto-save and a built-in VCS called "Local History".

However, many of us are not used to this kind of behavior and would want to retain our workflows centered around manually saving edits to a file in disk. Though unfortunately JetBrains IDEs don't allow us to truly revert to such a workflow (see caveats), at least we can come close with the above setting changes.


Popular posts from this blog

Setting up a local Oracle XE database and importing DMP file

The experience of setting up a local Oracle Express Edition database is not a straight-forward as it should be. The following is supposed to outline what could go wrong and how to go about it the right way. It also includes importing a DMP file (a dump) from another system.
First of all, download the installer from Oracle website. You will need to sign-in to download - the account creation is free. Be sure to choose the correct bit as per your computer (x64 or x86).Extract the download and install XE by running DISK1\setup.exe (and feel nostalgic of the floppy disk era). During installation, you will need to choose a new password. There will also be some details displayed after you enter the new password, such as folders and ports.Be sure to save both password and details in a text file for future reference.I saved it as C:\oraclexe\details.txt.Save password only if it's generic and you are likely to forget. The installation will take a while, but usually, no restart is necessary.O…

Stop having to click Unblock on every downloaded file

CAUTION: The blocking of downloaded files in Windows is a security and safety feature to help prevent your computer from being infected by viruses and other malware. Only disable this feature if you know what you're doing.

I had been plagued by this annoyance since the days of Windows Vista. Any downloaded file, no matter what browser I use, gets tagged as "blocked" by Windows. You can open downloaded documents even though they are blocked, but when you run a downloaded application (such as a setup file) you're presented with a "Security Warning" before you're allowed to run it. It's worse if you extract a downloaded ZIP file with the Windows' built-in ZIP management. Every extracted file is blocked by default.

Being a geek who finds unnecessary "security" prompts annoying, the first thing I do in Windows is to disable the User Account Control (UAC). But I couldn't quite figure out how to disable blocking of downloaded files until …