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