sandy

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

commit 98639e1b699e81febedfcacb7a7cbe121cfedad7
parent 6f87230d99a0462c2354f4ec07a96feabce0ea3a
Author: Rafael Garcia <rafael.garcia.gallego@gmail.com>
Date:   Fri,  5 Aug 2011 01:45:37 +0200

Manpage update, a couple more keybindings.
Diffstat:
config.def.h | 2++
sandy.1 | 58+++++++++++++++++++++++++++++++++-------------------------
2 files changed, 35 insertions(+), 25 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -77,6 +77,8 @@ static const Key curskeys[] = { /* Plain keys here, no CONTROL or META */ static const Key stdkeys[] = { /* keyv.c, test, func, arg */ { .keyv.c = CONTROL('@'), { 0, 0, 0, 0 }, f_move, { .m = m_tomark } }, +{ .keyv.c = META(' '), { 0, 0, 0, 0 }, f_mark, { 0 } }, +{ .keyv.c = META('`'), { 0, 0, 0, 0 }, f_mark, { 0 } }, { .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 } }, diff --git a/sandy.1 b/sandy.1 @@ -10,9 +10,10 @@ sandy \- simple ncurses text editor .IR syntax ] .RI [ file |\-] .SH DESCRIPTION -sandy is a simple ncurses text editor. It loads and saves files and lets you -perform basic editing and pipe the selection through arbitrary commands. -A small degree of external control can be achieved by writing to a named pipe. +sandy is a simple modeless ncurses text editor. It loads and saves files and +lets you perform basic editing and pipe the selection through arbitrary +commands. A small degree of external control can be achieved by writing to a +named pipe. .SH OPTIONS .TP .B \-h @@ -45,15 +46,15 @@ if the DISPLAY environment variable is set, read using .IR sh (1) otherwise. Similarly, X11 clipboard interaction occurs through .IR xsel (1) -if DISPLAY is set, using a hidden file in the HOME directory otherwise. +if DISPLAY is set, using a hidden file in the /tmp directory otherwise. .SS Cursor movement Cursor movement bindings are used to move the text insertion point and -optionally to select text. Special keys (such as arrows, Home/End, Prev/Next) +optionally to select text. Special keys (such as arrows, Home/End, Prev/Next) move the cursor and cancel any selection; they can be used to browse the text. -Control keybindings extend or shrink the selection by moving the end at the -insertion point; they are useful to perform minor changes without taking your -fingers off the home row. Remember to cancel the selection with Ctrl\-g -before moving to select a new piece of text. +Control or Meta keybindings extend or shrink the selection by moving the end +at the insertion point; they are useful to perform minor changes without +taking your fingers off the home row. Remember to cancel the selection with +Ctrl\-g before moving to select a new piece of text. .TP .BR Ctrl\-f " or " Right Move cursor to next char. @@ -82,16 +83,24 @@ Move cursor to the end of the current line. .BR Ctrl\-v " or " Prev Move cursor one full screen up. .TP -.BR Met\-v " or " Next +.BR Meta\-v " or " Next Move cursor one full screen down. .TP -.BR Shift\-Home +.BR Meta\-, " or " Shift\-Home Move cursor to the beginning of the file. .TP -.BR Shift\-End +.BR Meta\-. " or " Shift\-End Move cursor to the end of the file. +.TP +.BR Ctrl\-Space " or " Ctrl\-` +Set mark in current position, then go to mark. +.TP +.BR Meta\-Space " or " Meta\-` +Manually set mark in current position. .SS Finding and selecting -Text is searched (and selected) using POSIX regular expressions +Text is searched (and selected) using POSIX regular expressions. Every time +your search matches anything, the mark is set to your previous position so you +can return there easily with Ctrl\-space. .TP .B Ctrl\-s Prompt for a search regex forward or if there is a selection, repeat search @@ -108,7 +117,7 @@ search backwards. Repeat search backwards. .TP .B Ctrl\-\] -Extend selection to word, line, or full file from current. +Extend selection to line, or full file from current. .TP .B Ctrl\-g Cancel current selection. @@ -116,10 +125,12 @@ Cancel current selection. .B Ctrl\-o Move to the opposite size of the selection, usually to modify it. .SS Deleting -TODO +Unlike in most other text editors, inserting text while a selection is active does not delete its content. .TP -.BR Ctrl\-d " or " Delete -Delete next character. +.BR Ctrl\-d " or " Delete " or " Shift\-Delete +Delete ithe current selection if any or the character under the cursor +otherwise. Ctrl\-d and Shift\-Delete put the selection in the clipboard while +Dlete just kills it. .TP .BR Ctrl\-h " or " Backspace Delete previous character. @@ -135,14 +146,10 @@ Delete to beginning of word or previous word. .TP .B Meta\-d Delete to end of word or next word. -.TP -.BR Ctrl\-Space " or " Ctrl\-` -Set mark in current position. -Go to mark. Prepend with Ctrl\-g to select to mark. .SS File operations .TP .BR Ctrl\-c -Quit if the file has not been modified. Repeat to quit unconditionally. +Quit if the file has not been modified. Repeat to quit unconditionally. .TP .B Ctrl\-x Write changes to disk or quit if the file is not modified. @@ -167,15 +174,16 @@ Replace (paste, yank) with text from the clipboard. .BR Ctrl\-t " or " Insert Copy to the clipboard. .TP -.B Shift\-Delete -Copy to the clipboard and delete. +.BR (Again) Ctrl\-d " or " Chift\-Delete +If there is any selection, cut to the clipboard. .SS Other .TP .B Ctrl\-l Center screen in current line, refresh. .TP .B Ctrl\-q -Insert next character as\-is. +Insert next character as\-is. This is modal and sucks, but there simply was no +other way. .TP .B Ctrl\-z Suspend editor to shell.