-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pryrc
45 lines (38 loc) · 1.08 KB
/
.pryrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# herb
begin
require 'hirb'
rescue LoadError
# Missing goodies, bummer
end
if defined? Hirb
# Slightly dirty hack to fully support in-session Hirb.disable/enable toggling
Hirb::View.instance_eval do
def enable_output_method
@output_method = true
@old_print = Pry.config.print
Pry.config.print = proc do |*args|
Hirb::View.view_or_page_output(args[1]) || @old_print.call(*args)
end
end
def disable_output_method
Pry.config.print = @old_print
@output_method = nil
end
end
Hirb.enable
end
# aliases
if defined?(PryByebug)
Pry.commands.alias_command 'cc', 'continue'
Pry.commands.alias_command 'ss', 'step'
Pry.commands.alias_command 'nn', 'next'
Pry.commands.alias_command 'ff', 'finish'
end
Pry.commands.alias_command 'ee', 'exit'
Pry.commands.alias_command 'sh', 'show-source'
Pry.commands.alias_command 'dd', 'disable-pry'
Pry::Commands.block_command 'trace', 'filter caller backtrace' do
output = caller.select { |line| line['bizimply'] }
puts "\e[31m#{output.join("\n")}\e[0m"
end
Pry.config.editor = 'nvim'