Skip to content

Instantly share code, notes, and snippets.

@cloudhead
Created August 28, 2009 03:42
Show Gist options
  • Save cloudhead/176769 to your computer and use it in GitHub Desktop.
Save cloudhead/176769 to your computer and use it in GitHub Desktop.
require 'irb/completion'
require 'irb/ext/save-history'
require 'open-uri'
require 'json'
require 'cgi'
ANSI_YELLOW = "\033[1;33m"
ANSI_PURPLE = "\033[0;35m"
ANSI_LPURPLE = "\033[1;35m"
ANSI_RESET = "\033[0m"
ANSI_BOLD = "\033[1m"
ARGV.concat ["--readline"]
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history"
IRB.conf[:AUTO_INDENT] = true
color = ANSI_PURPLE
IRB.conf[:PROMPT][:CLOUD] = {
:PROMPT_I => "#{color}%N>#{ANSI_RESET} ", # normal prompt
:PROMPT_S => "#{color}%N%l#{ANSI_RESET} ", # prompt for continuing strings
:PROMPT_C => "#{color}%N*#{ANSI_RESET} ", # prompt for continuing statement
:PROMPT_N => "#{color}%N*#{ANSI_RESET} ", # "
:RETURN => "#{color}=>#{ANSI_RESET}#{ANSI_YELLOW} %s#{ANSI_RESET}\n"
}
IRB.conf[:PROMPT_MODE] = :CLOUD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment