eclipse

Eclim: Bringing New Life to the Eclipse User / Vim Fanatic

I've fallen in love with Eclim this week. I spend most of my work day in the Java world and that generally means a lot of time spent in Eclipse. I run Vim on the side for all my XML and JSP work but Eclipse just offers too much power for Java development to ignore, despite the fact that I don't like actually using it to write text. And it's not that I think it's particularly bad at text editing, it's just plain, whereas Vim is flat out amazing at it.

I've seen a few attempted solutions for combining the best of both worlds and even tried Eclim a few months back, but it just wasn't working after installation and I didn't feel like spending the time to debug. I tried again this week however and it worked with little hassle, since then I've spent maybe 5 minutes a day in Eclipse itself.

The installer can be a little flaky, I had to run a second time but it then worked no problem, possibly because I had eclipse running during the first attempt. This installs an Eclipse plugin and then a Vim plugin. (probably a very good idea to backup your existing Vim config although I haven't noticed any problems)

Once installed you fire up a standalone server on the command line which exposes various Eclipse functionality to other editors and programs. The Vim plugin then talks to this and adapts the functionality for Vim using it's built-in intelligent auto-completion and compile error code.

To be honest I use (and wanted) about two features from Eclipse, compile on the fly, and auto-completion. Fortunately these are two of the features exposed by Eclim and they work very nicely. Every time you save a buffer that's part of a Eclipse Java project you'll get colored arrows on the left hand side of your buffer indicating lines with compile errors or warnings. The delay is very small.

C-X C-U brings up the intelligent auto-completion dialog, also works very well, although I use the normal unintelligent text auto-completion (C-N and C-P) a little bit more as they're faster.

This is pretty much all I needed to get myself free from Eclipse and I'm drastically more productive writing code in Vim. Vim's tabs and buffers and commands kick Eclipse's ass all over town. Best of all when you need to do something complex (refactoring especially comes to mind) you can fire up Eclipse for the specific task and then shut it back down. Your system's memory will thank you.

IMO these Eclim guys really did come up with a great idea for this, expose the Eclipse functionality and let other editors make use of it. For some strange reason using Vim makes my days a little more enjoyable so I'm particularly grateful for their work. I'd actually love to contribute some to the project if I can run across some feature ideas down the road.

Bravo Eclim devs.

Replacing Eclipse With Vim For Java Development

I undertook a little experiment today to see if I could be as productive coding Java in Vim as I am in Eclipse. Eclipse is great in it's own right, and for the last few years I've just assumed that the features it offers were worth editing outside Vim. I love being able to auto-complete, auto-import, refactor across an entire project, and run unit tests in a nice graphical interface. I can't stop missing the things Vim excels at however, namely the overall text editing and managing buffers/windows/tabs.

I came across this post recently and got to wondering how much of Eclipse's feature set (that I actually use, which barely scratches the surface) I could emulate with Vim. His tips got me to this ~/.vimrc, and I'm going to use this page to add-on more tips as I discover them.

autocmd BufRead *.java set makeprg=ant\ -f\ /home/dgoodwin/src/trunk/eng/satellite/java/build.xml
autocmd BufRead *.java set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#

abbr sysout System.out.println

Syndicate content