be

based editor
git clone git://git.kocotian.pl/be.git
Log | Files | Refs | README | LICENSE

commit 412b54a48333cd66c251d0673a5494715ae04582
parent a81c2863bc8fd14fd6c0cfd53a88d2fba9e6cf74
Author: kocotian <kocotian@kocotian.pl>
Date:   Mon, 19 Apr 2021 08:58:23 +0200

Bindings moved do config/bindings.h

Diffstat:
Mconfig.h | 46+---------------------------------------------
Aconfig/bindings.h | 45+++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 45 deletions(-)

diff --git a/config.h b/config.h @@ -9,48 +9,4 @@ #include <lang/en_US.h> /* key bindings */ -static Key -normalbindings[] = { - /* modifier key function argument */ - /* movement */ - { ModNone, 'h', cursormove, {.i = 0} }, - { ModNone, 'j', cursormove, {.i = 1} }, - { ModNone, 'k', cursormove, {.i = 2} }, - { ModNone, 'l', cursormove, {.i = 3} }, - - /* edit mode */ - { ModNone, 'i', insertmode, {.i = 0} }, - { ModShift, 'i', insertmode, {.i = 1} }, - { ModNone, 'a', appendmode, {.i = 0} }, - { ModShift, 'a', appendmode, {.i = 1} }, - - /* advanced movement */ - { ModNone, '^', beginning, {0} }, - { ModNone, '0', beginning, {0} }, - { ModNone, '$', ending, {0} }, - { ModNone, 'E', ending, {0} }, - - { ModNone, 'o', openline, {0} }, - { ModNone, 'O', openline, {1} }, - { ModNone, '\r', openline, {2} }, - - /* other */ - { ModShift, 'q', quit, {0} }, - { ModNone, 0, echoe, {.v = "Key is not bound"} }, -}, - -editbindings[] = { - /* modifier key function argument */ - { ModNone, 033, normalmode, {0} }, - { ModNone, '\r', normalmode, {1} }, - { ModNone, 127, removechar, {0} }, - { ModNone, 0, insertchar, {.v = REPLACE} }, -}; - -#define BIND(KEYS) { (KEYS), LEN((KEYS)) } - -static Binding bindings[] = { - /* mode keys */ - [ModeEdit] = BIND(editbindings), - [ModeNormal] = BIND(normalbindings), -}; +#include <config/bindings.h> diff --git a/config/bindings.h b/config/bindings.h @@ -0,0 +1,45 @@ +static Key +normalbindings[] = { + /* modifier key function argument */ + /* movement */ + { ModNone, 'h', cursormove, {.i = 0} }, + { ModNone, 'j', cursormove, {.i = 1} }, + { ModNone, 'k', cursormove, {.i = 2} }, + { ModNone, 'l', cursormove, {.i = 3} }, + + /* edit mode */ + { ModNone, 'i', insertmode, {.i = 0} }, + { ModShift, 'i', insertmode, {.i = 1} }, + { ModNone, 'a', appendmode, {.i = 0} }, + { ModShift, 'a', appendmode, {.i = 1} }, + + /* advanced movement */ + { ModNone, '^', beginning, {0} }, + { ModNone, '0', beginning, {0} }, + { ModNone, '$', ending, {0} }, + { ModNone, 'E', ending, {0} }, + + { ModNone, 'o', openline, {0} }, + { ModNone, 'O', openline, {1} }, + { ModNone, '\r', openline, {2} }, + + /* other */ + { ModShift, 'q', quit, {0} }, + { ModNone, 0, echoe, {.v = "Key is not bound"} }, +}, + +editbindings[] = { + /* modifier key function argument */ + { ModNone, 033, normalmode, {0} }, + { ModNone, '\r', normalmode, {1} }, + { ModNone, 127, removechar, {0} }, + { ModNone, 0, insertchar, {.v = REPLACE} }, +}; + +#define BIND(KEYS) { (KEYS), LEN((KEYS)) } + +static Binding bindings[] = { + /* mode keys */ + [ModeEdit] = BIND(editbindings), + [ModeNormal] = BIND(normalbindings), +};