Prevent PhpStorm from automatically saving files on close

前端 未结 2 959
终归单人心
终归单人心 2020-12-11 00:41

When I close a file in PhpStorm, it saves the file automatically. How can I change it to ask me \"Do you want do save the file before closing?\"

相关标签:
2条回答
  • 2020-12-11 00:44

    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.

    0 讨论(0)
  • 2020-12-11 00:48

    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

    0 讨论(0)
提交回复
热议问题