IRB History and Completion

Saturday, June 09

Found this on the RubyGarden wiki and it totally made my day. To get persistent history rocking in IRB, add the following to your .irbrc.

require 'irb/completion'
require 'irb/ext/save-history'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history" 

Note that this will also add tab completion.

Comments

Leave a response