Hacker News new | past | comments | ask | show | jobs | submit login
Eclim - bringing Eclipse functionality to the Vim editor (eclim.org)
43 points by stralep on Nov 6, 2011 | hide | past | favorite | 12 comments



Many IDE features aren't necessary in Emacs and Vim, both of which have incredible generic text-manipulation capabilities.

Want to add setters/getters to a Java class? Use YASnippet or SnipMate. Want to rename the local variable foo to bar? Use a scoped regex. Once you grok the power of generic text-manipulation, you can use it everywhere and in ways that IDE users can't imagine. (See http://steve-yegge.blogspot.com/2006/06/shiny-and-new-emacs-... )

Two caveats:

1. Scoped regexes, like C-M-h in Emacs, require a proper parser, which is what IDEs are all about. But I prefer starting with a text-oriented editor and tacking on AST-aware IDE features, than the opposite.

2. Emacs and Vim have poor support for renaming class methods across files. (Possible solutions are XRefactory for Emacs and Mozilla Pork for Vim.)


Yes, many features aren't necessary. But where an IDE really wins out is it's ability to understand context.

Code hinting on a method call to an object....no problem. Your IDE knows what object the method returns, so it will give you a list of methods/variables that are applicable.

Realized your method is starting to get a bit long, just refactor a part of the code that seems like it is its own entity. Your IDE will handle all the variables needed and even tell you that other parts of your code can be refactored to call the same method.

Wrote something that broke something? No problem, right click that piece of code and choose revert.

Can't be arsed to write a makefile...neither can I...cause there is a button for that.

Hmmm...here is a weird problem...I wonder how my code is actually working right here? Oh yeah...use the built in debugger.

This method call throws some stupid exception...really? Are you sure? Ok then...alt+enter - surround with try catch.

Let's just make a quick constructor for that...ctrl-n, select variables, done (and yes, I would like to make a call to super :)


What really kills me with vim/emacs is that if I want to search for users of a struct field (e.g: named "count") on a large code-base, there's really no practical way of going about it.


Vim and Emacs are first and foremost text editors, and they're really, really good at that. Each can do a small bit of passable project management.

IDEs are project managers [1], and they're really, really good at that. They generally have passable editors.

IDEs are built with enough project management to satisfy the immediate needs of 80% of developers, and more can be added through plugins, if you or someone else have built the plugin. That probably gets you to 95% or so of developers' project management needs.

Vim, Emacs and other power editors are built with very few project management tools relative to an IDE (Emacs maybe more than others), but can use plugins. But Vim and Emacs exist within or close to the command line, and from there you have a wealth of almost infinitely composable text and file query and manipulation tools.

For example, relative to your complaint, both editors have significant levels of integration with or implemenation of ctags or its descendants: https://en.wikipedia.org/wiki/Ctags

"Ctags is a program that generates an index (or tag) file of names found in source and header files of various programming languages. Depending on the language, functions, variables, class members, macros and so on may be indexed. These tags allow definitions to be quickly and easily located by a text editor or other utility. Alternatively, there is also an output mode that generates a cross reference file, listing information about various names found in a set of language files in human-readable form."

This may not be as out-of-the-box convenient as specifically targeted, belled and whistled IDE implementations of the same functionality, but they are there, they're flexible, and they can be used with or without an editor.

The fundamental difference is excellent project management plus "other," or excellent text manipulation plus "other." I suppose as each side gains more functionality from the other, expectations rise, but it's probably best to remember what each is best at.

[1] By project management I mean from a developer's point of view. How to get at and understand all the code, project-wide.


As far as I know, none of ctags, etags, or cscope can handle searching for a specific struct member. For example, you cannot find all uses of the Linux kernel's scsi_device's "vendor" field without getting a whole lot of other uses of the field "vendor" of other structs as noise.


Semantic/CEDET is now part of Emacs and does a little bit of that job. I haven't explored the all the features beyond the smart "find tag" (semantic-ia-jump) in C++ feature, though, so I don't know if it may meet your expectations.


CEDET seems really promising, thanks! Will try it soon...


"""Want to add setters/getters to a Java class? Use YASnippet or SnipMate. Want to rename the local variable foo to bar? Use a scoped regex. Once you grok the power of generic text-manipulation, you can use it everywhere and in ways that IDE users can't imagine."""

Yes, but in a medium-large codebase (and I'd argue in a small one too) generic text manipulation is useless for refactoring compared to proper syntax and context aware manipulation.


I tried Eclim a couple times, but didn't like it. Currently I use Vrapper and am content to have the basic motions and marks. I've also heard good things about Viable.

http://vrapper.sourceforge.net/home/ http://viableplugin.com/


Having tried Eclim, I honestly prefer the opposite approach of embedding a ViM editor inside the IDE. NiceOneBrah mentioned vrapper and viable. I prefer viPlugin (viplugin.com).

Netbeans and Intellij also both have excellent ViM plugins. These days I spend my time in Visual Studio, and it too has a couple of free and commercial plugins to choose from.


For those that didn't read through the entire linked page, there is also an Eclim client for Emacs under active development (https://github.com/senny/emacs-eclim). I don't know that it's quite as feature-rich as the Vim version, and it's certainly less well-documented, but it does add some nifty IDE features to Emacs without forcing you to do your development inside Eclipse itself.


For your Emacs users out there who end up using/needing Eclipse on a daily basis, Emacs+ actually does a remarkable job of giving you a lot of the immediate wins of Emacs with the immediate wins of Eclipse. For larger codebases, this makes me incredibly productive. On small projects, I still live in Emacs when possible.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: