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