如何配置eclipse在运行时自动保存? [英] How to configure eclipse to autosave on run?

查看:329
本文介绍了如何配置eclipse在运行时自动保存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

解决方案

更新七年以后(Eclipse Neon 4.6)








原始答案(2009)



OP IAdapter 添加了在评论


我打赌的插件就像我描述的存在一样。


...你是对的!



Eclipse插件 saveDirtyEditor 应该做你所做的需要。

在您的插件目录中复制 SaveDirtyEditors_1.0.2.jar



你会得到

 一般>编辑者>文本编辑器>保存肮脏的编辑器

,允许您保存肮脏的文件,如' myfile.java '在$ code> myfile.java.snapshot '每30秒(如果你想要的话可​​以更少)。






尽管如此,Eclipse不支持本机的功能。



最接近的可能是:

 窗口>首选项>键入build
>一般>工作区> [x]在构建之前自动保存

这样,每次您点击 CTRL + B 为实际建立您的来源,他们将被保存。

但是我意识到这不是您正在你以后。

请注意,您的选项不会非常有效,自动构建选项已激活...(将触发太多构建)



再次,没有实现您正在寻找什么,您还可以:

 运行/调试>启动>在启动
之前保存所需的脏编辑器运行/调试>启动> [x]启动之前构建(如果需要)






注意:IntelliJ IDEA和eclipse之间的区别是编译保存功能:



IDEA FAQ


问:

可以在IntelliJ IDEA中启用编译保存吗?



IntelliJ IDEA目前不支持此功能。

但是有一个 Eclipse-mode 插件,提供类似的功能,所以我们建议您尝试这个插件。

请注意,默认情况下,IntelliJ IDEA为您保存文件,因此您不必像以前那样频繁地按Ctrl + S快捷方式需要在其他IDE中执行。


但是,使用Eclipse,默认情况下会激活build on save,因此缺少该功能。


I'm looking for a configuration or plugin for eclipse that automatically saves files (so I don't have to use Ctrl+S). It could do it on lost focus or over some period of time. I think I saw something like that (I know IDEA has it), but I cant find it now.

解决方案

Update seven years later (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, ...).


Original answer (2009)

The OP IAdapter added in the comments:

I bet plugin like I describe exists.

... and you are right!

Eclipse plugin saveDirtyEditor should do just what you need.
Copy the SaveDirtyEditors_1.0.2.jar in your plugin directory.

You will get a new preference page under

General > Editors > Text Editors > Save Dirty Editors

, allowing you to save dirty files like 'myfile.java' under 'myfile.java.snapshot' every 30 seconds (can be less if you want).


Without additional plugin, though, Eclipse does not support natively that feature.

The closest could be:

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

That way, each time you hit CTRL+B for actually building your sources, they would be saved.
But I realize this is not exactly what you are after.
Beware your option would not be very efficient with the "build automatically" option activated... (that would trigger too much builds)

Again, without achieving exactly what you are looking for, you also have:

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


Note: the difference between IntelliJ IDEA and eclipse is the "compile on save" feature:

As mentioned in the 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.

However, with Eclipse, the "build on save" is activated by default, hence the absence of that particular feature.

这篇关于如何配置eclipse在运行时自动保存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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