How to customize Readline keybindings of GHCi?

后端 未结 2 1923
鱼传尺愫
鱼传尺愫 2021-02-20 16:04

I know GHCi supports Readline, and keybindings such as ^W and ^U work as expected.

I do wonder whether ghci support customization of keybindin

2条回答
  •  耶瑟儿~
    2021-02-20 16:29

    @ephemient's answer above also helps with newer builds of MySQL which have switched from readline to libedit. I used

    $ ~/.editrc:
    bind ^[[A ed-search-prev-history
    bind ^[[B ed-search-next-history
    

    to match my old version which used to work inside MySQL:

    $ ~/.inputrc:
    "\e[A":history-search-backward
    "\e[B":history-search-forward
    

    (my only annoyance now is that if I just want to scroll and not search, I have to type a "." first to match every line).

提交回复
热议问题