From ae68bcbac1e252b743929402e6b8c39c9024bfce Mon Sep 17 00:00:00 2001 From: wouter bolsterlee Date: Wed, 8 Feb 2017 11:59:54 +0100 Subject: [PATCH] add support for colemak style vi bindings this allows e/n in addition to j/k (same places on the keyboard on colemak and qwerty) to be used as arrow keys when selecting a command from the suggested fixups. fixes #603 --- thefuck/ui.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/thefuck/ui.py b/thefuck/ui.py index 2a2f84ba..d30f74d9 100644 --- a/thefuck/ui.py +++ b/thefuck/ui.py @@ -12,9 +12,10 @@ def read_actions(): while True: key = get_key() - if key in (const.KEY_UP, 'k'): + # Handle arrows, j/k (qwerty), and n/e (colemak) + if key in (const.KEY_UP, 'k', 'e'): yield const.ACTION_PREVIOUS - elif key in (const.KEY_DOWN, 'j'): + elif key in (const.KEY_DOWN, 'j', 'n'): yield const.ACTION_NEXT elif key in (const.KEY_CTRL_C, 'q'): yield const.ACTION_ABORT