Skip to content

Instantly share code, notes, and snippets.

@choonkeat
Created March 6, 2009 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save choonkeat/75025 to your computer and use it in GitHub Desktop.
Save choonkeat/75025 to your computer and use it in GitHub Desktop.
irbrc config to make irb or script/console output be copy-paste friendly
# Append this content into ~/.irbrc
#
# irb console prompt to make the output copy-paste friendly
# overrides :simple for use in Rails' script/console
# overrides :default for use in regular irb session
IRB.conf[:PROMPT][:SIMPLE] = IRB.conf[:PROMPT][:DEFAULT] = {
:PROMPT_I => "\"%N(%m):%03n:%i>\"; ", # normal prompt: an inconsequential statement, a string
:PROMPT_S => "", # prompt for continuing strings: nothing
:PROMPT_C => "", # prompt for continuing statement: nothing
:RETURN => "#=> %s\n" # return value output is commented to not disrupt the code flow
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment