如何自定义GHCi的Readline键绑定?

Ada*_*tee 10 haskell readline ghc

我知道GHCi支持Readline和键绑定等,^W 并按^U预期工作.

我想知道ghci是否支持Bash处理inputrc的方式来定制键绑定.

eph*_*ent 14

你的GHC版本是什么?GHCi停止使用readline并开始在6.10 附近使用libedit,并且在6.12 附近使用haskeline.

libedit可以配置~/.editrc; 同样,Haskeline也有~/.haskeline.例如,我有

# ~/.editrc (for libedit)
edit on
bind ^R em-inc-search-prev
bind ^S em-inc-search-next
bind ^[[5~ ed-search-prev-history
bind ^[[6~ ed-search-next-history

匹配我的

# ~/.inputrc (for readline)
"\e[5~": history-search-backward
"\e[6~": history-search-forward