Wirble: Tab-Completion and Syntax Coloring for irb
If you haven't got tab-completion and syntax coloring in your irb, you owe it to yourself to follow these instructions right away (should work for Linux, OS X, and Cygwin users). First, install the Wirble gem:
sudo gem install -y wirble
Next, create or edit a file called .irbrc in your home folder (~/.irbrc), and make sure these lines are included there:
require 'rubygems' require 'wirble' Wirble.init Wirble.colorize
Now play with irb and see joy similar to that in the screenshot above. Try tab-completion too. It's great!
December 18, 2006 at 3:32 am
Awesome!
December 18, 2006 at 6:56 am
nice. however it doesn't colorize pp
December 18, 2006 at 5:20 pm
Nice tip! I'm rolling with it on my system now. A bit difficult to read some of the darker colors on an inverted shell (white on black), especially when you add transparency to it, but I'll manage to deal :)
December 18, 2006 at 5:53 pm
Anyone know if its possible to control the way it colors the syntax?
December 18, 2006 at 5:57 pm
Upon further investigation, I found you can change the way Wirble colorizes. Its right in there doc:
http://pablotron.org/software/wirble/README
December 20, 2006 at 9:08 pm
Very nice!
I added a default rule and colour for unidentified characters because at the moment the brackets '(' ')' are not displayed by wirble.
164d163
:light_blue,
:light_blue,
---
> :comma => :blue,
> :refers => :blue,
326,327c325,326
:light_blue,
:light_blue,
---
> :object_addr_prefix => :blue,
> :object_line_prefix => :blue,
344d342
:green
December 20, 2006 at 9:11 pm
The diff in my posting got screwed up. I put my modified version based on wirble-0.1.2 here:
http://www.wedesoft.demon.co.uk/wirble.rb
December 30, 2006 at 12:14 pm
This is great! helps a lot the work with irb!
January 2, 2007 at 3:54 pm
You can also add 'irb/completion'
My .ircrb looks like
---BEGIN-FILE---
require 'irb/completion'
require 'rubygems'
require 'wirble'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
Wirble.init
Wirble.colorize
---END-FILE---