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 
这里写图片描述

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

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

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

这里参考官方解释 
这里写图片描述

注意,并不是说,做了以下两点就关闭了自动保存。还有其它条件能触发保存,比如编译、关闭intellij、启动中间件服务器(tomcat、jetty)等,官方参考

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 
这里写图片描述

保存全部

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

猜你喜欢

转载自blog.csdn.net/tiantangdizhibuxiang/article/details/81277382