diff options
Diffstat (limited to 'ScreenManager.c')
-rw-r--r-- | ScreenManager.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ScreenManager.c b/ScreenManager.c index db117b65..8e5f697f 100644 --- a/ScreenManager.c +++ b/ScreenManager.c @@ -190,6 +190,22 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) { set_escdelay(25); ch = getch(); + if (this->settings->vimMode) { + switch (ch) { + case 'h': ch = KEY_LEFT; break; + 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 'K': ch = 'k'; break; + case 'J': ch = 'K'; break; + case 'L': ch = 'l'; break; + } + } + HandlerResult result = IGNORED; if (ch == KEY_MOUSE && this->settings->enableMouse) { ch = ERR; |