Skip to content

Instantly share code, notes, and snippets.

@mkelley33
Last active December 17, 2015 12:29
Show Gist options
  • Save mkelley33/5610528 to your computer and use it in GitHub Desktop.
Save mkelley33/5610528 to your computer and use it in GitHub Desktop.
My .pryrc
# encoding: UTF-8
Pry.config.editor = "vim"
Pry.config.pager = false
Pry.config.commands.alias_command "lM", "ls -M"
if defined?(Encoding) then
Encoding.default_external = 'utf-8'
Encoding.default_internal = 'utf-8'
else
$KCODE = 'utf-8'
end
# Pry.config.command_prefix = "%"
Pry.config.prompt = [
proc {|target_self, nest_level, pry|
nested = (nest_level.zero?) ? '' : ":#{nest_level}"
"[#{pry.input_array.size}] #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}(#{Pry.view_clip(target_self)})#{nested}> "
},
proc {|target_self, nest_level, pry|
nested = (nest_level.zero?) ? '' : ":#{nest_level}"
"[#{pry.input_array.size}] #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}(#{Pry.view_clip(target_self)})#{nested}* "
}
]
begin
require 'pry-clipboard'
# aliases
Pry.commands.alias_command 'ch', 'copy-history'
Pry.commands.alias_command 'cr', 'copy-result'
rescue LoadError
# Missing goodies, bummer
end
begin
require 'awesome_print'
require 'tapp'
rescue LoadError
# Missing goodies, bummer
end
begin
require 'pry-debugger'
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 'f', 'finish'
Pry.commands.alias_command 'b', 'break'
rescue LoadError
# Missing goodies, bummer
end
begin
require 'hirb'
require 'hirb-unicode'
rescue LoadError
# Missing goodies, bummer
end
@mkelley33
Copy link
Author

Rename to .pryrc and put in your $HOME directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment