Ruby 今天才发现 irb 也可搜历史

luikore · January 12, 2013 · Last by i5ting replied at January 12, 2013 · 2570 hits

以前土了,~/.inputrc 绑的快捷键对所有基于 readline 的程序都有效啊...

我的 ~/.inputrc

set show-all-if-ambiguous on
set completion-ignore-case on

# utf-8 I/O
set input-meta on
set output-meta on
set convert-meta off

# home 和 end (mac 是 fn+左 / fn+右,另外我把iterm的cmd+左/右也绑成了home/end)
"\e[1~": beginning-of-line
"\e[4~": end-of-line

# page up 和 page down 搜索历史 (mac 是 fn+上 / fn+下)
"\e[5~": history-search-backward
"\e[6~": history-search-forward

# 绑定快速输入一些代码的快捷键
"\C-l": "λ"
"\C-r": "require 'active_support/all'"

不错,学习了

You need to Sign in before reply, if you don't have an account, please Sign up first.