Posts Tagged ‘iruby-mode’

imenu for Ruby

Tuesday, April 22nd, 2008

If you use ruby-mode, you need to add

(imenu-add-to-menubar "iRuby")

to your .emacs right now.

This adds a menu to the menubar, titled “iRuby”, which lists all the classes and methods.  When you select one, it jumps to that point in the file. If you are a keyboard junkie, you can run M-x imenu and get keyboard completion on any of these.

The downsides of this are:

  • it doesn’t update automatically: you need to choose the “*Rescan*” menuitem
  • it does only simple regexp-based parsing, nests instead of putting more than 25 items in the menu, and various other slightly-annoying things

I started a project, iruby-mode, to be what I was looking for, but since I figured out a 1-line way to get me 85% or 90% of the way there, I have much less incentive to work on this.