added Emacs-style cursor movement

This commit is contained in:
Jonathan Lamothe 2024-08-17 16:51:04 -04:00
parent 44588c691a
commit e41b560d37
3 changed files with 12 additions and 6 deletions

View File

@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to the and this project adheres to the
[Haskell Package Versioning Policy](https://pvp.haskell.org/). [Haskell Package Versioning Policy](https://pvp.haskell.org/).
## Unreleased ## [Unreleased]
## 0.1.0.0 - YYYY-MM-DD ### Added
- added Emacs-style keybindings for cursor movement

View File

@ -67,8 +67,8 @@ effects:
### Edit Mode ### Edit Mode
- ESC: Return to display mode. - ESC: Return to display mode.
- Up/K: Move the cursor up. - Up/K/CTRL-P: Move the cursor up.
- Down/J: Move the cursor down. - Down/J/CTRL-N: Move the cursor down.
- Left/H: Move the cursor left. - Left/H/CTRL-B: Move the cursor left.
- Right/L: Move the cursor right. - Right/L/CTRL-F: Move the cursor right.
- F: Flip the bit under the cursor (1 becomes 0; 0 becomes 1). - F: Flip the bit under the cursor (1 becomes 0; 0 becomes 1).

View File

@ -150,21 +150,25 @@ keyBindingsFor m = coreBindings ++ case m of
, ( UpEvent , ( UpEvent
, [ bind KUp , [ bind KUp
, bind 'k' , bind 'k'
, ctrl 'p'
] ]
) )
, ( DownEvent , ( DownEvent
, [ bind KDown , [ bind KDown
, bind 'j' , bind 'j'
, ctrl 'n'
] ]
) )
, ( LeftEvent , ( LeftEvent
, [ bind KLeft , [ bind KLeft
, bind 'h' , bind 'h'
, ctrl 'b'
] ]
) )
, ( RightEvent , ( RightEvent
, [ bind KRight , [ bind KRight
, bind 'l' , bind 'l'
, ctrl 'f'
] ]
) )
, ( FlipBitEvent , ( FlipBitEvent