sandy

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

commit 1d11756c5c8a35a27705b4c5bc3bbc8dcabb2597
parent 4e62363cbbfee8be8bed7e23895a5ee88e1d8ff9
Author: Rafael Garcia <rafael.garcia.gallego@gmail.com>
Date:   Mon,  1 Aug 2011 11:30:42 +0200

Some simple, useful META- keybindings are back. They are minor now. Use them ESC- if they conflict with your desktop/wm config.
Diffstat:
config.def.h | 15++++++++++++---
sandy.1 | 33+++++++++++++++++++++++----------
2 files changed, 35 insertions(+), 13 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -81,15 +81,20 @@ static const Key stdkeys[] = { { CONTROL('A'), { t_bol, 0, 0, 0 }, f_move, { .m = m_prevscr } }, { 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) } printf \"%s\", $0 }'" } }, { CONTROL('D'), { t_sel, t_rw, 0, 0 }, f_pipe, TOCLIP }, { CONTROL('D'), { t_rw, 0, 0, 0 }, f_delete, { .m = m_nextchar } }, { CONTROL('D'), { 0, 0, 0, 0 }, f_move, { .m = m_nextchar } }, +{ META('d'), { t_sel, t_rw, 0, 0 }, f_pipe, TOCLIP }, +{ META('d'), { 0, 0, 0, 0 }, f_select, { .m = m_nextword } }, { CONTROL('E'), { t_eol, 0, 0, 0 }, f_move, { .m = m_nextscr } }, { 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('G'), { 0, 0, 0, 0 }, f_toggle, { .i = S_Selecting } }, { CONTROL('H'), { t_sel, t_rw, 0, 0 }, f_pipe, TOCLIP }, @@ -103,22 +108,26 @@ static const Key stdkeys[] = { { CONTROL('K'), { t_eol, t_rw, 0, 0 }, f_delete, { .m = m_nextchar } }, { CONTROL('K'), { 0, 0, 0, 0 }, f_select, { .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'), { t_sel, t_rw, 0, 0 }, f_pipe, TOCLIP }, -{ CONTROL('Q'), { 0, 0, 0, 0 }, f_select, { .m = m_nextword } }, +{ 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_sel, t_rw, 0, 0 }, f_pipe, TOCLIP }, { CONTROL('U'), { t_bol, t_rw, 0, 0 }, f_delete, { .m = m_prevchar } }, { CONTROL('U'), { 0, 0, 0, 0 }, f_select, { .m = m_bol } }, -{ CONTROL('V'), { 0, 0, 0, 0 }, f_toggle, { .i = S_InsEsc } }, +{ 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_sel, t_rw, 0, 0 }, f_pipe, TOCLIP }, { CONTROL('W'), { 0, 0, 0, 0 }, f_select, { .m = m_prevword } }, { CONTROL('X'), { t_mod, 0, 0, 0 }, f_save, { 0 } }, diff --git a/sandy.1 b/sandy.1 @@ -61,24 +61,22 @@ Move cursor to next line. .BR Ctrl\-p " or " Up Move cursor to previous line. .TP -.BR Shift\-Right +.BR Meta\-f " or " Shift\-Right Move cursor to the end of this or next word. .TP -.BR Shift\-Left +.BR Meta\-b " or " Shift\-Left Move cursor to the start of this or previous word. .TP .BR Ctrl\-a " or " Home -Move cursor to the beginning of the current line or if already there, one full -screen up. +Move cursor to the beginning of the current line. .TP .BR Ctrl\-e " or " End -Move cursor to the end of the current line or if alredy there, one full screen -down. +Move cursor to the end of the current line. .TP -.BR Prev +.BR Ctrl\-v " or " Prev Move cursor one full screen up. .TP -.BR Next +.BR Met\-v " or " Next Move cursor one full screen down. .TP .BR Shift\-Home @@ -93,10 +91,16 @@ Text is searched and selected using POSIX regular expressions Prompt for a search regex forward or if there is a selection, repeat search forward. .TP +.B Meta\-s +Repeat search forward. +.TP .B Ctrl\-r Prompt for a search regex backwards or if there is a selection, repeat search backwards. .TP +.B Meta\-r +Repeat search backwards. +.TP .B Ctrl\-\] Extend selection to word, line, or full file from current. .TP @@ -125,7 +129,7 @@ Delete to end of line or join with next line. .B Ctrl\-w Delete to beginning of word or previous word. .TP -.B Ctrl\-q +.B Meta\-d Delete to end of word or next word. .TP .BR Ctrl\-Space " or " Ctrl\-` @@ -144,6 +148,15 @@ These operations affect the selected text if any. .B Ctrl\-\e Prompt for a command to pipe text through. .TP +.B Meta\-c +Capitalize selection. +.TP +.B Meta\-l +Lowercase selection. +.TP +.B Meta\-u +Uppercase selection. +.TP .BR Ctrl\-y " or " Shift\-Insert Replace (paste, yank) with text from the clipboard. .TP @@ -157,7 +170,7 @@ Copy to the clipboard and delete. .B Ctrl\-l Center screen in current line, refresh. .TP -.B Ctrl\-v +.B Ctrl\-q Insert next character as\-is. .TP .B Ctrl\-z