您的当前位置:首页正文

intellij 关闭自动保存和标志修改文件为星号

来源:花图问答

关闭自动保存

首先,声明一点,intellij 默认是不自动编译的 ,这一点跟Eclipse不同。

By default, IntelliJ IDEA doesn't automatically compile projects on saving. 

另外,我们会发现intellij默认会自动保存,并且修改了文件也没有星号标注。
去掉默认保存,
File—>settings—->System Settings—>去掉勾选synchronize files on frame or editor tab activation和去掉勾选save files on frame deactivation


image.png

以上步骤,在网上比比皆是,但是解释这两个选项意思的却很少,这里解释一下,通俗的来讲

synchronize files on frame or editor tab activation,就是当前应用是intellij时,自动保存文件,比如从浏览器切换到intellij,intellij就是active,会自动保存。

save files on frame deactivation,就是从intellij切换到其他应用时,保存文件。

image.png

When does IntelliJ IDEA auto save changed files?
Autosave is initiated by:

  • Compiling a project, a module or a class
  • Starting a run/debug configuration-
  • Performing a version control operation such as pull, commit, push, etc.-
  • Closing a file in the editor
  • Closing a project
  • Quitting the IDE
    In fact, there is a lot more autosave triggers, and only the most important ones are mentioned above.

标志修改文件为星号

File—->Settings—–>Editor—->General—->Editor tabs—->勾选 mark modified files as asterisk


image.png

保存全部

配置了以上两步后,在使用保存全部(ctrl+s)命令,就手动保存文件了。