From 75d4730280c1bb7e47c04498c460b596ba5c7f17 Mon Sep 17 00:00:00 2001 From: ckath Date: Wed, 2 Sep 2020 17:15:20 +0200 Subject: [PATCH 1/2] redo vimmode keybind mapping - keep arrow keys working inside vimmode - drop 'H' and 'K' binds in favor of logical 'hjkl' remaps --- ScreenManager.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ScreenManager.c b/ScreenManager.c index 8e5f697f6..863c0ef28 100644 --- a/ScreenManager.c +++ b/ScreenManager.c @@ -196,12 +196,9 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) { case 'j': ch = KEY_DOWN; break; case 'k': ch = KEY_UP; break; case 'l': ch = KEY_RIGHT; break; - case KEY_LEFT: ch = 'h'; break; - case KEY_DOWN: ch = 'j'; break; - case KEY_UP: ch = 'k'; break; - case KEY_RIGHT: ch = 'l'; break; + case 'H': ch = 'h'; break; + case 'J': ch = 'j'; break; case 'K': ch = 'k'; break; - case 'J': ch = 'K'; break; case 'L': ch = 'l'; break; } } From 05431a600a2b7e8cbdd111097d8ad389a068c58e Mon Sep 17 00:00:00 2001 From: ckath Date: Tue, 8 Sep 2020 22:25:17 +0200 Subject: [PATCH 2/2] allow hjkl for movement in panels --- Panel.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Panel.c b/Panel.c index 348fd2381..805b690cc 100644 --- a/Panel.c +++ b/Panel.c @@ -385,10 +385,12 @@ bool Panel_onKey(Panel* this, int key) { switch (key) { case KEY_DOWN: case KEY_CTRL('N'): + case 'j': this->selected++; break; case KEY_UP: case KEY_CTRL('P'): + case 'k': this->selected--; break; #ifdef KEY_C_DOWN @@ -403,6 +405,7 @@ bool Panel_onKey(Panel* this, int key) { #endif case KEY_LEFT: case KEY_CTRL('B'): + case 'h': if (this->scrollH > 0) { this->scrollH -= MAX(CRT_scrollHAmount, 0); this->needsRedraw = true; @@ -410,6 +413,7 @@ bool Panel_onKey(Panel* this, int key) { break; case KEY_RIGHT: case KEY_CTRL('F'): + case 'l': this->scrollH += CRT_scrollHAmount; this->needsRedraw = true; break;