如何配置eclipse运行时自动保存?
我正在寻找一个自动保存文件的 eclipse 配置或插件(这样我就不必使用 Ctrl+S)。 它可以在失去焦点或一段时间内完成。 我想我看到过类似的东西(我知道IDEA有它),但我现在找不到它。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
七年后更新(Eclipse Neon 4.6)
Eclipse 现在有自动保存脏编辑器
原始答案(2009)
OP IAdapter 添加了 在评论中:
...你是对的!
Eclipse 插件 saveDirtyEditor 应该可以满足您的需求。
将
SaveDirtyEditors_1.0.2.jar
复制到插件目录中。您将在 下获得一个新的首选项页面
,允许您每 30 秒(可以更短)在“
myfile.java.snapshot
”下保存脏文件,如“myfile.java
”如果你想)。不过,如果没有额外的插件,Eclipse 本身并不支持该功能。
最接近的可能是:
这样,每次您点击 CTRL+B 来实际构建源代码时,它们都会被保存。
但我意识到这并不完全是您所追求的。
请注意,激活“自动构建”选项后,您的选项不会非常有效...(这会触发太多构建)
同样,如果没有完全实现您正在寻找的内容,您还可以:
注意:IntelliJ IDEA 和 IntelliJ IDEA 之间的区别eclipse 是“保存时编译”功能:
如IDEA FAQ:
但是,使用 Eclipse,“构建保存时”默认情况下处于激活状态,因此缺少该特定功能。
Update seven years later (Eclipse Neon 4.6)
Eclipse now has an Automatic Save of dirty editors
Original answer (2009)
The OP IAdapter added in the comments:
... 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
, 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:
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:
Note: the difference between IntelliJ IDEA and eclipse is the "compile on save" feature:
As mentioned in the IDEA FAQ:
However, with Eclipse, the "build on save" is activated by default, hence the absence of that particular feature.
http://code.google.com/p/eclatosa/
“将所有打开的编辑器保存在停用 Eclipse 窗口时的 Eclipse(如 IntelliJ 中)”
http://code.google.com/p/eclatosa/
"Saves all open editors in eclipse when deactivating the eclipse window (like in IntelliJ)"
无需安装更多插件。
窗口-> 首选项-> 一般-> 工作区
您可以在那里检查:
如果这不起作用,请尝试以下操作:
首选项 -> 运行/调试-> 启动-> 启动前保存脏编辑器
No need to install more plugin.
Window -> Preferences -> General -> Workspace
and there you can check:
If that doesn't work try this:
Preferences -> Run/Debug -> Launching -> Save dirty editors before launching
我很久以前写了一个插件来做到这一点,它似乎仍然有效: http:// www.stateoffflow.com/projects/71/save-me
它会在编辑器失去焦点时保存它。 但是,如果您退出 Eclipse,它不会注意到。
I wrote a plugin a long time ago to do this that still seems to work: http://www.stateofflow.com/projects/71/save-me
It saves the editor when it loses focus. However, if you switch away from eclipse it doesn't notice.
试试这个
Goto Eclipse Preferences > 一般> 编辑> 自动保存
如果不起作用,请尝试此
首选项 -> 运行/调试-> 启动-> 启动前保存脏编辑器
Try this
Goto Eclipse Preferences > General > Editors > Autosave
if it not work then try this
Preferences -> Run/Debug -> Launching -> Save dirty editors before launching