3 .CD "mined \(en \*(M2 editor"
4 .SX "mined\fR [\fIfile\fR]
6 .EX "mined /user/ast/book.3" "Edit an existing file"
7 .EX "mined" "Call editor to create a new file"
8 .EX "ls \(enl | mined" "Use \fImined\fR as a pager to inspect listing"
10 \fIMined\fR is a simple screen editor.
11 At any instant, a window of 24 lines is visible on the screen.
12 The current position in the file is shown by the cursor.
13 Ordinary characters typed in are inserted at the cursor.
14 Control characters and keys on the numeric keypad (at the right-hand side
15 of the keyboard) are used to move the cursor and perform other functions.
17 Commands exist to move forward and backward a word, and delete words
18 either in front of the cursor or behind it.
19 A word in this context is a sequence of characters delimited on both ends by
20 white space (space, tab, line feed, start of file, or end of file).
21 The commands for deleting characters and words also work on line feeds, making
22 it possible to join two consecutive lines by deleting the line feed between them.
24 The editor maintains one save buffer (not displayed).
25 Commands are present to move text from the file to the buffer, from the buffer
26 to the file, and to write the buffer onto a new file.
27 If the edited text cannot be written out due to a full disk, it may still
28 be possible to copy the whole text to the save buffer and then write it to a
29 different file on a different disk with CTRL-Q.
30 It may also be possible to escape from the editor with CTRL-S and remove
33 Some of the commands prompt for arguments (file names, search patterns, etc.).
34 All commands that might result in loss of the file being edited prompt to ask
37 A key (command or ordinary character) can be repeated
43 is the \*(OQescape\*(CQ key.
45 Forward and backward searching requires a regular expression as the search
47 Regular expressions follow the same rules as in the
51 These rules can be stated as:
54 Any displayable character matches itself.
56 \&. (period) matches any character except line feed.
58 \&^ (circumflex) matches the start of the line.
60 \&$ (dollar sign) matches the end of the line.
62 \&\\c matches the character \fIc\fR (including period, circumflex, etc).
64 [\fIstring\fR] matches any of the characters in the string.
66 [^string] matches any of the characters except those in the string.
68 [\fIx\(eny\fR] matches any characters between \fIx\fR and \fIy\fR (e.g., [\fIa\(enz\fR]).
70 Pattern\(** matches any number of occurrences of \fIpattern\fR.
72 Some examples of regular expressions are:
77 The boy matches the string \*(OQThe boy\*(CQ
79 ^$ matches any empty line.
81 ^.$ matches any line containing exactly 1 character
83 ^A.*\\.$ matches any line starting with an \fIA\fR, ending with a period.
85 ^[A\(enZ]*$ matches any line containing only capital letters (or empty).
87 [A\(enZ0\(en9] matches any line containing either a capital letter or a digit.
89 \&.*X$ matches any line ending in \*(OQX\*(CQ
91 A.*B matches any line containing an \*(OQA\*(CQ and then a \*(OQB\*(CQ
95 Control characters cannot be entered into a file simply by typing them because
96 all of them are editor commands.
97 To enter a control character, depress the ALT key, and then while holding it
98 down, hit the ESC key.
99 Release both ALT and ESC and type the control character.
100 Control characters are displayed in reverse video.
104 commands are as follows.
111 \fBarrows\fR Move the cursor in the indicated direction
113 \fBCTRL-A\fR Move cursor to start of current line
115 \fBCTRL-Z\fR Move cursor to end of current line
117 \fBCTRL-^\fR Move cursor to top of screen
119 \fBCTRL-_\fR Move cursor to end of screen
121 \fBCTRL-F\fR Move cursor forward to start of next word
123 \fBCTRL-B\fR Move cursor backward to start of previous word
128 \fBHome key\fR Move to first character of the file
130 \fBEnd key\fR Move to last character of the file
132 \fBPgUp key\fR Scroll window up 23 lines (closer to start of the file)
134 \fBPgDn key\fR Scroll window down 23 lines (closer to end of the file)
136 \fBCTRL-U\fR Scroll window up 1 line
138 \fBCTRL-D\fR Scroll window down 1 line
143 \fBDel key\fR Delete the character under the cursor
145 \fBBackspace\fR Delete the character to left of the cursor
147 \fBCTRL-N\fR Delete the next word
149 \fBCTRL-P\fR Delete the previous word
151 \fBCTRL-T\fR Delete tail of line (all characters from cursor to end of line)
153 \fBCTRL-O\fR Open up the line (insert line feed and back up)
155 \fBCTRL-G\fR Get and insert a file at the cursor position
158 \fBBUFFER OPERATIONS\fR
160 \fBCTRL-@\fR Set mark at current position for use with CTRL-C and CTRL-K
162 \fBCTRL-C\fR Copy the text between the mark and the cursor into the buffer
164 \fBCTRL-K\fR Delete text between mark and cursor; also copy it to the buffer
166 \fBCTRL-Y\fR Yank contents of the buffer out and insert it at the cursor
168 \fBCTRL-Q\fR Write the contents of the buffer onto a file
173 \fBnumeric +\fR Search forward (prompts for regular expression)
175 \fBnumeric \(mi\fR Search backward (prompts for regular expression)
177 \fBnumeric 5\fR Display the file status
179 \fBCTRL-]\fR Go to specific line
181 \fBCTRL-R\fR Global replace \fIpattern\fR with \fIstring\fR (from cursor to end)
183 \fBCTRL-L\fR Line replace \fIpattern\fR with \fIstring\fR
185 \fBCTRL-W\fR Write the edited file back to the disk
187 \fBCTRL-X\fR Exit the editor
189 \fBCTRL-S\fR Fork off a shell (use CTRL-D to get back to the editor)
191 \fBCTRL-\\\fR Abort whatever the editor was doing and wait for command
193 \fBCTRL-E\fR Erase screen and redraw it
195 \fBCTRL-V\fR Visit (edit) a new file
200 \fIMined\fR was designed by Andy Tanenbaum and written by Michiel Huisjes.