Sun
31
Dec '06
Tab-completion and syntax-highlighting for irb
by Frank Spychalski filed under Ruby
wirble shell example on dark background
wirble shell example on light background

Please forgive me if I state the obvious, but I just found out about this great gem called Wirble. Wirble adds tab-completion and syntax-highlighting to irb.

Installation is really simple, just install the gem (gem install wirble) and add this to your .irbrc:

require 'rubygems'
require 'wirble'

Wirble.init
Wirble.colorize

For a console with a dark background everything looks pretty good but I prefer a light background where yellow is not easy to read. Thanks to the really helpful README the solution was easy to find. I had to add a few more lines to my .irbrc to change some settings from yellow and white to something readable in my console.

require 'rubygems'
require 'wirble'

Wirble.init
Wirble.colorize

colors = Wirble::Colorize.colors.merge({
  :object_class => :purple,
  :symbol => :purple,
  :symbol_prefix => :purple
})
Wirble::Colorize.colors = colors


3 Responses to “Tab-completion and syntax-highlighting for irb”

  1. 1

    Actually, I had no idea that gem existed, and it’s a pretty nice little one too. Thanks!

    Anthony Eden (December 31st, 2006 at 14:17)
  2. 2

    Would be cool if you’d find something like that for groovy ;-) Hope you enjoy your work at gameforge. Uh, yes, and a happy new year!

    Daniel Cloutier (January 5th, 2007 at 14:15)
  3. 3

    Thanks; especially for the screenshots! This is useful for a Ruby newbie like me :-)

    Prakash Murthy (August 5th, 2010 at 09:36)

Any comments? Or questions? Just leave a Reply:

Bad Behavior has blocked 582 access attempts in the last 7 days.