-
Notifications
You must be signed in to change notification settings - Fork 1
/
.irbrc
31 lines (28 loc) · 959 Bytes
/
.irbrc
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
require "irb/completion"
IRB.conf[:PROMPT_MODE]=:SIMPLE
require "irb/ext/save-history"
IRB.conf[:SAVE_HISTORY]=1000
IRB.conf[:HISTORY_FILE]="#{ENV['HOME']}/.irb_history"
# Fix home and end key, via https://github.com/ruby/irb/issues/330#issuecomment-1132017233
require "reline/ansi"
if defined?(Reline::ANSI::CAPNAME_KEY_BINDINGS)
Reline::ANSI::CAPNAME_KEY_BINDINGS.merge!({
"kich1" => :ed_ignore,
"kdch1" => :key_delete,
"kpp" => :ed_ignore,
"knp" => :ed_ignore
})
Reline::ANSI.singleton_class.prepend(
Module.new do
def set_default_key_bindings(config)
set_default_key_bindings_comprehensive_list(config)
key = [239, 157, 134]
func = :ed_ignore
config.add_default_key_binding_by_keymap(:emacs, key, func)
config.add_default_key_binding_by_keymap(:vi_insert, key, func)
config.add_default_key_binding_by_keymap(:vi_command, key, func)
super
end
end
)
end