summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2014-07-27 20:59:23 +0200
committertv <tv@shackspace.de>2014-07-27 20:59:23 +0200
commit983f4007620c1c7c0d2c50892d08a367f7152c0a (patch)
treefd5021aceba16ab076dabfee91e61442bdfd6e3c
parent1be6510aa16cefe17438caf88aa0b74627ae90b6 (diff)
nmap += aIAhlbw<Return><Escape>; imap<Escape> honors NormalMode constraints
-rw-r--r--Main.hs11
1 files changed, 10 insertions, 1 deletions
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" "<Escape>"]
imap =
- [ ("\x1b", ChangeMode NormalMode)
+ [ ("\x1b", ChangeMode NormalMode <> MotionCommand (GotoLeft 1))
, ("\x01", MotionCommand GotoFirstChar)
, ("\x05", MotionCommand GotoEndOfLine)
, ("\x1b[3~", KillNextChar)