简体   繁体   English

如何使Eclipse更像Emacs

[英]How to Make Eclipse More Like Emacs

I am very familiar with emacs--and I realize that there is nothing that it cannot do--but there are some things that it does not do well or efficiently. 我对emacs非常熟悉 - 而且我意识到它没有什么是不可能做到的 - 但是有一些东西它不能很好地或有效地完成。 So, being between projects I am open to the idea of switching to a full-featured IDE such as Eclipse. 因此,在项目之间,我愿意转向使用Eclipse等全功能IDE。

With muscle-memory being what it is, I would like to make Eclipse as emacs-like as possible. 随着肌肉记忆的存在,我想让Eclipse尽可能像emacs一样。 I have already discovered the excellent Emacs+ plugin which gets me about halfway there. 我已经发现了优秀的Emacs +插件,它让我大约一半。 However, I am still missing the following features of emacs which I routinely rely upon: 但是,我仍然缺少我经常依赖的emacs的以下功能:

  • shell: It's not just a shell, it's also a buffer. shell:它不仅仅是一个shell,它也是一个缓冲区。

  • occur: Search->File... is close to what I want, but I just want it to search the current file--which might be a text file, a logfile, or a shell buffer, or whatever. 发生:搜索 - >文件...接近我想要的,但我只是想让它搜索当前文件 - 可能是文本文件,日志文件或shell缓冲区,或其他什么。

  • align-regexp: This awesome little command in emacs helps me make files more readable, and alignment helps with keyboard macros. align-regexp:emacs中这个非常棒的小命令可以帮助我使文件更具可读性,并且对齐有助于键盘宏。

What plugins would you recommend to solve these issues? 您会建议使用哪些插件来解决这些问题? Are there any other emacs features you miss in Eclipse or plugins you would recommend? 你有没有在Eclipse或插件中想念的其他emacs功能?

Please, no emacs/vi zealots asking why on Earth I would do such a thing. 拜托,没有emacs / vi狂热者问为什么在地球上我会做这样的事情。

壳视图

  • Ctrl + F is enough to trigger a Search within the current file. Ctrl + F足以在当前文件中触发搜索。 (does not create a new buffer with matched lines) (不会创建匹配行的新缓冲区)
    Only Mark Occurrences is about highlighting occurrences, but that is not as advanced as the Emacs function. 只有Mark Occurrences才会突出显示事件,但这并不像Emacs函数那样先进。

Mark Occurrences

  • Formatter options can emulate " align-regex " function, as described here . 格式化程序选项可以模拟“ align-regex ”功能,如此处所述

Preferences -> Java -> Code Style -> Formatter . Preferences -> Java -> Code Style -> Formatter
Click 'Edit' on the profile (you may need to make a new one since you can't edit the default). 单击配置文件中的“编辑”(您可能需要创建一个新的,因为您无法编辑默认值)。

In the indentation section select ' Align fields with columns '. 在缩进部分中,选择“ Align fields with columns ”。

Then, in your code Ctrl + Shift + F will run that formatter. 然后,在您的代码中, Ctrl + Shift + F将运行该格式化程序。

I can confirm Brian's suggestion (Emacs key-bindings). 我可以确认Brian的建议(Emacs键绑定)。 What I do to resolve this dilemma is to use both Emacs and Eclipse simultaneously. 我解决这个难题的方法是同时使用Emacs和Eclipse。 They are both very good at reporting external changes to files so there is minimal chance of tromping on edits (but it can happen). 他们都非常擅长报告文件的外部更改,因此编辑错误的可能性很小(但可能会发生)。 More to the point, you can leverage the strengths of both tools without having to give up either one. 更重要的是,您可以利用这两种工具的优势而不必放弃任何一种工具。 The combination of using both tools and Eclipse having Emacs key-bindings makes this quite satisfactory for me. 使用这两种工具和Eclipse具有Emacs键绑定的组合使我对此非常满意。

IIRC (It's been a while since I've used eclipse) eclipse has a "use Emacs key-bindings" mode. IIRC(自从我使用eclipse已经有一段时间了)eclipse有一个“使用Emacs键绑定”模式。 I believe that there's also the option to tell eclipse to use emacs as its own editor... 我相信也可以选择告诉eclipse使用emacs作为自己的编辑器......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM