Tab completion in irb

October 7, 2006

irb has tab completion support, you need to activate this by requiring ‘irb/completion’. You can load it when you invoke irb from the command line:


% irb -r irb/completion

Or you can load the completion library when irb is running:


% irb(main):005:0> require 'irb/completion'

If you often use tab completion then:

Linux users: Can create an alias in .bashrc by following these steps:

  • % vi ~/.bashrc
  • add alias irbtc="irb -r 'irb/completion'"
  • % source ~/.bashrc

Windows Users: Can create a file named irbtc.bat in your windows\system32 folder as irb -r "irb/completion" the file content.


Now you can run irb with tab completion support by:
% irbtc

Example:

% irbtc
irb(main):001:0> st="this is a string"
=> "this is a string"
irb(main):002:0> st.len
tab
irb(main):002:0> st.length
=> 16
irb(main):003:0> st.up
tabtab
st.upcase st.upcase! st.upto
irb(main):003:0> st.up

Entry Filed under: Ruby. .

8 Comments Add your own

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Important Notice…

I have moved this blog to http://webonrails.com . I will continue posting at http://webonrails.com, not on http://webonrails.wordpress.com.

Kindly update your book marks to http://webonrails.com

and http://webonrails.com/feed .

I am really very sorry for inconvenience.

Comming Soon….

Domain for Sale

TheRailsHosting.com


(Contact me)

c

Top Posts

Recent Posts

Recent Comments

jyoti on Ruby On Rails India
extessBob on My new HP Pavillion DV2117…
clexmases on My new HP Pavillion DV2117…
i can haz ajax? on Uploading files using AJA…
Peter on Plugin: NumbersToWords

rails

Ruby

RubyonRails

Calender

October 2006
M T W T F S S
« Sep   Nov »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Archives

Subscribe

  • Add to Google
  • Subscribe in NewsGator Online
  • Subscribe with Bloglines
  • WebOnRails on feedburner
  • technorati

del.icio.us

Feeds

Flickr Photos

iris

Icing on the Cake

* 7 EXPLORE

More Photos

Visitor’s Location

Spam Blocked

Blog Stats