Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | .\" Copyright (c) 1980 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" Redistribution and use in source and binary forms, with or without | |
5 | .\" modification, are permitted provided that the following conditions | |
6 | .\" are met: | |
7 | .\" 1. Redistributions of source code must retain the above copyright | |
8 | .\" notice, this list of conditions and the following disclaimer. | |
9 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer in the | |
11 | .\" documentation and/or other materials provided with the distribution. | |
12 | .\" 3. All advertising materials mentioning features or use of this software | |
13 | .\" must display the following acknowledgement: | |
14 | .\" This product includes software developed by the University of | |
15 | .\" California, Berkeley and its contributors. | |
16 | .\" 4. Neither the name of the University nor the names of its contributors | |
17 | .\" may be used to endorse or promote products derived from this software | |
18 | .\" without specific prior written permission. | |
19 | .\" | |
20 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
21 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
22 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
23 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
24 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
25 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
26 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
27 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
28 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
30 | .\" SUCH DAMAGE. | |
31 | .\" | |
32 | .\" @(#)vi.chars 6.3 (Berkeley) 4/17/91 | |
33 | .\" | |
34 | .bd S 3 | |
78ed81a3 | 35 | .pn 21 |
15637ed4 RG |
36 | .de iP |
37 | .IP "\fB\\$1\fR" \\$2 | |
38 | .. | |
39 | .SH | |
40 | Appendix: character functions | |
41 | .PP | |
42 | This appendix gives the uses the editor makes of each character. The | |
43 | characters are presented in their order in the \s-2ASCII\s0 character | |
44 | set: Control characters come first, then most special characters, then | |
45 | the digits, upper and then lower case characters. | |
46 | .PP | |
47 | For each character we tell a meaning it has as a command and any meaning it | |
48 | has during an insert. | |
49 | If it has only meaning as a command, then only this is discussed. | |
50 | Section numbers in parentheses indicate where the character is discussed; | |
51 | a `f' after the section number means that the character is mentioned | |
52 | in a footnote. | |
53 | .iP "^@" 15 | |
54 | Not a command character. | |
55 | If typed as the first character of an insertion it is replaced with the | |
56 | last text inserted, and the insert terminates. Only 128 characters are | |
57 | saved from the last insert; if more characters were inserted the mechanism | |
58 | is not available. | |
59 | A \fB^@\fR cannot be part of the file due to the editor implementation | |
60 | (7.5f). | |
61 | .iP "^A" 15 | |
62 | Unused. | |
63 | .iP "^B" 15 | |
64 | Backward window. | |
65 | A count specifies repetition. | |
66 | Two lines of continuity are kept if possible (2.1, 6.1, 7.2). | |
67 | .iP "^C" 15 | |
68 | Unused. | |
69 | .iP "^D" 15 | |
70 | As a command, scrolls down a half-window of text. | |
71 | A count gives the number of (logical) lines to scroll, and is remembered | |
72 | for future \fB^D\fR and \fB^U\fR commands (2.1, 7.2). | |
73 | During an insert, backtabs over \fIautoindent\fR white space at the beginning | |
74 | of a line (6.6, 7.5); this white space cannot be backspaced over. | |
75 | .iP "^E" 15 | |
76 | Exposes one more line below the current screen in the file, leaving | |
77 | the cursor where it is if possible. | |
78 | (Version 3 only.) | |
79 | .iP "^F" 15 | |
80 | Forward window. A count specifies repetition. | |
81 | Two lines of continuity are kept if possible (2.1, 6.1, 7.2). | |
82 | .iP "^G" 15 | |
83 | Equivalent to \fB:f\fR\s-2CR\s0, printing the current file, whether | |
84 | it has been modified, the current line number and the number of lines | |
85 | in the file, and the percentage of the way through the file that you | |
86 | are. | |
87 | .iP "^H (\fR\s-2BS\s0\fP)" 15 | |
88 | Same as | |
89 | .B "left arrow" . | |
90 | (See | |
91 | .B h ). | |
92 | During an insert, eliminates the last input character, backing over it | |
93 | but not erasing it; it remains so you can see what you typed if you | |
94 | wish to type something only slightly different (3.1, 7.5). | |
95 | .iP "^I\ (\fR\s-2TAB\s0\fP)" 15 | |
96 | Not a command character. | |
97 | When inserted it prints as some | |
98 | number of spaces. | |
99 | When the cursor is at a tab character it rests at the last of the spaces | |
100 | which represent the tab. | |
101 | The spacing of tabstops is controlled by the \fItabstop\fR option (4.1, 6.6). | |
102 | .iP "^J\ (\fR\s-2LF\s0\fP)" 15 | |
103 | Same as | |
104 | .B "down arrow" | |
105 | (see | |
106 | .B j ). | |
107 | .iP "^K" 15 | |
108 | Unused. | |
109 | .iP "^L" 15 | |
110 | The \s-2ASCII\s0 formfeed character, this causes the screen to be cleared | |
111 | and redrawn. This is useful after a transmission error, if characters | |
112 | typed by a program other than the editor scramble the screen, | |
113 | or after output is stopped by an interrupt (5.4, 7.2f). | |
114 | .iP "^M\ (\fR\s-2CR\s0\fP)" 15 | |
115 | A carriage return advances to the next line, at the first non-white position | |
116 | in the line. Given a count, it advances that many lines (2.3). | |
117 | During an insert, a \s-2CR\s0 causes the insert to continue onto | |
118 | another line (3.1). | |
119 | .iP "^N" 15 | |
120 | Same as | |
121 | .B "down arrow" | |
122 | (see | |
123 | .B j ). | |
124 | .iP "^O" 15 | |
125 | Unused. | |
126 | .iP "^P" 15 | |
127 | Same as | |
128 | .B "up arrow" | |
129 | (see | |
130 | .B k ). | |
131 | .iP "^Q" 15 | |
132 | Not a command character. | |
133 | In input mode, | |
134 | .B ^Q | |
135 | quotes the next character, the same as | |
136 | .B ^V , | |
137 | except that some teletype drivers will eat the | |
138 | .B ^Q | |
139 | so that the editor never sees it. | |
140 | .iP "^R" 15 | |
141 | Redraws the current screen, eliminating logical lines not corresponding | |
142 | to physical lines (lines with only a single @ character on them). | |
143 | On hardcopy terminals in \fIopen\fR mode, retypes the current line | |
144 | (5.4, 7.2, 7.8). | |
145 | .iP "^S" 15 | |
146 | Unused. Some teletype drivers use | |
147 | .B ^S | |
148 | to suspend output until | |
149 | .B ^Q is pressed. | |
150 | .iP "^T" 15 | |
151 | Not a command character. | |
152 | During an insert, with \fIautoindent\fR set and at the beginning of the | |
153 | line, inserts \fIshiftwidth\fR white space. | |
154 | .iP "^U" 15 | |
155 | Scrolls the screen up, inverting \fB^D\fR which scrolls down. Counts work as | |
156 | they do for \fB^D\fR, and the previous scroll amount is common to both. | |
157 | On a dumb terminal, \fB^U\fR will often necessitate clearing and redrawing | |
158 | the screen further back in the file (2.1, 7.2). | |
159 | .iP "^V" 15 | |
160 | Not a command character. | |
161 | In input mode, quotes the next character so that it is possible | |
162 | to insert non-printing and special characters into the file (4.2, 7.5). | |
163 | .iP "^W" 15 | |
164 | Not a command character. | |
165 | During an insert, backs up as \fBb\fR would in command mode; the deleted | |
166 | characters remain on the display (see \fB^H\fR) (7.5). | |
167 | .iP "^X" 15 | |
168 | Unused. | |
169 | .iP "^Y" 15 | |
170 | Exposes one more line above the current screen, leaving the cursor where | |
171 | it is if possible. (No mnemonic value for this key; however, it is next | |
172 | to \fB^U\fR which scrolls up a bunch.) | |
173 | (Version 3 only.) | |
174 | .iP "^Z" 15 | |
175 | If supported by the Unix system, | |
176 | stops the editor, exiting to the top level shell. | |
177 | Same as \fB:stop\fP\s-2CR\s0. | |
178 | Otherwise, unused. | |
179 | .iP "^[\ (\fR\s-2ESC\s0\fP)" 15 | |
180 | Cancels a partially formed command, such as a \fBz\fR when no following | |
181 | character has yet been given; terminates inputs on the last line (read | |
182 | by commands such as \fB: /\fR and \fB?\fR); ends insertions of new text | |
183 | into the buffer. | |
184 | If an \s-2ESC\s0 is given when quiescent in command state, the editor | |
185 | rings the bell or flashes the screen. You can thus hit \s-2ESC\s0 if | |
186 | you don't know what is happening till the editor rings the bell. | |
187 | If you don't know if you are in insert mode you can type \s-2ESC\s0\fBa\fR, | |
188 | and then material to be input; the material will be inserted correctly | |
189 | whether or not you were in insert mode when you started (1.5, 3.1, 7.5). | |
190 | .iP "^\e" 15 | |
191 | Unused. | |
192 | .iP "^]" 15 | |
193 | Searches for the word which is after the cursor as a tag. Equivalent | |
194 | to typing \fB:ta\fR, this word, and then a \s-2CR\s0. | |
195 | Mnemonically, this command is ``go right to'' (7.3). | |
196 | .iP "^\(ua" 15 | |
197 | Equivalent to \fB:e #\fR\s-2CR\s0, returning to the previous position | |
198 | in the last edited file, or editing a file which you specified if you | |
199 | got a `No write since last change diagnostic' and do not want to have | |
200 | to type the file name again (7.3). | |
201 | (You have to do a \fB:w\fR before \fB^\(ua\fR | |
202 | will work in this case. If you do not wish to write the file you should | |
203 | do \fB:e!\ #\fR\s-2CR\s0 instead.) | |
204 | .iP "^_" 15 | |
205 | Unused. | |
206 | Reserved as the command character for the | |
207 | Tektronix 4025 and 4027 terminal. | |
208 | .iP "\fR\s-2SPACE\s0\fP" 15 | |
209 | Same as | |
210 | .B "right arrow" | |
211 | (see | |
212 | .B l ). | |
213 | .iP "!" 15 | |
214 | An operator, which processes lines from the buffer with reformatting commands. | |
215 | Follow \fB!\fR with the object to be processed, and then the command name | |
216 | terminated by \s-2CR\s0. Doubling \fB!\fR and preceding it by a count | |
217 | causes count lines to be filtered; otherwise the count | |
218 | is passed on to the object after the \fB!\fR. Thus \fB2!}\fR\fIfmt\fR\s-2CR\s0 | |
219 | reformats the next two paragraphs by running them through the program | |
220 | \fIfmt\fR. If you are working on \s-2LISP\s0, | |
221 | the command \fB!%\fR\fIgrind\fR\s-2CR\s0,* | |
222 | .FS | |
223 | *Both | |
224 | .I fmt | |
225 | and | |
226 | .I grind | |
227 | are Berkeley programs and may not be present at all installations. | |
228 | .FE | |
229 | given at the beginning of a | |
230 | function, will run the text of the function through the \s-2LISP\s0 grinder | |
231 | (6.7, 7.3). | |
232 | To read a file or the output of a command into the buffer use \fB:r\fR (7.3). | |
233 | To simply execute a command use \fB:!\fR (7.3). | |
234 | .tr \a" | |
235 | .iP \a 15 | |
236 | Precedes a named buffer specification. There are named buffers \fB1\-9\fR | |
237 | used for saving deleted text and named buffers \fBa\-z\fR into which you can | |
238 | place text (4.3, 6.3) | |
239 | .tr \a\a | |
240 | .iP "#" 15 | |
241 | The macro character which, when followed by a number, will substitute | |
242 | for a function key on terminals without function keys (6.9). | |
243 | In input mode, | |
244 | if this is your erase character, it will delete the last character | |
245 | you typed in input mode, and must be preceded with a \fB\e\fR to insert | |
246 | it, since it normally backs over the last input character you gave. | |
247 | .iP "$" 15 | |
248 | Moves to the end of the current line. If you \fB:se list\fR\s-2CR\s0, | |
249 | then the end of each line will be shown by printing a \fB$\fR after the | |
250 | end of the displayed text in the line. Given a count, advances to the | |
251 | count'th following end of line; thus \fB2$\fR advances to the end of the | |
252 | following line. | |
253 | .iP "%" 15 | |
254 | Moves to the parenthesis or brace \fB{ }\fR which balances the parenthesis | |
255 | or brace at the current cursor position. | |
256 | .iP "&" 15 | |
257 | A synonym for \fB:&\fR\s-2CR\s0, by analogy with the | |
258 | .I ex | |
259 | .B & | |
260 | command. | |
261 | .iP "\(aa" 15 | |
262 | When followed by a \fB\(aa\fR returns to the previous context at the | |
263 | beginning of a line. The previous context is set whenever the current | |
264 | line is moved in a non-relative way. | |
265 | When followed by a letter \fBa\fR\-\fBz\fR, returns to the line which | |
266 | was marked with this letter with a \fBm\fR command, at the first non-white | |
267 | character in the line. (2.2, 5.3). | |
268 | When used with an operator such as \fBd\fR, the operation takes place | |
269 | over complete lines; if you use \fB\(ga\fR, the operation takes place | |
270 | from the exact marked place to the current cursor position within the | |
271 | line. | |
272 | .iP "(" 15 | |
273 | Retreats to the beginning of a | |
274 | sentence, or to the beginning of a \s-2LISP\s0 s-expression | |
275 | if the \fIlisp\fR option is set. | |
276 | A sentence ends at a \fB. !\fR or \fB?\fR which is followed by either | |
277 | the end of a line or by two spaces. Any number of closing \fB) ] "\fR | |
278 | and \fB\(aa\fR characters may appear after the \fB. !\fR or \fB?\fR, | |
279 | and before the spaces or end of line. Sentences also begin | |
280 | at paragraph and section boundaries | |
281 | (see \fB{\fR and \fB[[\fR below). | |
282 | A count advances that many sentences (4.2, 6.8). | |
283 | .iP ")" 15 | |
284 | Advances to the beginning of a sentence. | |
285 | A count repeats the effect. | |
286 | See \fB(\fR above for the definition of a sentence (4.2, 6.8). | |
287 | .iP "*" 15 | |
288 | Unused. | |
289 | .iP "+" 15 | |
290 | Same as \s-2CR\s0 when used as a command. | |
291 | .iP "," 15 | |
292 | Reverse of the last \fBf F t\fR or \fBT\fR command, looking the other way | |
293 | in the current line. Especially useful after hitting too many \fB;\fR | |
294 | characters. A count repeats the search. | |
295 | .iP "\-" 15 | |
296 | Retreats to the previous line at the first non-white character. | |
297 | This is the inverse of \fB+\fR and \s-2RETURN\s0. | |
298 | If the line moved to is not on the screen, the screen is scrolled, or | |
299 | cleared and redrawn if this is not possible. | |
300 | If a large amount of scrolling would be required the screen is also cleared | |
301 | and redrawn, with the current line at the center (2.3). | |
302 | .iP "\&." 15 | |
303 | Repeats the last command which changed the buffer. Especially useful | |
304 | when deleting words or lines; you can delete some words/lines and then | |
305 | hit \fB.\fR to delete more and more words/lines. | |
306 | Given a count, it passes it on to the command being repeated. Thus after | |
307 | a \fB2dw\fR, \fB3.\fR deletes three words (3.3, 6.3, 7.2, 7.4). | |
308 | .iP "/" 15 | |
309 | Reads a string from the last line on the screen, and scans forward for | |
310 | the next occurrence of this string. The normal input editing sequences may | |
311 | be used during the input on the bottom line; an returns to command state | |
312 | without ever searching. | |
313 | The search begins when you hit \s-2CR\s0 to terminate the pattern; | |
314 | the cursor moves to the beginning of the last line to indicate that the search | |
315 | is in progress; the search may then | |
316 | be terminated with a \s-2DEL\s0 or \s-2RUB\s0, or by backspacing when | |
317 | at the beginning of the bottom line, returning the cursor to | |
318 | its initial position. | |
319 | Searches normally wrap end-around to find a string | |
320 | anywhere in the buffer. | |
321 | .IP | |
322 | When used with an operator the enclosed region is normally affected. | |
323 | By mentioning an | |
324 | offset from the line matched by the pattern you can force whole lines | |
325 | to be affected. To do this give a pattern with a closing | |
326 | a closing \fB/\fR and then an offset \fB+\fR\fIn\fR or \fB\-\fR\fIn\fR. | |
327 | .IP | |
328 | To include the character \fB/\fR in the search string, you must escape | |
329 | it with a preceding \fB\e\fR. | |
330 | A \fB\(ua\fR at the beginning of the pattern forces the match to occur | |
331 | at the beginning of a line only; this speeds the search. A \fB$\fR at | |
332 | the end of the pattern forces the match to occur at the end of a line | |
333 | only. | |
334 | More extended pattern matching is available, see section 7.4; | |
335 | unless you set \fBnomagic\fR in your \fI\&.exrc\fR file you will have | |
336 | to preceed the characters \fB. [ *\fR and \fB~\fR in the search pattern | |
337 | with a \fB\e\fR to get them to work as you would naively expect (1.5, 2,2, | |
338 | 6.1, 7.2, 7.4). | |
339 | .iP "0" 15 | |
340 | Moves to the first character on the current line. | |
341 | Also used, in forming numbers, after an initial \fB1\fR\-\fB9\fR. | |
342 | .iP "1\-9" 15 | |
343 | Used to form numeric arguments to commands (2.3, 7.2). | |
344 | .iP ":" 15 | |
345 | A prefix to a set of commands for file and option manipulation and escapes | |
346 | to the system. Input is given on the bottom line and terminated with | |
347 | an \s-2CR\s0, and the command then executed. You can return to where | |
348 | you were by hitting \s-2DEL\s0 or \s-2RUB\s0 if you hit \fB:\fR accidentally | |
349 | (see primarily 6.2 and 7.3). | |
350 | .iP ";" 15 | |
351 | Repeats the last single character find which used \fBf F t\fR or \fBT\fR. | |
352 | A count iterates the basic scan (4.1). | |
353 | .iP "<" 15 | |
354 | An operator which shifts lines left one \fIshiftwidth\fR, normally 8 | |
355 | spaces. Like all operators, affects lines when repeated, as in | |
356 | \fB<<\fR. Counts are passed through to the basic object, thus \fB3<<\fR | |
357 | shifts three lines (6.6, 7.2). | |
358 | .iP "=" 15 | |
359 | Reindents line for \s-2LISP\s0, as though they were typed in with \fIlisp\fR | |
360 | and \fIautoindent\fR set (6.8). | |
361 | .iP ">" 15 | |
362 | An operator which shifts lines right one \fIshiftwidth\fR, normally 8 | |
363 | spaces. Affects lines when repeated as in \fB>>\fR. Counts repeat the | |
364 | basic object (6.6, 7.2). | |
365 | .iP "?" 15 | |
366 | Scans backwards, the opposite of \fB/\fR. See the \fB/\fR description | |
367 | above for details on scanning (2.2, 6.1, 7.4). | |
368 | .iP "@" 15 | |
369 | A macro character (6.9). If this is your kill character, you must escape it with a \e | |
370 | to type it in during input mode, as it normally backs over the input you | |
371 | have given on the current line (3.1, 3.4, 7.5). | |
372 | .iP "A" 15 | |
373 | Appends at the end of line, a synonym for \fB$a\fR (7.2). | |
374 | .iP "B" 15 | |
375 | Backs up a word, where words are composed of non-blank sequences, placing | |
376 | the cursor at the beginning of the word. A count repeats the effect | |
377 | (2.4). | |
378 | .iP "C" 15 | |
379 | Changes the rest of the text on the current line; a synonym for \fBc$\fR. | |
380 | .iP "D" 15 | |
381 | Deletes the rest of the text on the current line; a synonym for \fBd$\fR. | |
382 | .iP "E" 15 | |
383 | Moves forward to the end of a word, defined as blanks and non-blanks, | |
384 | like \fBB\fR and \fBW\fR. A count repeats the effect. | |
385 | .iP "F" 15 | |
386 | Finds a single following character, backwards in the current line. | |
387 | A count repeats this search that many times (4.1). | |
388 | .iP "G" 15 | |
389 | Goes to the line number given as preceding argument, or the end of the | |
390 | file if no preceding count is given. The screen is redrawn with the | |
391 | new current line in the center if necessary (7.2). | |
392 | .iP "H" 15 | |
393 | .B "Home arrow" . | |
394 | Homes the cursor to the top line on the screen. If a count is given, | |
395 | then the cursor is moved to the count'th line on the screen. | |
396 | In any case the cursor is moved to the first non-white character on the | |
397 | line. If used as the target of an operator, full lines are affected | |
398 | (2.3, 3.2). | |
399 | .iP "I" 15 | |
400 | Inserts at the beginning of a line; a synonym for \fB\(uai\fR. | |
401 | .iP "J" 15 | |
402 | Joins together lines, supplying appropriate white space: one space between | |
403 | words, two spaces after a \fB.\fR, and no spaces at all if the first | |
404 | character of the joined on line is \fB)\fR. A count causes that many | |
405 | lines to be joined rather than the default two (6.5, 7.1f). | |
406 | .iP "K" 15 | |
407 | Unused. | |
408 | .iP "L" 15 | |
409 | Moves the cursor to the first non-white character of the last line on | |
410 | the screen. With a count, to the first non-white of the count'th line | |
411 | from the bottom. Operators affect whole lines when used with \fBL\fR | |
412 | (2.3). | |
413 | .iP "M" 15 | |
414 | Moves the cursor to the middle line on the screen, at the first non-white | |
415 | position on the line (2.3). | |
416 | .iP "N" 15 | |
417 | Scans for the next match of the last pattern given to | |
418 | \fB/\fR or \fB?\fR, but in the reverse direction; this is the reverse | |
419 | of \fBn\fR. | |
420 | .iP "O" 15 | |
421 | Opens a new line above the current line and inputs text there up to an | |
422 | \s-2ESC\s0. A count can be used on dumb terminals to specify a number | |
423 | of lines to be opened; this is generally obsolete, as the \fIslowopen\fR | |
424 | option works better (3.1). | |
425 | .iP "P" 15 | |
426 | Puts the last deleted text back before/above the cursor. The text goes | |
427 | back as whole lines above the cursor if it was deleted as whole lines. | |
428 | Otherwise the text is inserted between the characters before and at the | |
429 | cursor. May be preceded by a named buffer specification \fB"\fR\fIx\fR | |
430 | to retrieve the contents of the buffer; buffers \fB1\fR\-\fB9\fR contain | |
431 | deleted material, buffers \fBa\fR\-\fBz\fR are available for general | |
432 | use (6.3). | |
433 | .iP "Q" 15 | |
434 | Quits from \fIvi\fR to \fIex\fR command mode. In this mode, whole lines | |
435 | form commands, ending with a \s-2RETURN\s0. You can give all the \fB:\fR | |
436 | commands; the editor supplies the \fB:\fR as a prompt (7.7). | |
437 | .iP "R" 15 | |
438 | Replaces characters on the screen with characters you type (overlay fashion). | |
439 | Terminates with an \s-2ESC\s0. | |
440 | .iP "S" 15 | |
441 | Changes whole lines, a synonym for \fBcc\fR. A count substitutes for | |
442 | that many lines. The lines are saved in the numeric buffers, and erased | |
443 | on the screen before the substitution begins. | |
444 | .iP "T" 15 | |
445 | Takes a single following character, locates the character before the | |
446 | cursor in the current line, and places the cursor just after that character. | |
447 | A count repeats the effect. Most useful with operators such as \fBd\fR | |
448 | (4.1). | |
449 | .iP "U" 15 | |
450 | Restores the current line to its state before you started changing it | |
451 | (3.5). | |
452 | .iP "V" 15 | |
453 | Unused. | |
454 | .iP "W" 15 | |
455 | Moves forward to the beginning of a word in the current line, | |
456 | where words are defined as sequences of blank/non-blank characters. | |
457 | A count repeats the effect (2.4). | |
458 | .iP "X" 15 | |
459 | Deletes the character before the cursor. A count repeats the effect, | |
460 | but only characters on the current line are deleted. | |
461 | .iP "Y" 15 | |
462 | Yanks a copy of the current line into the unnamed buffer, to be put back | |
463 | by a later \fBp\fR or \fBP\fR; a very useful synonym for \fByy\fR. | |
464 | A count yanks that many lines. May be preceded by a buffer name to put | |
465 | lines in that buffer (7.4). | |
466 | .iP "ZZ" 15 | |
467 | Exits the editor. | |
468 | (Same as \fB:x\fP\s-2CR\s0.) | |
469 | If any changes have been made, the buffer is written out to the current file. | |
470 | Then the editor quits. | |
471 | .iP "[[" 15 | |
472 | Backs up to the previous section boundary. A section begins at each | |
473 | macro in the \fIsections\fR option, | |
474 | normally a `.NH' or `.SH' and also at lines which which start | |
475 | with a formfeed \fB^L\fR. Lines beginning with \fB{\fR also stop \fB[[\fR; | |
476 | this makes it useful for looking backwards, a function at a time, in C | |
477 | programs. If the option \fIlisp\fR is set, stops at each \fB(\fR at the | |
478 | beginning of a line, and is thus useful for moving backwards at the top | |
479 | level \s-2LISP\s0 objects. (4.2, 6.1, 6.6, 7.2). | |
480 | .iP "\e" 15 | |
481 | Unused. | |
482 | .iP "]]" 15 | |
483 | Forward to a section boundary, see \fB[[\fR for a definition (4.2, 6.1, | |
484 | 6.6, 7.2). | |
485 | .iP "\(ua" 15 | |
486 | Moves to the first non-white position on the current line (4.4). | |
487 | .iP "_" 15 | |
488 | Unused. | |
489 | .iP "\(ga" 15 | |
490 | When followed by a \fB\(ga\fR returns to the previous context. | |
491 | The previous context is set whenever the current | |
492 | line is moved in a non-relative way. | |
493 | When followed by a letter \fBa\fR\-\fBz\fR, returns to the position which | |
494 | was marked with this letter with a \fBm\fR command. | |
495 | When used with an operator such as \fBd\fR, the operation takes place | |
496 | from the exact marked place to the current position within the line; | |
497 | if you use \fB\(aa\fR, the operation takes place over complete lines | |
498 | (2.2, 5.3). | |
499 | .iP "a" 15 | |
500 | Appends arbitrary text after the current cursor position; the insert | |
501 | can continue onto multiple lines by using \s-2RETURN\s0 within the insert. | |
502 | A count causes the inserted text to be replicated, but only if the inserted | |
503 | text is all on one line. | |
504 | The insertion terminates with an \s-2ESC\s0 (3.1, 7.2). | |
505 | .iP "b" 15 | |
506 | Backs up to the beginning of a word in the current line. A word is a | |
507 | sequence of alphanumerics, or a sequence of special characters. | |
508 | A count repeats the effect (2.4). | |
509 | .iP "c" 15 | |
510 | An operator which changes the following object, replacing it with the | |
511 | following input text up to an \s-2ESC\s0. If more than part of a single | |
512 | line is affected, the text which is changed away is saved in the numeric named | |
513 | buffers. If only part of the current line is affected, then the last | |
514 | character to be changed away is marked with a \fB$\fR. | |
515 | A count causes that many objects to be affected, thus both | |
516 | \fB3c)\fR and \fBc3)\fR change the following three sentences (7.4). | |
517 | .iP "d" 15 | |
518 | An operator which deletes the following object. If more than part of | |
519 | a line is affected, the text is saved in the numeric buffers. | |
520 | A count causes that many objects to be affected; thus \fB3dw\fR is the | |
521 | same as \fBd3w\fR (3.3, 3.4, 4.1, 7.4). | |
522 | .iP "e" 15 | |
523 | Advances to the end of the next word, defined as for \fBb\fR and \fBw\fR. | |
524 | A count repeats the effect (2.4, 3.1). | |
525 | .iP "f" 15 | |
526 | Finds the first instance of the next character following the cursor on | |
527 | the current line. A count repeats the find (4.1). | |
528 | .iP "g" 15 | |
529 | Unused. | |
530 | .sp | |
531 | Arrow keys | |
532 | .B h , | |
533 | .B j , | |
534 | .B k , | |
535 | .B l , | |
536 | and | |
537 | .B H . | |
538 | .iP "h" 15 | |
539 | .B "Left arrow" . | |
540 | Moves the cursor one character to the left. | |
541 | Like the other arrow keys, either | |
542 | .B h , | |
543 | the | |
544 | .B "left arrow" | |
545 | key, or one of the synonyms (\fB^H\fP) has the same effect. | |
546 | On v2 editors, arrow keys on certain kinds of terminals | |
547 | (those which send escape sequences, such as vt52, c100, or hp) | |
548 | cannot be used. | |
549 | A count repeats the effect (3.1, 7.5). | |
550 | .iP "i" 15 | |
551 | Inserts text before the cursor, otherwise like \fBa\fR (7.2). | |
552 | .iP "j" 15 | |
553 | .B "Down arrow" . | |
554 | Moves the cursor one line down in the same column. | |
555 | If the position does not exist, | |
556 | .I vi | |
557 | comes as close as possible to the same column. | |
558 | Synonyms include | |
559 | .B ^J | |
560 | (linefeed) and | |
561 | .B ^N . | |
562 | .iP "k" 15 | |
563 | .B "Up arrow" . | |
564 | Moves the cursor one line up. | |
565 | .B ^P | |
566 | is a synonym. | |
567 | .iP "l" 15 | |
568 | .B "Right arrow" . | |
569 | Moves the cursor one character to the right. | |
570 | \s-2SPACE\s0 is a synonym. | |
571 | .iP "m" 15 | |
572 | Marks the current position of the cursor in the mark register which is | |
573 | specified by the next character \fBa\fR\-\fBz\fR. Return to this position | |
574 | or use with an operator using \fB\(ga\fR or \fB\(aa\fR (5.3). | |
575 | .iP "n" 15 | |
576 | Repeats the last \fB/\fR or \fB?\fR scanning commands (2.2). | |
577 | .iP "o" 15 | |
578 | Opens new lines below the current line; otherwise like \fBO\fR (3.1). | |
579 | .iP "p" 15 | |
580 | Puts text after/below the cursor; otherwise like \fBP\fR (6.3). | |
581 | .iP "q" 15 | |
582 | Unused. | |
583 | .iP "r" 15 | |
584 | Replaces the single character at the cursor with a single character you | |
585 | type. The new character may be a \s-2RETURN\s0; this is the easiest | |
586 | way to split lines. A count replaces each of the following count characters | |
587 | with the single character given; see \fBR\fR above which is the more | |
588 | usually useful iteration of \fBr\fR (3.2). | |
589 | .iP "s" 15 | |
590 | Changes the single character under the cursor to the text which follows | |
591 | up to an \s-2ESC\s0; given a count, that many characters from the current | |
592 | line are changed. The last character to be changed is marked with \fB$\fR | |
593 | as in \fBc\fR (3.2). | |
594 | .iP "t" 15 | |
595 | Advances the cursor upto the character before the next character typed. | |
596 | Most useful with operators such as \fBd\fR and \fBc\fR to delete the | |
597 | characters up to a following character. You can use \fB.\fR to delete | |
598 | more if this doesn't delete enough the first time (4.1). | |
599 | .iP "u" 15 | |
600 | Undoes the last change made to the current buffer. If repeated, will | |
601 | alternate between these two states, thus is its own inverse. When used | |
602 | after an insert which inserted text on more than one line, the lines are | |
603 | saved in the numeric named buffers (3.5). | |
604 | .iP "v" 15 | |
605 | Unused. | |
606 | .iP "w" 15 | |
607 | Advances to the beginning of the next word, as defined by \fBb\fR (2.4). | |
608 | .iP "x" 15 | |
609 | Deletes the single character under the cursor. With a count deletes | |
610 | deletes that many characters forward from the cursor position, but only | |
611 | on the current line (6.5). | |
612 | .iP "y" 15 | |
613 | An operator, yanks the following object into the unnamed temporary buffer. | |
614 | If preceded by a named buffer specification, \fB"\fR\fIx\fR, the text | |
615 | is placed in that buffer also. Text can be recovered by a later \fBp\fR | |
616 | or \fBP\fR (7.4). | |
617 | .iP "z" 15 | |
618 | Redraws the screen with the current line placed as specified by the following | |
619 | character: \s-2RETURN\s0 specifies the top of the screen, \fB.\fR the | |
620 | center of the screen, and \fB\-\fR at the bottom of the screen. | |
621 | A count may be given after the \fBz\fR and before the following character | |
622 | to specify the new screen size for the redraw. | |
623 | A count before the \fBz\fR gives the number of the line to place in the | |
624 | center of the screen instead of the default current line. (5.4) | |
625 | .iP "{" 15 | |
626 | Retreats to the beginning of the beginning of the preceding paragraph. | |
627 | A paragraph begins at each macro in the \fIparagraphs\fR option, normally | |
628 | `.IP', `.LP', `.PP', `.QP' and `.bp'. | |
629 | A paragraph also begins after a completely | |
630 | empty line, and at each section boundary (see \fB[[\fR above) (4.2, 6.8, | |
631 | 7.6). | |
632 | .iP "|" 15 | |
633 | Places the cursor on the character in the column specified | |
634 | by the count (7.1, 7.2). | |
635 | .iP "}" 15 | |
636 | Advances to the beginning of the next paragraph. See \fB{\fR for the | |
637 | definition of paragraph (4.2, 6.8, 7.6). | |
638 | .iP "~" 15 | |
639 | Unused. | |
640 | .iP "^?\ (\s-2\fRDEL\fP\s0)" 15 | |
641 | Interrupts the editor, returning it to command accepting state (1.5, | |
642 | 7.5) | |
643 | .bp | |
644 | \&. |