.CD "mined \(en \*(M2 editor"
.SX "mined\fR [\fIfile\fR]
.FL "\fR(none)"
.EX "mined /user/ast/book.3" "Edit an existing file"
.EX "mined" "Call editor to create a new file"
.EX "ls \(enl | mined" "Use \fImined\fR as a pager to inspect listing"
.PP
\fIMined\fR is a simple screen editor.
At any instant, a window of 24 lines is visible on the screen.
The current position in the file is shown by the cursor.
Ordinary characters typed in are inserted at the cursor.
Control characters and keys on the numeric keypad (at the right-hand side
of the keyboard) are used to move the cursor and perform other functions.
.PP
Commands exist to move forward and backward a word, and delete words
either in front of the cursor or behind it.
A word in this context is a sequence of characters delimited on both ends by
white space (space, tab, line feed, start of file, or end of file).
The commands for deleting characters and words also work on line feeds, making
it possible to join two consecutive lines by deleting the line feed between them.
.PP
The editor maintains one save buffer (not displayed).
Commands are present to move text from the file to the buffer, from the buffer
to the file, and to write the buffer onto a new file.
If the edited text cannot be written out due to a full disk, it may still
be possible to copy the whole text to the save buffer and then write it to a
different file on a different disk with CTRL-Q.
It may also be possible to escape from the editor with CTRL-S and remove
some files.
.PP
Some of the commands prompt for arguments (file names, search patterns, etc.).
All commands that might result in loss of the file being edited prompt to ask
for confirmation.
.PP
A key (command or ordinary character) can be repeated
.I n
times by typing
.I "ESC n key"
where 
.I ESC
is the \*(OQescape\*(CQ key.
.PP
Forward and backward searching requires a regular expression as the search
pattern.
Regular expressions follow the same rules as in the 
.Ux
editor,
.I ed .
These rules can be stated as:
.LI
.IT
Any displayable character matches itself.
.IT
\&. (period) matches any character except line feed.
.IT
\&^ (circumflex) matches the start of the line.
.IT
\&$ (dollar sign) matches the end of the line.
.IT
\&\\c matches the character \fIc\fR (including period, circumflex, etc).
.IT
[\fIstring\fR] matches any of the characters in the string.
.IT
[^string] matches any of the characters except those in the string.
.IT
[\fIx\(eny\fR] matches any characters between \fIx\fR and \fIy\fR (e.g., [\fIa\(enz\fR]).
.IT
Pattern\(** matches any number of occurrences of \fIpattern\fR.
.LX
Some examples of regular expressions are:
.HS
.in +1.25i
.ta +1.0i
.ti -1.0i
The boy	matches the string \*(OQThe boy\*(CQ
.ti -1.0i
^$	matches any empty line.
.ti -1.0i
^.$	matches any line containing exactly 1 character
.ti -1.0i
^A.*\\.$	matches any line starting with an \fIA\fR, ending with a period.
.ti -1.0i
^[A\(enZ]*$	matches any line containing only capital letters (or empty).
.ti -1.0i
[A\(enZ0\(en9]	matches any line containing either a capital letter or a digit.
.ti -1.0i
\&.*X$	matches any line ending in \*(OQX\*(CQ
.ti -1.0i
A.*B	matches any line containing an \*(OQA\*(CQ and then a \*(OQB\*(CQ
.in -1.25i
.sp
.PP
Control characters cannot be entered into a file simply by typing them because
all of them are editor commands.
To enter a control character, depress the ALT key, and then while holding it
down, hit the ESC key.
Release both ALT and ESC and type the control character.
Control characters are displayed in reverse video.
.PP
The 
.I mined
commands are as follows.
.sp
.in +1.25i
.ta +1.0i
.ti -1.25i
\fBCURSOR MOTION\fR
.ti -1.0i
\fBarrows\fR	Move the cursor in the indicated direction
.ti -1.0i
\fBCTRL-A\fR	Move cursor to start of current line
.ti -1.0i
\fBCTRL-Z\fR	Move cursor to end of current line
.ti -1.0i
\fBCTRL-^\fR	Move cursor to top of screen
.ti -1.0i
\fBCTRL-_\fR	Move cursor to end of screen
.ti -1.0i
\fBCTRL-F\fR	Move cursor forward to start of next word 
.ti -1.0i
\fBCTRL-B\fR	Move cursor backward to start of previous word 

.ti -1.25i
\fBSCREEN MOTION\fR
.ti -1.0i
\fBHome key\fR	Move to first character of the file
.ti -1.0i
\fBEnd key\fR	Move to last character of the file
.ti -1.0i
\fBPgUp key\fR	Scroll window up 23 lines (closer to start of the file)
.ti -1.0i
\fBPgDn key\fR	Scroll window down 23 lines (closer to end of the file)
.ti -1.0i
\fBCTRL-U\fR	Scroll window up 1 line
.ti -1.0i
\fBCTRL-D\fR	Scroll window down 1 line

.ti -1.25i
\fBMODIFYING TEXT\fR
.ti -1.0i
\fBDel key\fR	Delete the character under the cursor
.ti -1.0i
\fBBackspace\fR	Delete the character to left of the cursor
.ti -1.0i
\fBCTRL-N\fR	Delete the next word
.ti -1.0i
\fBCTRL-P\fR	Delete the previous word
.ti -1.0i
\fBCTRL-T\fR	Delete tail of line (all characters from cursor to end of line)
.ti -1.0i
\fBCTRL-O\fR	Open up the line (insert line feed and back up)
.ti -1.0i
\fBCTRL-G\fR	Get and insert a file at the cursor position

.ti -1.25i
\fBBUFFER OPERATIONS\fR
.ti -1.0i
\fBCTRL-@\fR	Set mark at current position for use with CTRL-C and CTRL-K
.ti -1.0i
\fBCTRL-C\fR	Copy the text between the mark and the cursor into the buffer
.ti -1.0i
\fBCTRL-K\fR	Delete text between mark and cursor; also copy it to the buffer
.ti -1.0i
\fBCTRL-Y\fR	Yank contents of the buffer out and insert it at the cursor
.ti -1.0i
\fBCTRL-Q\fR	Write the contents of the buffer onto a file

.ti -1.25i
\fBMISCELLANEOUS\fR
.ti -1.0i
\fBnumeric +\fR	Search forward (prompts for regular expression)
.ti -1.0i
\fBnumeric \(mi\fR	Search backward (prompts for regular expression)
.ti -1.0i
\fBnumeric 5\fR	Display the file status
.ti -1.0i
\fBCTRL-]\fR	Go to specific line
.ti -1.0i
\fBCTRL-R\fR	Global replace \fIpattern\fR with \fIstring\fR (from cursor to end)
.ti -1.0i
\fBCTRL-L\fR	Line replace \fIpattern\fR with \fIstring\fR 
.ti -1.0i
\fBCTRL-W\fR	Write the edited file back to the disk
.ti -1.0i
\fBCTRL-X\fR	Exit the editor
.ti -1.0i
\fBCTRL-S\fR	Fork off a shell (use CTRL-D to get back to the editor)
.ti -1.0i
\fBCTRL-\\\fR	Abort whatever the editor was doing and wait for command
.ti -1.0i
\fBCTRL-E\fR	Erase screen and redraw it
.ti -1.0i
\fBCTRL-V\fR	Visit (edit) a new file
.in -1.25i

.SS "Author"
.PP
\fIMined\fR was designed by Andy Tanenbaum and written by Michiel Huisjes.
