-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpryrc
45 lines (40 loc) · 876 Bytes
/
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
begin
require 'awesome_print'
AwesomePrint.pry!
rescue LoadError
end
# Editor
Pry.editor = ENV.fetch('EDITOR', 'vim')
# Use one history file with Irb
Pry.config.history_file = '~/.irb_history'
# Bindings for pry-byebug
begin
Pry.commands.alias_command 'c', 'continue'
rescue StandardError
nil
end
begin
Pry.commands.alias_command 's', 'step'
rescue StandardError
nil
end
begin
Pry.commands.alias_command 'n', 'next'
rescue StandardError
nil
end
begin
Pry.commands.alias_command 'r!', 'reload!'
rescue StandardError
nil
end
# Colors!
Pry.config.color = true
# Custom prompt displaying Ruby version
Pry.config.prompt = Pry::Prompt.new(
'custom', 'my custom prompt with Ruby version',
[
proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} > " },
proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} * " }
]
)