When I close a file in PhpStorm, it开发者_C百科 saves the file automatically. How can I change it to ask me "Do you want do save the file before closing?"
Autosave settings are under File | Settings | General.
http://www.jetbrains.com/phpstorm/webhelp/saving-and-reverting-changes.html
While autosaving is handy for local, non-vital projects, this can be disastrous in a live project, where every change needs to be checked first.
Update: In recent versions, they have been moved to File | Settings | Appearance and Behavior | System Settings | Synchronization
There is no way to disable automatic save completely, but you can partially control this behavior:
Note that those are optional autosave triggers, and you cannot turn off autosave completely.
The answer below from @Owen is not correct, since there is no way to completely turn off automatic save in the IDE.
Automatic save is the core design feature, we believe that it's much more efficient and productive than manual save. There is no way to disable this behavior or enable any confirmations, quoting the FAQ (WebStorm is based on IntelliJ IDEA platform, so the same applies):
Because IntelliJ IDEA has the ability to change so many files simultaneously in large refactoring actions, and change them without ever opening them, single file saves don't make very much sense. In recognition of this, IntelliJ IDEA reserves the right to save any of your files literally whenever it wishes. It's actually quite nice to never have to worry about your file's save statuses, once you get used to it.
"What if I don't like some changes I made, and want to roll them back?", I hear you say. Well, for that IntelliJ IDEA includes this amazing feature called the Local History. Every time it saves your files, IntelliJ IDEA actually saves a diff of your file from it's previous state, and saves that as well. You can see the entire edit history of your files (going back some configurable number of days), see the changes you've made, and roll back any change. It rules triumphantly, and more than makes up for the temporary disorientation caused by lack of single-file save.
This feature has been in IntelliJ IDEA for a decade, and now even Apple has recognized that it's better than manual saving and implemented it in Mac OS Lion.
Just my two cents to a similar issue:
I had PhpStorm seemingly auto-save on every keypress, which was making my live reload go mad. Turns out, I had checked Recompile on changes
under Settings -> Languages & Frameworks -> TypeScript
.
Hope this can help someone.
精彩评论