SANDY(1)

NAME
sandy - simple ncurses text editor

SYNOPSIS
sandy [-hru] [-t tabstop] [-s syntax] [File|-]

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.

OPTIONS

-h  Prints usage information to standard output, then exits.

-r  Opens the selected file read-only.

-s syntax
    Manually choose the syntax colors.

-t tabstop
    Use selected tabstop in characters.

-u  Reverse UTF-8 behavior. UTF-8 processing is on by default.

-v  Prints version information to standard output, then exits.

USAGE
The default key-bindings try to stick to the "emacs-mode" present in modern shells (specifically mksh(1)), which actually differs a bit from what emacs(1) does. External input is handled using dmenu(1) if the DISPLAY environment variable is set, read using sh(1) otherwise.

  Cursor movement
Cursor movement bindings can also be used to select text by pressing Ctrl-g to start a selection (see below)

Ctrl-f or Right
    Move cursor to next char.

Ctrl-b or Left
    Move cursor to previous char.

Ctrl-n or Down
    Move cursor to next line.

Ctrl-p or Up
    Move cursor to previous line.

Meta-f or Shift-Right
    Move cursor to the end of this or next word.

Meta-b or Shift-Left
    Move cursor to the start of this or previous word.

Ctrl-a or Home
    Move cursor to the beginning of the current line.

Ctrl-e or End
    Move cursor to the end of the current line.

Meta-, or Prev
    Move cursor one full screen up.

Meta-. or Next
    Move cursor one full screen down.

Meta-< or Shift-Home
    Move cursor to the beginning of the file.

Meta-> or Shift-End
    Move cursor to the end of the file.

Meta-g
    Prompt for a line number and go there.

  Finding and selecting
Text is searched and selected using POSIX regular expressions

Ctrl-s
    Prompt for a search regex forward.

Meta-s
    Search forward using the (first line of the) current selection as a regex.

Ctrl-r
    Prompt for a search regex backwards.

Meta-r
    Search backwards using the (first line of the) current selection as a regex.

Meta-n
    Find next occurrence of last search forward.

Meta-p
    Find next occurrence of last search backwards.

Ctrl-x
    Extend selection to word, line, or full file from current.

Meta-x
    Select full file.

Ctrl-g
    Cancel selection, or start selecting text manually.

Meta-i
    Toggle case (in)sensitive search.

  Deleting
If any text is selected, any of these bindings deletes it and, unless Backspace or Delete, moves it to the clipboard. Otherwise they behave as per this text. In read-only mode, these bindings select text instead.

Ctrl-d or Delete
    Delete next character.

Ctrl-h or Backspace
    Delete previous character.

Ctrl-u
    Delete to beginning of line or join with previous line.

Ctrl-k
    Delete to end of line or join with next line.

Ctrl-w
    Delete to beginning of word or previous word.

Meta-d
    Delete to end of word or next word.

  Mark
The mark is a single fixed position in the file that can be used as bookmark.

Meta-Space
    Set mark in current position.

Ctrl-` or Ctrl-Space
    Go to mark. Prepend with Ctrl-g to select to mark.

  File operations

Meta-q
    Quit if the file has not been modified.

Meta-Shift-q
    Quit unconditionally.

Meta-w
    Write changes to disk.

Meta-Shift-w
    Prompt for a different filename to save the file as.

  Text operations
These operations affect the selected text if any.

Ctrl-\
    Prompt for a command to pipe text through.

Ctrl-y or Shift-Insert
    Replace (paste, yank) with text from the clipboard.

Ctrl-c or Insert
    Copy to the clipboard.

Shift-Delete
    Copy to the clipboard and delete.

  Other

Ctrl-l
    Center screen in current line.

Ctrl-v
    Insert next character as-is.

Meta-Shift-r
    Toggle read-only status for file.

Meta-Shift-s
    Prompt for a file syntax to use.

SEE ALSO
sed(1) xprop(1) zenity(1)

BUGS
Please report them!