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
.
Quits GHCi. You can also quit by typing control-D at the prompt. Attempts to reload the current target set (see :load ) if any of the modules in the set, or any dependent module, has changed.
Open a command window and navigate to the directory where you want to keep your Haskell source files. Run Haskell by typing ghci or ghci MyFile. hs. (The "i" in "GHCi" stands for "interactive", as opposed to compiling and producing an executable file.)
Introduction. GHCi is GHC's interactive environment, in which Haskell expressions can be interactively evaluated and programs can be interpreted.
You can also quit by typing a control-D at the prompt. Attempts to reload the current target set (see :load) if any of the modules in the set, or any dependent module, has changed. Note that this may entail loading new modules, or dropping modules which are no longer indirectly required by the target.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With