@LazyOne's answer pertains to an earlier version of PhpStorm. In PhpStorm 8.0 there are two checkboxes to provide more granular control over your file synchronization settings:
- In PhpStorm, open the Settings / Preferences Dialog by choosing Preferences from the menu or clicking ⌘ Comma (Mac) or Ctrl+Alt+S (Linux and Windows).
- Click Appearance & Behavior, then click System Settings.
- Under Synchronization, there are two checkboxes: the first is labelled Synchronize files on frame activation and the second is labelled Save files on frame deactivation
Here is what the checkboxes do:
- Checking the first box will detect and reload external files from the disk when you switch to PhpStorm from another application.
- Checking the second box will have all modified files saved every time you switch to another application from PhpStorm.
- If you uncheck both boxes, PhpStorm provids a simple prompt says "File was changed on disk" with a link to reload them in PhpStorm.
When there is conflict between PhpStorm and the file that changes on the disk, you will be asked to choose what to do:
- Load Changes: Click this button to load the file version produced
outside of PhpStorm, and overwrite your local changes.
- Keep Memory Changes: Click this button to preserve the version produced in PhpStorm and stored in cache.
- Show Difference Click this button to invoke the differences viewer that shows the version in the file system to the left, and PhpStorm version to the right.
More details can be found in the PhpStorm documentation pages for System Settings and the File Cache Conflict pages.