sandy

text editor
git clone git://git.suckless.org/sandy
Log | Files | Refs | README | LICENSE

commit afdbed020eb0f1a8768958e213159edbc6a5229d
parent 4b2fd17c08ed33cd3160fc85abb9706c3097c8b2
Author: Rafael Garcia <rafael.garcia.gallego@gmail.com>
Date:   Thu,  4 Aug 2011 16:21:13 +0200

Oooops confg.def.h
Diffstat:
config.def.h | 152++++++++++++++++++++++++++++++++++++++++----------------------------------------
1 file changed, 76 insertions(+), 76 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -50,86 +50,86 @@ static const char nlstr[1] = { 0 }; /* WARNING: use CONTROL(ch) ONLY with '@', (caps)A-Z, '[', '\', ']', '^', '_' or '?' */ /* otherwise it may not mean what you think. See man 7 ascii for more info */ #define CONTROL(ch) {(ch ^ 0x40)} -#define META(ch) {0x1B, ch} +#define META(ch) { 0x1B, ch } -static const NCKey curskeys[] = { /* Plain keys here, no CONTROL or META */ -/* keyv, tests, func, arg */ -{ KEY_BACKSPACE, { t_rw, 0, 0, 0 }, f_delete, { .m = m_prevchar } }, -{ KEY_DC, { t_sel, t_rw, 0, 0 }, f_delete, { .m = m_tosel } }, -{ KEY_DC, { t_rw, 0, 0, 0 }, f_delete, { .m = m_nextchar } }, -{ KEY_IC, { t_sel, 0, 0, 0 }, f_pipero, TOCLIP }, -{ KEY_SDC, { t_sel, t_rw, 0, 0 }, f_pipe, TOCLIP }, -{ KEY_SIC, { t_rw, 0, 0, 0 }, f_pipe, FROMCLIP }, -{ KEY_HOME, { 0, 0, 0, 0 }, f_moveb, { .m = m_bol } }, -{ KEY_END, { 0, 0, 0, 0 }, f_moveb, { .m = m_eol } }, -{ KEY_SHOME, { 0, 0, 0, 0 }, f_moveb, { .m = m_bof } }, -{ KEY_SEND, { 0, 0, 0, 0 }, f_moveb, { .m = m_eof } }, -{ KEY_PPAGE, { 0, 0, 0, 0 }, f_moveb, { .m = m_prevscr } }, -{ KEY_NPAGE, { 0, 0, 0, 0 }, f_moveb, { .m = m_nextscr } }, -{ KEY_UP, { 0, 0, 0, 0 }, f_moveb, { .m = m_prevline } }, -{ KEY_DOWN, { 0, 0, 0, 0 }, f_moveb, { .m = m_nextline } }, -{ KEY_LEFT, { 0, 0, 0, 0 }, f_moveb, { .m = m_prevchar } }, -{ KEY_RIGHT, { 0, 0, 0, 0 }, f_moveb, { .m = m_nextchar } }, -{ KEY_SLEFT, { 0, 0, 0, 0 }, f_moveb, { .m = m_prevword } }, -{ KEY_SRIGHT, { 0, 0, 0, 0 }, f_moveb, { .m = m_nextword } }, +static const Key curskeys[] = { /* Plain keys here, no CONTROL or META */ +/* keyv.i, tests, func, arg */ +{ .keyv.i = KEY_BACKSPACE, { t_rw, 0, 0, 0 }, f_delete, { .m = m_prevchar } }, +{ .keyv.i = KEY_DC, { t_sel, t_rw, 0, 0 }, f_delete, { .m = m_tosel } }, +{ .keyv.i = KEY_DC, { t_rw, 0, 0, 0 }, f_delete, { .m = m_nextchar } }, +{ .keyv.i = KEY_IC, { t_sel, 0, 0, 0 }, f_pipero, TOCLIP }, +{ .keyv.i = KEY_SDC, { t_sel, t_rw, 0, 0 }, f_pipe, TOCLIP }, +{ .keyv.i = KEY_SIC, { t_rw, 0, 0, 0 }, f_pipe, FROMCLIP }, +{ .keyv.i = KEY_HOME, { 0, 0, 0, 0 }, f_moveb, { .m = m_bol } }, +{ .keyv.i = KEY_END, { 0, 0, 0, 0 }, f_moveb, { .m = m_eol } }, +{ .keyv.i = KEY_SHOME, { 0, 0, 0, 0 }, f_moveb, { .m = m_bof } }, +{ .keyv.i = KEY_SEND, { 0, 0, 0, 0 }, f_moveb, { .m = m_eof } }, +{ .keyv.i = KEY_PPAGE, { 0, 0, 0, 0 }, f_moveb, { .m = m_prevscr } }, +{ .keyv.i = KEY_NPAGE, { 0, 0, 0, 0 }, f_moveb, { .m = m_nextscr } }, +{ .keyv.i = KEY_UP, { 0, 0, 0, 0 }, f_moveb, { .m = m_prevline } }, +{ .keyv.i = KEY_DOWN, { 0, 0, 0, 0 }, f_moveb, { .m = m_nextline } }, +{ .keyv.i = KEY_LEFT, { 0, 0, 0, 0 }, f_moveb, { .m = m_prevchar } }, +{ .keyv.i = KEY_RIGHT, { 0, 0, 0, 0 }, f_moveb, { .m = m_nextchar } }, +{ .keyv.i = KEY_SLEFT, { 0, 0, 0, 0 }, f_moveb, { .m = m_prevword } }, +{ .keyv.i = KEY_SRIGHT, { 0, 0, 0, 0 }, f_moveb, { .m = m_nextword } }, }; static const Key stdkeys[] = { -/* keyv, test, func, arg */ -{ CONTROL('@'), { 0, 0, 0, 0 }, f_move, { .m = m_tomark } }, -{ CONTROL('A'), { 0, 0, 0, 0 }, f_move, { .m = m_bol } }, -{ CONTROL('B'), { 0, 0, 0, 0 }, f_move, { .m = m_prevchar } }, -{ META('b'), { 0, 0, 0, 0 }, f_move, { .m = m_prevword } }, -{ CONTROL('C'), { t_warn,t_mod,0, 0 }, f_toggle, { .i = S_Running } }, -{ CONTROL('C'), { t_mod, 0, 0, 0 }, f_toggle, { .i = S_Warned } }, -{ CONTROL('C'), { 0, 0, 0, 0 }, f_toggle, { .i = S_Running } }, -{ META('c'), { t_sel, t_rw, 0, 0 }, f_pipe, { .v = "awk '{ for ( i=1; i <= NF; i++) { $i=tolower($i) ; sub(\".\", substr(toupper($i),1,1) , $i) } print }'" } }, -{ CONTROL('D'), { t_sel, t_rw, 0, 0 }, f_pipe, TOCLIP }, -{ CONTROL('D'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_nextchar } }, -{ META('d'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_nextword } }, -{ CONTROL('E'), { 0, 0, 0, 0 }, f_move, { .m = m_eol } }, -{ CONTROL('F'), { 0, 0, 0, 0 }, f_move, { .m = m_nextchar } }, -{ META('f'), { 0, 0, 0, 0 }, f_move, { .m = m_nextword } }, -{ CONTROL('G'), { t_sel, 0, 0, 0 }, f_select, { .m = m_stay } }, -{ CONTROL('H'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_prevchar } }, -{ CONTROL('I'), { t_sel, t_rw, 0, 0 }, f_pipelines, { .v = "sed 's/^/\\t/'" } }, -{ CONTROL('I'), { t_rw, 0, 0, 0 }, f_insert, { .v = "\t" } }, -{ CONTROL('J'), { t_rw, 0, 0, 0 }, f_insert, { .v = "\n" } }, -{ CONTROL('J'), { 0, 0, 0, 0 }, f_move, { .m = m_nextline } }, -{ CONTROL('K'), { t_eol, t_rw, 0, 0 }, f_delete, { .m = m_nextchar } }, -{ CONTROL('K'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_eol } }, -{ CONTROL('L'), { 0, 0, 0, 0 }, f_center, { 0 } }, -{ META('l'), { t_sel, t_rw, 0, 0 }, f_pipe, { .v = "tr [A-Z] [a-z]" } }, -{ CONTROL('M'), { t_rw, 0, 0, 0 }, f_insert, { .v = "\n" } }, -{ CONTROL('M'), { 0, 0, 0, 0 }, f_move, { .m = m_nextline } }, -{ CONTROL('N'), { 0, 0, 0, 0 }, f_move, { .m = m_nextline } }, -{ CONTROL('O'), { t_sel, 0, 0, 0 }, f_select, { .m = m_tosel } }, /* Swap fsel and fcur */ -{ CONTROL('P'), { 0, 0, 0, 0 }, f_move, { .m = m_prevline } }, -{ CONTROL('Q'), { 0, 0, 0, 0 }, f_toggle, { .i = S_InsEsc } }, -{ CONTROL('R'), { t_sel, 0, 0, 0 }, f_findbw, { 0 } }, -{ CONTROL('R'), { 0, 0, 0, 0 }, f_spawn, FINDBW }, -{ META('r'), { 0, 0, 0, 0 }, f_findbw, { 0 } }, -{ CONTROL('S'), { t_sel, 0, 0, 0 }, f_findfw, { 0 } }, -{ CONTROL('S'), { 0, 0, 0, 0 }, f_spawn, FIND }, -{ META('s'), { 0, 0, 0, 0 }, f_findfw, { 0 } }, -{ CONTROL('T'), { 0, 0, 0, 0 }, f_pipero , TOCLIP }, -{ CONTROL('U'), { t_bol, t_rw, 0, 0 }, f_delete, { .m = m_prevchar } }, -{ CONTROL('U'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_bol } }, -{ META('u'), { t_sel, t_rw, 0, 0 }, f_pipe, { .v = "tr [a-z] [A-Z]" } }, -{ CONTROL('V'), { 0, 0, 0, 0 }, f_move, { .m = m_prevscr } }, -{ META('v'), { 0, 0, 0, 0 }, f_move, { .m = m_nextscr } }, -{ CONTROL('W'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_prevword } }, -{ CONTROL('X'), { t_mod, 0, 0, 0 }, f_save, { 0 } }, -{ CONTROL('X'), { 0, 0, 0, 0 }, f_toggle, { .i = S_Running } }, -{ CONTROL('Y'), { t_rw, 0, 0, 0 }, f_pipe, FROMCLIP }, -{ CONTROL('Z'), { 0 ,0, 0, 0 }, f_suspend, { 0 } }, -{ CONTROL('['), { 0, 0, 0, 0 }, f_spawn, CMD_P }, /* TODO: Sam's? */ -{ CONTROL('\\'),{ 0, 0, 0, 0 }, f_spawn, PIPE }, -{ CONTROL(']'), { 0, 0, 0, 0 }, f_extsel, { .i = ExtDefault } }, -{ CONTROL('^'), { t_redo,t_rw, 0, 0 }, f_undo, { .i = -1 } }, -{ CONTROL('^'), { t_rw, 0, 0, 0 }, f_repeat, { 0 } }, -{ CONTROL('_'), { t_undo,t_rw, 0, 0 }, f_undo, { .i = 1 } }, -{ CONTROL('?'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_prevchar } }, +/* keyv.c, test, func, arg */ +{ .keyv.c = CONTROL('@'), { 0, 0, 0, 0 }, f_move, { .m = m_tomark } }, +{ .keyv.c = CONTROL('A'), { 0, 0, 0, 0 }, f_move, { .m = m_bol } }, +{ .keyv.c = CONTROL('B'), { 0, 0, 0, 0 }, f_move, { .m = m_prevchar } }, +{ .keyv.c = META('b'), { 0, 0, 0, 0 }, f_move, { .m = m_prevword } }, +{ .keyv.c = CONTROL('C'), { t_warn,t_mod,0, 0 }, f_toggle, { .i = S_Running } }, +{ .keyv.c = CONTROL('C'), { t_mod, 0, 0, 0 }, f_toggle, { .i = S_Warned } }, +{ .keyv.c = CONTROL('C'), { 0, 0, 0, 0 }, f_toggle, { .i = S_Running } }, +{ .keyv.c = META('c'), { t_sel, t_rw, 0, 0 }, f_pipe, { .v = "awk '{ for ( i=1; i <= NF; i++) { $i=tolower($i) ; sub(\".\", substr(toupper($i),1,1) , $i) } print }'" } }, +{ .keyv.c = CONTROL('D'), { t_sel, t_rw, 0, 0 }, f_pipe, TOCLIP }, +{ .keyv.c = CONTROL('D'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_nextchar } }, +{ .keyv.c = META('d'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_nextword } }, +{ .keyv.c = CONTROL('E'), { 0, 0, 0, 0 }, f_move, { .m = m_eol } }, +{ .keyv.c = CONTROL('F'), { 0, 0, 0, 0 }, f_move, { .m = m_nextchar } }, +{ .keyv.c = META('f'), { 0, 0, 0, 0 }, f_move, { .m = m_nextword } }, +{ .keyv.c = CONTROL('G'), { t_sel, 0, 0, 0 }, f_select, { .m = m_stay } }, +{ .keyv.c = CONTROL('H'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_prevchar } }, +{ .keyv.c = CONTROL('I'), { t_sel, t_rw, 0, 0 }, f_pipelines, { .v = "sed 's/^/\\t/'" } }, +{ .keyv.c = CONTROL('I'), { t_rw, 0, 0, 0 }, f_insert, { .v = "\t" } }, +{ .keyv.c = CONTROL('J'), { t_rw, 0, 0, 0 }, f_insert, { .v = "\n" } }, +{ .keyv.c = CONTROL('J'), { 0, 0, 0, 0 }, f_move, { .m = m_nextline } }, +{ .keyv.c = CONTROL('K'), { t_eol, t_rw, 0, 0 }, f_delete, { .m = m_nextchar } }, +{ .keyv.c = CONTROL('K'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_eol } }, +{ .keyv.c = CONTROL('L'), { 0, 0, 0, 0 }, f_center, { 0 } }, +{ .keyv.c = META('l'), { t_sel, t_rw, 0, 0 }, f_pipe, { .v = "tr [A-Z] [a-z]" } }, +{ .keyv.c = CONTROL('M'), { t_rw, 0, 0, 0 }, f_insert, { .v = "\n" } }, +{ .keyv.c = CONTROL('M'), { 0, 0, 0, 0 }, f_move, { .m = m_nextline } }, +{ .keyv.c = CONTROL('N'), { 0, 0, 0, 0 }, f_move, { .m = m_nextline } }, +{ .keyv.c = CONTROL('O'), { t_sel, 0, 0, 0 }, f_select, { .m = m_tosel } }, /* Swap fsel and fcur */ +{ .keyv.c = CONTROL('P'), { 0, 0, 0, 0 }, f_move, { .m = m_prevline } }, +{ .keyv.c = CONTROL('Q'), { 0, 0, 0, 0 }, f_toggle, { .i = S_InsEsc } }, +{ .keyv.c = CONTROL('R'), { t_sel, 0, 0, 0 }, f_findbw, { 0 } }, +{ .keyv.c = CONTROL('R'), { 0, 0, 0, 0 }, f_spawn, FINDBW }, +{ .keyv.c = META('r'), { 0, 0, 0, 0 }, f_findbw, { 0 } }, +{ .keyv.c = CONTROL('S'), { t_sel, 0, 0, 0 }, f_findfw, { 0 } }, +{ .keyv.c = CONTROL('S'), { 0, 0, 0, 0 }, f_spawn, FIND }, +{ .keyv.c = META('s'), { 0, 0, 0, 0 }, f_findfw, { 0 } }, +{ .keyv.c = CONTROL('T'), { 0, 0, 0, 0 }, f_pipero , TOCLIP }, +{ .keyv.c = CONTROL('U'), { t_bol, t_rw, 0, 0 }, f_delete, { .m = m_prevchar } }, +{ .keyv.c = CONTROL('U'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_bol } }, +{ .keyv.c = META('u'), { t_sel, t_rw, 0, 0 }, f_pipe, { .v = "tr [a-z] [A-Z]" } }, +{ .keyv.c = CONTROL('V'), { 0, 0, 0, 0 }, f_move, { .m = m_prevscr } }, +{ .keyv.c = META('v'), { 0, 0, 0, 0 }, f_move, { .m = m_nextscr } }, +{ .keyv.c = CONTROL('W'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_prevword } }, +{ .keyv.c = CONTROL('X'), { t_mod, 0, 0, 0 }, f_save, { 0 } }, +{ .keyv.c = CONTROL('X'), { 0, 0, 0, 0 }, f_toggle, { .i = S_Running } }, +{ .keyv.c = CONTROL('Y'), { t_rw, 0, 0, 0 }, f_pipe, FROMCLIP }, +{ .keyv.c = CONTROL('Z'), { 0 ,0, 0, 0 }, f_suspend, { 0 } }, +{ .keyv.c = CONTROL('['), { 0, 0, 0, 0 }, f_spawn, CMD_P }, /* TODO: Sam's? */ +{ .keyv.c = CONTROL('\\'),{ 0, 0, 0, 0 }, f_spawn, PIPE }, +{ .keyv.c = CONTROL(']'), { 0, 0, 0, 0 }, f_extsel, { .i = ExtDefault } }, +{ .keyv.c = CONTROL('^'), { t_redo,t_rw, 0, 0 }, f_undo, { .i = -1 } }, +{ .keyv.c = CONTROL('^'), { t_rw, 0, 0, 0 }, f_repeat, { 0 } }, +{ .keyv.c = CONTROL('_'), { t_undo,t_rw, 0, 0 }, f_undo, { .i = 1 } }, +{ .keyv.c = CONTROL('?'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_prevchar } }, }; /* Commands read at the fifo */