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.

Comments

Popular posts from this blog

Make Samsung DVD-C350 region-free

Update 2: An anonymous commentator has shown me a way to make Region 1 players (such as DVD-H1080R) region-free by first converting it to Region 3, then applying my region-free hack below. For details, click here or look for a comment by an Anonymous user dated 18 April 2011. Update: The instructions in the original post below did not make the DVD player region-free. Instead it only locked it to region 1. Many thanks to Anonymous who posted the first comment on this post, I now have alternate instructions. Note: If you have edited the numbers menu (see original post) , I suggest you return it to the original settings you had backed up. A modified numbers menu may prevent the instructions below from working properly.

Group, Ungroup and Regroup disabled in Word

I was editing a Microsoft Word document which had a collection of shapes and text boxes grouped together. I wanted to modify some of the shapes, and therefore I had to ungroup them. But when I right-click the group and open the Group menu, all three options namely Group, Ungroup and Regroup are completely disabled or grayed out. I couldn’t figure out what’s wrong. This group of objects is perfectly ungroupable, and I can even select objects within the group. However, Microsoft Word 2007 is not letting me ungroup it. I searched the Internet for a solution, but did not find anything very useful. The closest I came across is this statement: “The type of Text Wrapping doesn't make any difference as long as it isn't In Line with Text.” ( Link here ) Anyway, I changed the text wrapping of the group of objects from ‘In line with Text’ to ‘Tight’ and viola! I could now ungroup it and edit it. The document got a bit messed up when I did so, but after I ungrouped, edited and regro