分享 可能是火星了,刚发现 GNU readline 6.3 以后 支持 history-substring-search-forward (backward) 了

altkatz · May 31, 2017 · 1245 hits

以前的 GNU readline 只支持 history-search-backward / history-search-forward,只能匹配字符串的前缀;

GNU readline 版本 6.3 后,加入了 history-substring-search-forward history-substring-search-backward

方法:

在 ~/.inputrc 里,加入(或替换)

"\e[A":history-substring-search-backward
"\e[B":history-substring-search-forward

就可以在 rails c 等依赖 readline 的程序中获得 zsh history-substring-search 插件的功能

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