From 983f4007620c1c7c0d2c50892d08a367f7152c0a Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 27 Jul 2014 20:59:23 +0200 Subject: nmap += aIAhlbw; imap honors NormalMode constraints --- Main.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Main.hs') diff --git a/Main.hs b/Main.hs index 2a29fb2..470d7fa 100644 --- a/Main.hs +++ b/Main.hs @@ -345,13 +345,22 @@ charToCode c = "\\x" ++ showIntAtBase 16 intToDigit (ord c) "" nmap = [ ("i", ChangeMode InsertMode) + , ("a", ChangeMode InsertMode <> MotionCommand (GotoRight 1)) + , ("I", ChangeMode InsertMode <> MotionCommand GotoFirstChar) + , ("A", ChangeMode InsertMode <> MotionCommand GotoEndOfLine) , ("0", MotionCommand GotoFirstChar) , ("$", MotionCommand GotoEndOfLine) + , ("h", MotionCommand $ GotoLeft 1) + , ("l", MotionCommand $ GotoRight 1) + , ("b", MotionCommand $ WordsBackward 1) + , ("w", MotionCommand $ WordsForward 1) + , ("\x0a", ExecuteInputBuffer) ] + ++ [unboundSequence "\x1b" ""] imap = - [ ("\x1b", ChangeMode NormalMode) + [ ("\x1b", ChangeMode NormalMode <> MotionCommand (GotoLeft 1)) , ("\x01", MotionCommand GotoFirstChar) , ("\x05", MotionCommand GotoEndOfLine) , ("\x1b[3~", KillNextChar) -- cgit v1.2.3