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
[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
- ESC: Return to display mode.
- Up/K: Move the cursor up.
- Down/J: Move the cursor down.
- Left/H: Move the cursor left.
- Right/L: Move the cursor right.
- Up/K/CTRL-P: Move the cursor up.
- Down/J/CTRL-N: Move the cursor down.
- Left/H/CTRL-B: Move the cursor left.
- Right/L/CTRL-F: Move the cursor right.
- 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
, [ bind KUp
, bind 'k'
, ctrl 'p'
]
)
, ( DownEvent
, [ bind KDown
, bind 'j'
, ctrl 'n'
]
)
, ( LeftEvent
, [ bind KLeft
, bind 'h'
, ctrl 'b'
]
)
, ( RightEvent
, [ bind KRight
, bind 'l'
, ctrl 'f'
]
)
, ( FlipBitEvent