sandy

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

sandy.1 (5731B)


      1 .TH SANDY 1 sandy\-VERSION
      2 .SH NAME
      3 sandy \- simple ncurses text editor
      4 .SH SYNOPSIS
      5 .B sandy
      6 .RB [ \-adhruS ]
      7 .RB [ \-t
      8 .IR tabstop ]
      9 .RB [ \-s
     10 .IR syntax ]
     11 .RI [ file |\-]
     12 .SH DESCRIPTION
     13 sandy is a simple modeless ncurses text editor.  It loads and saves files and
     14 lets you perform basic editing and pipe the selection through arbitrary
     15 commands.  A small degree of external control can be achieved by writing to a
     16 named pipe.  Sandy can also capture text from the standard input and edit it
     17 instead of a file as well as dump the buffer to the standard output instead of
     18 writing it to a file.
     19 .SH OPTIONS
     20 .TP
     21 .B \-a
     22 Autoindents text while editing.
     23 .TP
     24 .B \-d
     25 Dumps to stdout instead of writing to a file; causes saving to exit immediately.
     26 .TP
     27 .B \-h
     28 Prints usage information to stderr, then exits.
     29 .TP
     30 .B \-r
     31 Opens the selected file read\-only.
     32 .TP
     33 .BI \-s " syntax"
     34 Manually choose the syntax colors.
     35 .TP
     36 .B \-S
     37 Use no syntax colors at all.
     38 .TP
     39 .BI \-t " tabstop"
     40 Use selected tabstop in characters.
     41 .TP
     42 .B \-v
     43 Prints version information to stderr, then exits.
     44 .SH USAGE
     45 The default key\-bindings try to stick to the "emacs\-mode" present in modern
     46 shells (specifically
     47 .IR mksh (1)),
     48 which actually differs a bit from what
     49 .IR emacs (1)
     50 does.  Text is selected manually with the mouse or keyboard, or automtically
     51 when you search, pipe, undo or enter new text.  External input is handled using
     52 .IR dmenu (1)
     53 if the DISPLAY environment variable is set, read using
     54 .IR sh (1)
     55 otherwise.  Similarly, X11 clipboard interaction occurs through
     56 .IR xsel (1)
     57 if DISPLAY is set, using a hidden file in the /tmp directory otherwise.
     58 .SS Cursor movement
     59 Cursor movement bindings are used to move the text insertion point and
     60 optionally to select text.  Special keys (such as arrows, Home/End, Prev/Next)
     61 move the cursor and cancel any selection; they can be used to browse the text.
     62 Control or Meta keybindings extend or shrink the selection by moving the end
     63 at the insertion point; they are useful to perform minor changes without
     64 taking your fingers off the home row.  Remember to cancel the selection with
     65 Ctrl\-g before moving to select a new piece of text.
     66 .TP
     67 .BR Ctrl\-f " or " Right
     68 Move cursor to next char.
     69 .TP
     70 .BR Ctrl\-b " or " Left
     71 Move cursor to previous char.
     72 .TP
     73 .BR Ctrl\-n " or " Down
     74 Move cursor to next line.
     75 .TP
     76 .BR Ctrl\-p " or " Up
     77 Move cursor to previous line.
     78 .TP
     79 .BR Meta\-f " or " Shift\-Right
     80 Move cursor to the end of this or next word.
     81 .TP
     82 .BR Meta\-b " or " Shift\-Left
     83 Move cursor to the start of this or previous word.
     84 .TP
     85 .BR Ctrl\-a " or " Home
     86 Move cursor to the beginning of the current line.
     87 .TP
     88 .BR Ctrl\-e " or " End
     89 Move cursor to the end of the current line.
     90 .TP
     91 .BR Ctrl\-v " or " Prev
     92 Move cursor one full screen up.
     93 .TP
     94 .BR Meta\-v " or " Next
     95 Move cursor one full screen down.
     96 .TP
     97 .BR Meta\-, " or " Shift\-Home
     98 Move cursor to the beginning of the file.
     99 .TP
    100 .BR Meta\-. " or " Shift\-End
    101 Move cursor to the end of the file.
    102 .TP
    103 .BR Ctrl\-Space " or " Ctrl\-`
    104 Set mark in current position, then go to mark.
    105 .TP
    106 .BR Meta\-Space " or " Meta\-`
    107 Manually set mark in current position.
    108 .SS Finding and selecting
    109 Text is searched (and selected) using POSIX regular expressions.  Every time
    110 your search matches anything, the mark is set to your previous position so you
    111 can return there easily with Ctrl\-space.
    112 .TP
    113 .B Ctrl\-s
    114 Prompt for a search regex forward or if there is a selection, repeat search
    115 forward.
    116 .TP
    117 .B Meta\-s
    118 Repeat search forward.
    119 .TP
    120 .B Ctrl\-r
    121 Prompt for a search regex backwards or if there is a selection, repeat
    122 search backwards.
    123 .TP
    124 .B Meta\-r
    125 Repeat search backwards.
    126 .TP
    127 .B Ctrl\-\]
    128 Extend selection to word, line or full file from current.
    129 .TP
    130 .B Ctrl\-g
    131 Cancel current selection.
    132 .TP
    133 .B Ctrl\-o
    134 Move to the opposite size of the selection, usually to modify it.
    135 .SS Deleting
    136 Unlike in most other text editors, inserting text while a selection is active does not delete its content.
    137 .TP
    138 .BR Ctrl\-d
    139 Kill the current selection and put it in the clipboard. If there is no selection, delete next character.
    140 .TP
    141 .BR Delete " or " Shift\-Delete
    142 Delete the current selection if any. Otherwise delete next character.
    143 .TP
    144 .BR Backspace
    145 Delete previous character.
    146 .TP
    147 .B Ctrl\-u
    148 Delete to beginning of line or join with previous line.
    149 .TP
    150 .B Ctrl\-k
    151 Delete to end of line or join with next line.
    152 .TP
    153 .B Ctrl\-w
    154 Delete to beginning of word or previous word.
    155 .TP
    156 .B Meta\-d
    157 Delete to end of word or next word.
    158 .SS File operations
    159 .TP
    160 .BR Ctrl\-c
    161 Quit if the file has not been modified.  Repeat to quit unconditionally.
    162 .TP
    163 .B Ctrl\-x
    164 Quit if the file is not modified. Otherwise write changes to disk.
    165 .SS Text operations
    166 These operations affect the selected text if any.
    167 .TP
    168 .B Ctrl\-\e
    169 Prompt for a command to pipe text through.
    170 .TP
    171 .B Meta\-\e
    172 Prompt for a sed command to pipe text through.
    173 .TP
    174 .B Meta\-5
    175 Prompt for a literal string to replace the text.
    176 .TP
    177 .B Meta\-6
    178 Delete newline characters, joining lines.
    179 .TP
    180 .B Meta\-c
    181 Capitalize selection.
    182 .TP
    183 .B Meta\-l
    184 Lowercase selection.
    185 .TP
    186 .B Meta\-u
    187 Uppercase selection.
    188 .TP
    189 .BR Ctrl\-y " or " Shift\-Insert
    190 Add (paste, yank) text from the clipboard.
    191 .TP
    192 .BR Ctrl\-t " or " Insert
    193 Copy to the clipboard.
    194 .TP
    195 .BR (Again) Ctrl\-d " or " Shift\-Delete
    196 If there is any selection, cut to the clipboard.
    197 .SS Other
    198 .TP
    199 .B Ctrl\-l
    200 Center screen in current line, refresh.
    201 .TP
    202 .B Ctrl\-q
    203 Insert next character as\-is.  This is modal and sucks, but there simply was no
    204 other way.
    205 .TP
    206 .B Ctrl\-_
    207 Undo the last action.
    208 .TP
    209 .B Ctrl\-^
    210 Redo or repeat the previous action.
    211 .TP
    212 .B Ctrl\-z
    213 Suspend editor to shell.
    214 .TP
    215 .BR Meta\-x " or " Ctrl\-[ " or " Esc
    216 Prompt for command.
    217 .SH SEE ALSO
    218 .IR dmenu (1),
    219 .IR xsel (1)
    220 .SH BUGS
    221 Please report them!