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

本文介绍如何在IntelliJ IDEA中关闭自动保存功能,包括取消默认保存设置及如何手动保存更改。同时,还提供了标记已修改文件的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

关闭自动保存

首先,声明一点,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)命令,就手动保存文件了。

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值