February 04, 2007

Bind up/down arrow key to BASH history-search

在 ~/.bashrc 或 /etc/bashrc 加入以下兩行
bind '"\x1b\x5b\x41":history-search-backward'
bind '"\x1b\x5b\x42":history-search-forward'
這樣就可以鍵入 command prefix + 上下鍵做 history search, 很方便.
感謝 zxvc 提供
ref. [心得] 好用的bash history function

Posted by pank at February 4, 2007 01:03 AM
Comments
Post a comment













Remember personal info?