eclipse - 如何配置eclipse运行时自动保存?

标签 eclipse plugins intellij-idea autosave

我正在寻找一个自动保存文件的 Eclipse 配置或插件(这样我就不必使用 Ctrl+S)。它可以在失去焦点或一段时间内完成。我想我看到过类似的东西(我知道 IDEA 有它),但我现在找不到它。

最佳答案

七年后更新(Eclipse Neon 4.6)

Eclipse now has an Automatic Save of dirty editors

The autosave option is disabled by default.
A new autosave preference page (Preferences > General > Editors > Autosave) is available and allows to enable/disable the autosave and change the interval of autosave.
The countdown is reset on keyboard activity, mouse click, or when a popup is displayed (e.g. content assist, preference page, ...).

https://www.eclipse.org/eclipse/news/4.6/images/autosave-preference-page.png

<小时/>

原始答案(2009)

OP IAdapter添加in the comments :

I bet plugin like I describe exists.

...你是对的!

Eclipse 插件 saveDirtyEditor应该做你需要的。
SaveDirtyEditors_1.0.2.jar 复制到您的插件目录中。

您将在下面看到一个新的偏好设置页面

General > Editors > Text Editors > Save Dirty Editors

,允许您每 30 秒(如果您愿意,可以更少)在“myfile.java.snapshot”下保存诸如“myfile.java”之类的脏文件。

<小时/>

不过,如果没有额外的插件,Eclipse 本身并不支持该功能。

最接近的可能是:

Window > Preferences > type "build"
  > General > Workspace > [x] Save automatically before build

这样,每次您点击 CTRL+B 来实际构建源代码时,它们都会被保存。
但我意识到这并不是您所追求的。
请注意,激活“自动构建”选项后,您的选项不会非常有效...(这会触发过多的构建)

同样,在没有完全实现您所寻求的目标的情况下,您还可以:

Run/Debug > Launching > Save required dirty editors before launching
Run/Debug > Launching > [x] Build (if required) before launching
<小时/>

注意:IntelliJ IDEA 和 eclipse 之间的区别在于“保存时编译”功能:

IDEA FAQ 中所述:

Q:
Can I enable "compile on save" in IntelliJ IDEA?

IntelliJ IDEA currently doesn't support this feature.
However there is an "Eclipse-mode" plug-in which provides similar functionality, so we suggest you to try this plug-in.
Note that by default IntelliJ IDEA saves the files for you, so you don't have to press the Ctrl+S shortcut frequently like you need to do in other IDEs.

但是,对于 Eclipse,默认情况下会激活“保存时构建”,因此缺少该特定功能。

关于eclipse - 如何配置eclipse运行时自动保存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1142547/

相关文章:

java - 运行 Eclipse 插件

安卓工作室插件 : Adding icon near SDK manager

java - IntelliJ 14 Idea在项目构建时不刷新资源包

android - Android Studio 中编辑器折叠和区域注释的区别

java - 检索组件类型数组时发生类型未加载错误

android - 我怎样才能让背景的方向在屏幕旋转时保持纵向前夕

eclipse - org.osgi.service.application.ApplicationException : No application id has been found

java - 智能 GWT 应用程序不显示任何内容,因为找不到 nocache.js 文件错误

eclipse - 在 SWT 插件中打包 GDAL JAVA 绑定(bind)和 native 库

java - 将方法标记为已弃用而不更改其源代码