sfm

simple file manager
git clone git://git.afify.dev/sfm
Log | Files | Refs | README | LICENSE

commit 5703bca3a3b9259e5b38ceeb504e157018f6b2d7
parent e2b1cebc12f0ead1f916ee63e7c14045bd870afd
Author: David Kalliecharan <david@david.science>
Date:   Thu, 13 May 2021 11:09:35 -0300

add arrow keys movement for normal/visual mode

Diffstat:
Mconfig.def.h | 64+++++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 35 insertions(+), 29 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -59,39 +59,45 @@ static Rule rules[] = { /* normal keys */ static Key nkeys[] = { - { {.ch = 'j'}, mvdwn }, - { {.ch = 'k'}, mvup }, - { {.ch = 'l'}, mvfwd }, - { {.ch = 'h'}, mvbk }, - { {.ch = 'g'}, mvtop }, - { {.ch = 'G'}, mvbtm }, - { {.ch = 'M'}, mvmid }, - { {.key = TB_KEY_CTRL_U}, scrup }, - { {.key = TB_KEY_CTRL_D}, scrdwn }, - { {.ch = 'n'}, crnf }, - { {.ch = 'N'}, crnd }, - { {.ch = 'd'}, delfd }, - { {.ch = 'x'}, calcdir }, - { {.ch = '/'}, start_filter }, - { {.ch = 'q'}, quit }, - { {.ch = 'v'}, start_vmode }, - { {.ch = 'y'}, yank }, - { {.ch = 'p'}, paste }, - { {.ch = 'P'}, selmv }, - { {.ch = 'c'}, rname }, - { {.key = TB_KEY_SPACE}, switch_pane }, + { {.ch = 'j'}, mvdwn }, + { {.key = TB_KEY_ARROW_DOWN}, mvdwn }, + { {.ch = 'k'}, mvup }, + { {.key = TB_KEY_ARROW_UP}, mvup }, + { {.ch = 'l'}, mvfwd }, + { {.key = TB_KEY_ARROW_RIGHT}, mvfwd }, + { {.ch = 'h'}, mvbk }, + { {.key = TB_KEY_ARROW_LEFT}, mvbk }, + { {.ch = 'g'}, mvtop }, + { {.ch = 'G'}, mvbtm }, + { {.ch = 'M'}, mvmid }, + { {.key = TB_KEY_CTRL_U}, scrup }, + { {.key = TB_KEY_CTRL_D}, scrdwn }, + { {.ch = 'n'}, crnf }, + { {.ch = 'N'}, crnd }, + { {.ch = 'd'}, delfd }, + { {.ch = 'x'}, calcdir }, + { {.ch = '/'}, start_filter }, + { {.ch = 'q'}, quit }, + { {.ch = 'v'}, start_vmode }, + { {.ch = 'y'}, yank }, + { {.ch = 'p'}, paste }, + { {.ch = 'P'}, selmv }, + { {.ch = 'c'}, rname }, + { {.key = TB_KEY_SPACE}, switch_pane }, }; /* visual keys */ static Key vkeys[] = { - { {.ch = 'j'}, seldwn }, - { {.ch = 'k'}, selup }, - { {.ch = 'a'}, selall }, - { {.ch = 'y'}, selynk }, - { {.ch = 'd'}, seldel }, - { {.ch = 'q'}, exit_vmode }, - { {.ch = 'v'}, exit_vmode }, - { {.key = TB_KEY_ESC}, exit_vmode }, + { {.ch = 'j'}, seldwn }, + { {.key = TB_KEY_ARROW_DOWN}, seldwn }, + { {.ch = 'k'}, selup }, + { {.key = TB_KEY_ARROW_UP}, selup }, + { {.ch = 'a'}, selall }, + { {.ch = 'y'}, selynk }, + { {.ch = 'd'}, seldel }, + { {.ch = 'q'}, exit_vmode }, + { {.ch = 'v'}, exit_vmode }, + { {.key = TB_KEY_ESC}, exit_vmode }, }; static const size_t nkeyslen = LEN(nkeys);