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

altkatz · 2017年05月31日 · 1245 次阅读

以前的 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 插件的功能

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请 注册新账号