Eclipse IDE 中的 Emacs 键绑定
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2849899/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Emacs key binding in Eclipse IDE
提问by Peter Delaney
I am an Emacs lover probably because I love the key binding and I am able to do things very quickly. I also use Eclipse IDE for my Java/Android/Python/ development because it is free, most of my peers use it, and it works. I find myself switching between emacs and Eclipse and the workflow just isn't great. What I would like to do is setup the key bindings in Eclipse so that they are like Emacs.
我是 Emacs 爱好者,可能是因为我喜欢键绑定,而且我能够很快地做事。我也将 Eclipse IDE 用于我的 Java/Android/Python/ 开发,因为它是免费的,我的大多数同行都使用它,并且它可以工作。我发现自己在 emacs 和 Eclipse 之间切换,工作流程并不好。我想做的是在 Eclipse 中设置键绑定,以便它们像 Emacs 一样。
Can someone suggest the best Eclipse plugin I could use for this. Or can anyone talk about how they've used Eclipse to be more Emacs like. Thanks in advance
有人可以建议我可以使用的最好的 Eclipse 插件。或者任何人都可以谈论他们如何使用 Eclipse 来更像 Emacs。提前致谢
采纳答案by Douglas
I have to second the recommendation of Emacs+. I've been using and lovingEmacs since the dawn of time and the key bindings and functionality of Emacs are hard-wired into my fingers and brain by now. Before Emacs+ came along, I found Eclipse to be a complete bear to use, as years of muscle memory and knowing how to get things done without even thinking about it, were not only useless in Eclipse, but in fact detrimental.
我必须支持 Emacs+ 的推荐。我从一开始就一直在使用和喜爱Emacs,现在 Emacs 的键绑定和功能已经深入我的手指和大脑。在 Emacs+ 出现之前,我发现 Eclipse 是一个完全可以使用的熊,因为多年的肌肉记忆和知道如何在不考虑它的情况下完成工作,不仅在 Eclipse 中没有用,而且实际上是有害的。
Emacs+ has fixed all of this for me. Now using Eclipse is nearly as seamless as using Emacs, plus I get all the features of a modern IDE. It's practically the best of all worlds. The only thing I still really miss from Emacs is M-q filling of "//" comments.
Emacs+ 已经为我解决了所有这些问题。现在使用 Eclipse 几乎与使用 Emacs 一样无缝,而且我获得了现代 IDE 的所有功能。它几乎是所有世界中最好的。我仍然真正想念 Emacs 的唯一一件事是 Mq 填充“//”注释。
I should also point out that this is far more than a simple set of key-bindings. It faithfully reproduces a lot of subtle Emacs behavior that you take for granted, until it's not there.
我还应该指出,这不仅仅是一组简单的键绑定。它忠实地再现了许多您认为理所当然的微妙 Emacs 行为,直到它不存在为止。
回答by aioobe
No plugin needed for basic Emacs keybindings!
基本的 Emacs 键绑定不需要插件!
Go to
去
Windows → Preferences → General → Keys
Windows → 首选项 → 常规 → 键
and select Emacsscheme.
It won't provide allEmacs commands (obviously) but it covers the things you can't live without such as navigation, selection, cutting / pasting etc.
并选择Emacs方案。
它不会提供所有的Emacs 命令(显然),但它涵盖了你离不开的东西,比如导航、选择、剪切/粘贴等。
回答by Christopher Barber
First try turning on the Emacs key bindings in your key preferences. If that doesn't give you all that you need, then you might try installing the Emacs+plugin. Of course, if you have any elisp customizations, I think you might be out-of-luck.
首先尝试在您的按键首选项中打开 Emacs 按键绑定。如果这不能满足您的所有需求,那么您可以尝试安装Emacs+插件。当然,如果您有任何 elisp 自定义,我认为您可能会不走运。
Personally, I always prefer to just learn editor-centric way to do things so that I am not helpless when I sit at someone else's computer.
就我个人而言,我总是喜欢只学习以编辑为中心的做事方式,这样当我坐在别人的电脑前时,我不会束手无策。
回答by Allen
回答by Matt J.
I enabled the Emacs key 'scheme' as @aioobe suggested a long time ago in all my copies of Eclipse. However, recently, a new form of perverse behavior popped up in some of my Eclipse installations: I type any one of several Emacs commands, such as Ctrl-L(to center the window), and this annoying dialog box pops up, offering me the correct Emacs action for that key and another option, which comes from nothing I recognize, but is certainly NOT an Emacs key binding.
正如@aioobe 很久以前在我所有的 Eclipse 副本中所建议的那样,我启用了 Emacs 密钥“方案”。然而,最近,在我的一些 Eclipse 安装中出现了一种新形式的反常行为:我键入几个 Emacs 命令中的任何一个,例如Ctrl- L(使窗口居中),然后弹出这个烦人的对话框,为我提供正确的该键和另一个选项的 Emacs 操作,它来自我不认识的任何东西,但肯定不是 Emacs 键绑定。
This is problematic for two reasons 1) it pops up out of the blue, in some but not all projects (I haven't figured out a pattern yet) 2) it is obviously a violation of the promised support of an Emacs key scheme, a violation that only emerged recently, making the Emacs support far less valuable.
这是有问题的,原因有两个:1)它突然出现在一些但不是所有项目中(我还没有想出一个模式)2)它显然违反了对 Emacs 密钥方案的承诺支持,最近才出现的违规行为,使 Emacs 支持的价值大大降低。
Emacs support in Eclipse was never very complete, but I would like to get back to the state I had a few months ago, when Ctrl-L, Ctrl-Dand Ctrl-Kall worked correctly as Emacs keys w/o this annoying dialog in all projects.
Eclipse 中的 Emacs 支持从来都不是很完整,但我想回到几个月前的状态,当时Ctrl- L、Ctrl-D和Ctrl-K在所有项目中都可以作为 Emacs 键正常工作,而没有这个烦人的对话框。
If Emacs+ worked in Indigo and Juno, I would try that. But as it is...
如果 Emacs+ 在 Indigo 和 Juno 中工作,我会尝试。但正如它...