防止PhpStorm在关闭时自动保存文件 [英] Prevent PhpStorm from automatically saving files on close

查看:358
本文介绍了防止PhpStorm在关闭时自动保存文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在PhpStorm中关闭文件时,它会自动保存文件. 如何更改它,问我是否要在关闭前保存文件?"

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?"

推荐答案

无法完全禁用自动保存,但是您可以

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.

@Owen下面的答案不正确,因为无法完全关闭IDE中的自动保存.

The answer below from @Owen is not correct, since there is no way to completely turn off automatic save in the IDE.

自动保存是核心设计功能,我们认为它比手动保存更加有效和高效.无法通过引用常见问题解答(WebStorm基于IntelliJ IDEA平台,因此同样适用):

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):

因为IntelliJ IDEA可以更改这么多文件 同时在大型重构操作中进行更改,而无需 每次打开它们时,保存单个文件都没有多大意义.在 认识到这一点,IntelliJ IDEA保留保存任何内容的权利. 随时随地从文件中删除文件.其实挺不错的 一旦获得,就不必担心文件的保存状态 习惯了.

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.

如果我不喜欢所做的某些更改并且想要 滚回去吗?",我听到你说.嗯,对于那个IntelliJ IDEA 包括称为 本地历史 . 每次保存文件时,IntelliJ IDEA实际上都会保存 您文件的先前状态,并保存该文件.你可以 查看文件的整个编辑历史记录(返回一些 可配置的天数),查看所做的更改并滚动 支持任何更改.它胜利地统治着,并远远超过了弥补 缺少单文件保存导致暂时的迷失方向.

"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.

此功能已经在IntelliJ IDEA中使用了十年了,现在甚至Apple都意识到它比手动保存要好,并且

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.

这篇关于防止PhpStorm在关闭时自动保存文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆