Good evening,
I recently installed (compiled from git) Yi. I am a vim user,
so I decided to translate some basic functions from my .vimrc to my
yi.hs config file.
I decided to start with something simple:
" quick remap to esc (don't slide right while doing it)
:inoremap jk <Esc>l
:cnoremap jk <Esc>l
For the vim-impaired users, this means "pressing 'jk' will exit insert
mode" (more precisely, 'jk' will be substituted with <Esc> key).
IRC user <Fuuzetsu> kindly pointed me to some example yi.hs
configuration files, and I tried to work from those to a working code.
Alas, I did not succeed. What I have is:
modKeymap ∷ KeymapSet
modKeymap = mkKeymap $ override defKeymap $ λsuper self →
super { v_top_level = (v_top_level super) ||>
(char 'j' ?>> char 'k' ?>>! clrStatus)
}
I don't know what to substitute the placeholder clrStatus with. In
Yi.Keymap.Vim there is a |leaveInsRep| function [1], but it is of a far
different type than the expected type.
I am blocked here: I tried to check Vim2 to see if I found that more
palatable, but the lack of example config files made it look a daunting
task.
Any direction is welcome, I attach my complete yi.hs
-F
[1]
https://github.com/yi-editor/yi/blob/015949bee9ac5b5f2e885cd4b7af2fb07e87aea8/yi/src/library/Yi/Keymap/Vim.hs#L1589
import Yi
import Yi.Keymap.Vim (keymapSet)
import Yi.Keymap.Vim -- da metter via
import qualified Yi.Mode.Haskell as Haskell
import Yi.Style
import Yi.Style.Library
import Prelude
import Control.Applicative
-- Ctrl-e should so something like 'Esc', everywhere
-- " quick remap to esc (don't slide right while doing it)
-- :inoremap jk <Esc>l
-- :cnoremap jk <Esc>l
modKeymap ::KeymapSet
modKeymap = mkKeymap $ override defKeymap $ \super self ->
super { v_top_level = (v_top_level super) ||>
(char 'j' ?>> char 'k' ?>>! clrStatus)
}
myConfigUI :: UIConfig
myConfigUI = (configUI defaultVimConfig)
{ -- configTheme = defaultVimUiTheme,
configWindowFill = '~' }
main :: IO ()
main = yi $ defaultVimConfig
{ configUI = myConfigUI,
defaultKm = modKeymap }
signature.asc
Description: Digital signature
