Skip to content

Instantly share code, notes, and snippets.

@CraigMorton
Last active January 28, 2019 13:41
Show Gist options
  • Save CraigMorton/315d0f206e1414804e639cde731dba24 to your computer and use it in GitHub Desktop.
Save CraigMorton/315d0f206e1414804e639cde731dba24 to your computer and use it in GitHub Desktop.
echo "Installing and configuring Awesome Print for IRB"
gem install 'awesome_print'
cat >> "$HOME/.irbrc" << EOM
require "awesome_print"
AwesomePrint.irb!
require 'irb/completion'
IRB.conf[:AUTO_INDENT] = true
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:PROMPT][:CUSTOM] = {
:PROMPT_I => 'irb> ',
:PROMPT_S => 'irb>%l ',
:PROMPT_C => 'irb>> ',
:PROMPT_N => 'irb>> '
}
IRB.conf[:PROMPT_MODE] = :CUSTOM
EOM
cat >> "$HOME/.aprc" << EOM
AwesomePrint.defaults = {
index: false,
indent: 2,
sort_vars: false,
color: {
string: :cyanish,
symbol: :purple,
array: :white,
hash: :purpleish,
trueclass: :green,
falseclass: :red,
nilclass: :redish,
class: :yellow,
integer: :blue,
float: :blueish
}
}
EOM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment