tags:

views:

180

answers:

3

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. So, being between projects I am open to the idea of switching to a full-featured IDE such as Eclipse.

With muscle-memory being what it is, I would like to make Eclipse as emacs-like as possible. I have already discovered the excellent Emacs+ plugin which gets me about halfway there. However, I am still missing the following features of emacs which I routinely rely upon:

  • shell: It's not just a shell, it's also a buffer.

  • 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.

  • align-regexp: This awesome little command in emacs helps me make files more readable, and alignment helps with keyboard macros.

What plugins would you recommend to solve these issues? Are there any other emacs features you miss in Eclipse or plugins you would recommend?

Please, no emacs/vi zealots asking why on Earth I would do such a thing.

+2  A: 

alt text

  • Ctrl+F is enough to trigger a Search within the current file. (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.

alt text

  • Formatter options can emulate "align-regex" function, as described here.

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'.

Then, in your code Ctrl+Shift+F will run that formatter.

VonC
He said he checked out Emacs+ already
BlueRaja - Danny Pflughoeft
@BlueRaja: right, I missed that part. I edited Emacs+ out.
VonC
Ctrl-F is not the same as emacs occur. Occur creates a new buffer containing all of those lines that contain the regular expression. This has myriad uses over search.
Brian
I've never had the need for a full regex search, but in Eclipse if you highlight a word, it will highlight all occurances of that word in the current file, and give you a list of dots to click on the right of the source screen. In addition, if you highlight a variable, method-name, or class-name and *right-click* --> *Find usages* it will show you all usages of **that very variable** / method / class, not just a simple text-match, in all files.
BlueRaja - Danny Pflughoeft
@BlueRaja: do not forget that you can highlight the return value of the method itself, and it will show all of the exit-points of the method!
VonC
Occur and search are not the same. Parsing a 1.5GB logfile from a simulation result is a frequent use-case that search does not handle.
Brian
@Brian: agreed. not the same by a long shot. I only mentioned the one instance of "occurrence" in Eclipse I know about, but this is not what you need.
VonC
@Brian: IDEs are not really meant for parsing 1.5gb logfiles - **that** is where text-editors like emacs shine.
BlueRaja - Danny Pflughoeft
A: 

IIRC (It's been a while since I've used eclipse) eclipse has a "use Emacs key-bindings" mode. I believe that there's also the option to tell eclipse to use emacs as its own editor...

Brian Postow
+1  A: 

I can confirm Brian's suggestion (Emacs key-bindings). What I do to resolve this dilemma is to use both Emacs and Eclipse simultaneously. 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.

pajato0