Search code examples
haskellvimread-eval-print-looparchlinuxghci

Set vi as editor in GHCi


How can I get vi editing mode to work in GHCi?

I'm using version 7.10.3.

I tried Prelude> :set editor vi, but to no effect.

I also have these lines in my ~/.inputrc.

set editing-mode vi
set keymap vi

.


Solution

  • GHCi now uses the Haskeline library for command line editing (which has been true for quite a while now), and it does indeed have a vi mode. The configuration file is ~/.haskeline and the line you want is:

    editMode: Vi
    

    Documented here: https://github.com/judah/haskeline/wiki/UserPreferences