~/.irbrc
1.
require "irb/completion" def ri(*names) system(%{ri #{names.map {|name| name.to_s}.join(" ")}}) end leader=" "*IRB.name.length IRB.conf[:PROMPT][:HORN]={ :PROMPT_I=>"#{IRB.name} --> ", :PROMPT_S=>"#{leader} -- ", :PROMPT_C=>"#{leader} --+ ", :RETURN=>"#{leader} =>%s\n\n" }
IRB.conf[:AUTO_INDENT]=true
puts `date`
使用 alias irb="irb --prompt horn"
2.
IRB.conf[:IRB_RC]=proc do |conf| leader=" * "*conf.irb_name.length conf.prompt_i="#{conf.irb_name} --> " conf.prompt_s=leader+' \-" ' conf.prompt_c=leader+' \+ ' conf.return_format=leader +" ==> %s\n\n" puts `date` end