.irbrc

written by zsombor on August 16th, 2005 @ 06:59 PM

If you don’t have tab completion feature on simple irb shells, and you would like similar goodness of RoR’s script/console, try adding this small snippet to your .irbrc file:

IRB.conf[:AUTO_INDENT] = true
IRB.conf[:USE_READLINE] = true
unless IRB.conf[:LOAD_MODULES].include?('irb/completion')
  IRB.conf[:LOAD_MODULES] << 'irb/completion'
end

Personally I like the auto indent feature, a swell idea making all those multi-line constructs more typeable than ever. The rest is for the classic tab completion. Note that this will need the readline library. Last three lines is just to ensure that ruby will load the completion library even if other libraries where specified on invocation arguments. If you know a better way of doing this please share!

Post a comment

Options:

Size

Colors