views:

220

answers:

1

I know ghci supports readline , and keybindings such as ^W and ^U work as expected. But I do wonder whether ghci support the customization of keybindings , just like the way bash deal with inputrc ?

Thanks for any feedback.

+4  A: 

What is your GHC version? GHCi stopped using readline and started using libedit around 6.10 and haskeline around 6.12.

libedit can be configured in ~/.editrc; similarly, Haskeline has ~/.haskeline. For example, I have

# ~/.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

to match my

# ~/.inputrc (for readline)
"\e[5~": history-search-backward
"\e[6~": history-search-forward
ephemient
Thanks for your kindly help, ephemient !
Adaptee