Lines Matching full:the

2 .\"	The Regents of the University of California.  All rights reserved.
5 .\" modification, are permitted provided that the following conditions
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.
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
16 .\" 4. Neither the name of the University nor the names of its contributors
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
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
45 few commands listed in the original document that I was unable
48 them work. In these cases I left the command out. The commands
51 it once to get the flavor of everything that \fBvi\fR can do
59 It does not attempt to document the VAX version (version 3),
68 means that an optional number may precede the command to
69 multiply or iterate the command.
70 \fB{variable item}\fR is used to denote parts of the command
72 \fB<character [-character]>\fR means that the character or
73 one of the characters in the range described between the
79 with the \fB<cntl>\fR key held down while simultaneously typing
81 be denoted using the \fIupper case\fR character, but
112 To run \fBvi\fR the shell variable \fBTERM\fR must be defined and
115 You can tell which shell you have by the character it
117 The Bourne shell prompts with `$', and the C shell prompts with `%'.
132 You want to tell this to the machine, but still have it
134 The recommended way, if you have the
136 program, is to use the sequence
142 in your .login (for csh) or the same thing using `.' instead of `source'
158 You want to tell this to the machine, but still have it
160 The recommended way, if you have the
162 program, is to use the sequence
171 without environments, the invocation of tset
172 is simpler, just add the line ``tset \-d 2621''
181 \fBVi\fR is a visual editor with a window on the file. What
182 you see on the screen is \fBvi\fR's current notion of
184 (at this point in the file),
186 Most commands do not cause any change in the screen until the
188 typing a command, you can abort the command by typing an
190 when you hear a <bell>. Usually typing an <esc> will produce the
192 it rings the <bell>.
193 Following are the \fBvi\fR commands broken down by function.
205 The file will be read in and the cursor will be placed at the beginning
206 of the first line.
207 The first screenfull of the file will be displayed on the terminal.
209 To get out of the editor, type
214 or the middle of a multi-keystroke command, it may
221 The arrow keys (see the next four commands)
222 on certain kinds of terminals will not work with the
223 PDP-11 version of vi. The control versions or the hjkl versions will
224 work on any terminal. Experienced users prefer the hjkl keys because
228 The mnemonic value of hjkl is clear from looking at the keyboard of an adm3a.
232 Move the cursor to the left one character. Cursor stops at the left
233 margin of the page.
238 Moving off the screen scrolls the window to force a new line
239 onto the screen.
244 Moving off the top of the screen forces new text onto the screen.
248 Move to the right one character.
249 Cursor will not go beyond the end of the line.
251 Move the cursor up the screen to the beginning of the next line.
255 Move the cursor down the screen to the beginning of the next line.
258 Move the cursor to the end of the line.
259 If there is a count, move to the end of the line "cnt" lines
260 forward in the file.
262 Move the cursor to the beginning of the first word on the line.
264 Move the cursor to the left margin of the current line.
266 Move the cursor to the column specified by the count. The default is
269 Move the cursor to the beginning of the next word. If there
271 position the cursor at the beginning of the word.
274 Move the cursor to the beginning of the next word which follows
277 Move the cursor to the preceding word. Mnemonic: \fBb\fRackup-word
279 Move the cursor to the preceding word that is separated from the
282 Move the cursor to the end of the current word or the end of the
285 Move the cursor to the end of the current word which is delimited by
289 Move the cursor to the line specified. Of particular use are the
290 sequences "1G" and "G", which move the cursor to the beginning and
291 the end of the file respectively. Mnemonic: \fBG\fRo-to
296 cannot be used as the object of commands such as delete or change.
298 Move the cursor down in the file by "cnt" lines (or the last "cnt"
299 if a new count isn't given. The initial default is half a page.) The
302 Move the cursor up in the file by "cnt" lines. The screen is simultaneously
305 Move the cursor to the next page. A count moves that many pages.
306 Two lines of the previous page are kept on the screen for continuity if
309 Move the cursor to the previous page. Two lines of the current page
312 Move the cursor to the beginning of the next sentence.
316 Move the cursor backwards to the beginning of a sentence.
318 Move the cursor to the beginning of the next paragraph. This command
320 \fBnroff\fR macros, \fB\-ms\fR and \fB\-mm\fR, for which the
321 commands ".IP", ".LP", ".PP", ".QP", "P", as well as the nroff command ".bp"
325 adjustable. See \fBparagraphs\fR under the \fBSet Commands\fR section.
327 Move the cursor backwards to the beginning of a paragraph.
329 Move the cursor to the next "section", where a section is defined by
333 be section delimiters. The last option makes it
334 useful for finding the beginnings of C functions.
336 See \fBsections\fR under the \fBSet Commands\fR section.
338 Move the cursor backwards to the beginning of a section.
340 Move the cursor to the matching parenthesis
341 or brace. This is very useful in C or lisp code. If the
342 cursor is sitting on a \fB( ) {\fR or \fB}\fR the cursor
343 is moved to the matching character at the other end of the
344 section. If the cursor is not sitting on a brace or a
346 and then jumps to the match mate.
348 If there is no count move the cursor to the top left position on the screen.
349 If there is a count, then move the cursor to the beginning of the line
350 "cnt" lines from the top of the screen. Mnemonic: \fBH\fRome
352 If there is no count move the cursor to the beginning
353 of the last line on the screen.
354 If there is a count, then move the cursor to the beginning of the line
355 "cnt" lines from the bottom of the screen. Mnemonic: \fBL\fRast
357 Move the cursor to the beginning of the middle line on the screen.
360 This command does not move the cursor, but it \fBmarks\fR the place
361 in the file and the character "<a-z>" becomes the label for referring
362 to this location in the file. See the next two commands. Mnemonic:
365 The mark command is not a motion, and cannot be used as the target
368 Move the cursor to the beginning of the line that is marked with the label
371 Move the cursor to the exact position on the line that was marked with
372 with the label "<a-z>".
374 Move the cursor back to the beginning of the line where it was before the
376 search or a jump to a specific line in the file, rather than moving the
377 cursor or scrolling the screen.
379 Move the cursor back to the exact spot on the line where it was located
380 before the last "non-relative" move.
389 Search forward on the line for the next or "cnt"'th occurrence of
390 the character "chr". The cursor is placed \fBat\fR the character
394 Search backwards on the line for the next or "cnt"'th occurrence of
395 the character "chr". The cursor is placed \fBat\fR the character
399 Search forward on the line for the next or "cnt"'th occurrence of
400 the character "chr". The cursor is placed \fBjust preceding\fR
404 Search backwards on the line for the next or "cnt"'th occurrence of
405 the character "chr". The cursor is placed \fBjust preceding\fR
408 Repeat the last "f", "F", "t" or "T" command.
410 Repeat the last "f", "F", "t" or "T" command, but in the opposite
414 Search forward for the next occurrence of "string".
415 Wrap around at the end of the file
420 Search backwards for the next occurrence of "string". If a count is
421 specified, the count becomes the new window size. Wrap around at the beginning
422 of the file does occur.
425 Repeat the last /[string]/ or ?[string]? search. Mnemonic: \fBn\fRext
428 Repeat the last /[string]/ or ?[string]? search, but in the reverse
432 Using the \fB:\fR syntax it is possible to do global searches ala the
438 The following commands allow for the insertion of text. All multicharacter
445 Insert text immediately following the cursor position.
448 Insert text at the end of the current line.
451 Insert text immediately preceding the cursor position.
454 Insert text at the beginning of the current line.
456 Insert a new line after the line on which the cursor appears and
459 Insert a new line preceding the line on which the cursor appears
465 The following commands allow the user to delete text in various ways.
466 All changes can always be \fBundone\fR by typing the \fBu\fR command.
469 Delete the character or characters starting at the cursor position.
471 Delete the character or characters starting at the character preceding
474 Deletes the remainder of the line starting at the cursor.
475 Mnemonic: \fBD\fRelete the rest of line
478 Deletes one or more occurrences of the specified motion.
485 The following commands allow the user to simultaneously delete and
487 \fBu\fR following the command.
490 Replaces the character at the current cursor position with <chr>. This
494 Starts overlaying the characters on the screen with whatever you type.
497 Substitute for "cnt" characters beginning at the current cursor
498 position. A "$" will appear at the position in the text where the
502 Substitute for the entire current line (or lines). If no count is given,
503 a "$" appears at the end of the current line. If a count of more than
504 1 is given, all the lines to be replaced are deleted before the insertion
508 Change the specified "motion" by replacing it with the
509 insertion text. A "$" will appear at the end of the last item
510 that is being deleted unless the deletion involves whole lines.
512 Stuttering the c (e.g. [cnt]cc) changes cnt lines.
519 or "yanked" is put in addition to the "undo" buffer.
520 The most recent deletion or yank is in the "undo" buffer and also
522 1, the next most recent in buffer 2, and so forth. Each new deletion
523 pushes down all the older deletions. Deletions older than 9
527 by \fB"<a-z>\fR, that named buffer will contain the text deleted
528 after the command is executed. For example, \fB"a3dd\fR will delete
529 three lines starting at the current line and put them in buffer \fB"a\fR.*
531 * Referring to an upper case letter as a buffer name (A-Z) is the
532 same as referring to the lower case letter, except that text placed
540 Yank the specified item or "cnt" items and put in the "undo" buffer or
541 the specified buffer. The variety of "items" that can be yanked
542 is the same as those that can be deleted with the "d" command or
543 changed with the "c" command. In the same way that "dd" means
544 delete the current line and "cc" means replace the current line,
545 "yy" means yank the current line.
547 Yank the current line or the "cnt" lines starting from the current
548 line. If no buffer is specified, they will go into the "undo" buffer,
552 Put "undo" buffer or the specified buffer down \fBafter\fR the cursor.
553 If whole lines were yanked or deleted into the buffer, then they will be
554 put down on the line following the line the cursor is on. If
556 be inserted immediately following the cursor.
559 It should be noted that text in the named buffers remains there when you
560 start editing a new file with the \fB:e file<esc>\fR command. Since
562 carry it over to another file in the buffers.
563 However, the undo buffer and the ability to undo are lost when
566 Put "undo" buffer or the specified buffer down \fBbefore\fR the cursor.
567 If whole lines where yanked or deleted into the buffer, then they will be
568 put down on the line preceding the line the cursor is on. If
570 be inserted immediately preceding the cursor.
572 The shift operator will right shift all the text from the line on which
573 the cursor is located to the line where the \fBmotion\fR is located.
575 \fB>>\fR means right shift the current line or lines.
577 The shift operator will left shift all the text from the line on which
578 the cursor is located to the line where the \fBitem\fR is located.
580 \fB<<\fR means left shift the current line or lines.
581 Once the line has reached the left margin it is not further affected.
583 Prettyprints the indicated area according to
595 This is the normal way to exit from vi.
596 If any changes have been made, the file is written out.
597 Then you are returned to the shell.
599 Redraw the current screen. This is useful if someone "write"s you
600 while you are in "vi" or if for any reason garbage gets onto the
603 On dumb terminals, those not having the "delete line" function
604 (the vt100 is such a terminal), \fBvi\fR saves redrawing the
605 screen when you delete a line by just marking the line with an
606 "@" at the beginning and blanking the line. If you want to
607 actually get rid of the lines marked with "@" and see what the
610 "Dot" is a particularly useful command. It repeats the last
614 Perhaps the most important command in the editor,
615 u undoes the last command that changed the buffer.
618 Undo all the text modifying commands performed on the current line
619 since the last time you moved onto it.
621 Join the current line and the following line. The <nl> is deleted
622 and the two lines joined, usually with a space between the
623 end of the first line and the beginning of what was the second
624 line. If the first line ended with a "period", then two spaces
626 A count joins the next cnt lines.
632 will not attempt to keep the "window" up to date.
633 Once in this mode it is also possible to switch to the \fBopen\fR
634 mode of editing. By entering the command \fB[line number]open<nl>\fR
635 you enter this mode. It is similar to the normal visual mode
636 except the window is only \fBone\fR line long.
640 The cursor should be positioned at the beginning of a word.
641 That word is taken as a tag name, and the tag with that
646 (e.g. command that reads the standard input and outputs something
647 to the standard output) can be sent a section of the current file and
648 have the output of the command replace the original text. Useful
651 sort a section of the current file into a new list.
652 Using \fB!!\fR means take a line or lines starting at the line the
653 cursor is currently on and pass them to the UNIX command.
655 To just escape to the shell for one command,
658 This resets the current window size to "cnt" lines and redraws the screen.
668 into the file. Any character typed after the ^V will be inserted
669 into the file.
672 to remove indentation that was inserted by the \fBautoindent\fR feature.
673 ^<^D> temporarily removes all the autoindentation, thus placing the cursor
674 at the left margin. On the next line, the previous indent level will be
675 restored. This is useful for putting "labels" at the left margin.
676 0<^D> says remove all autoindents and stay that way. Thus the cursor
677 moves to the left margin and stays there on successive lines until
678 <tab>'s are typed. As with the <tab>, the <^D> is only effective before
682 If the cursor is sitting on a word, <^W> moves the cursor back to the beginning
683 of the word, thus erasing the word from the insert.
693 Typing a ":" during command mode causes \fBvi\fR to put the cursor at
694 the bottom on the screen in preparation for a command. In the
701 Causes \fBvi\fR to write out the current text to the disk. It is
702 written to the file you are editing unless "file" is supplied. If
703 "file" is supplied, the write is directed to that file instead. If
704 that file already exists, \fBvi\fR will not perform the write unless
707 want to destroy the older copy of the file.
709 Causes \fBvi\fR to exit. If you have modified the file you are
711 refuse to exit unless the "!" is supplied.
714 Start editing a new file called "file" or start editing the current
715 file over again. The command ":e!" says "ignore the changes I've made
716 to this file and start over from the beginning". It is useful if
717 you really mess up the file. The optional "+" says instead of starting
718 at the beginning, start at the "end", or,
722 and "/text", which searches for "text" and starts at the line where
725 Switch back to the place you were before your last tag command.
726 If your last tag command stayed within the file, ^^ returns to that tag.
727 If you have no recent tag command, it will return to the
728 same place in the previous file that it was showing when you switched
729 to the current file.
731 Start editing the next file in the argument list. Since \fBvi\fR
732 can be called with multiple file names, the ":n" command tells it to
733 stop work on the current file and switch to the next file. If the
734 current file was modifies, it has to be written out before the ":n"
735 will work or else the "!" must be supplied, which says discard the
736 changes I made to the current file.
739 Replace the current argument list with a new list of files and start
740 editing the first file in this new list.
742 Read in a copy of "file" on the line after the cursor.
744 Execute the "cmd" and take its output and put it into the file after
750 looks in the file named
752 in the current directory.
754 is a file of lines in the format:
759 If \fBvi\fR finds the tag you specified in the \fB:ta\fR command,
760 it stops editing the current file if necessary and if the current file is
761 up to date on the disk and switches to the file specified and uses the
762 search pattern specified to find the "tagged" item of interest. This
763 is particularly useful when editing multi-file C programs such as the
768 It could also be useful when editing multi-file documents, though the
774 \fBVi\fR takes the value of \fB$TERM\fR and looks up the characteristics
775 of that terminal in the file \fB/etc/termcap\fR.
776 If you don't know \fBvi\fR's name for the terminal you are working
779 When \fBvi\fR starts, it attempts to read the variable EXINIT
781 If that exists, it takes the values in it as the default values
782 for certain of its internal constants. See the section on "Set Values"
784 If EXINIT doesn't exist you will get all the normal defaults.
787 Instead of EXINIT, put the startup commands in the file .exrc
791 Should you inadvertently hang up the phone while inside
793 or should the computer crash,
795 Upon returning to the system, type:
799 This will normally recover the file. If there is more than one
800 temporary file for a specific file name, \fBvi\fR recovers the
801 newest one. You can get an older version by recovering the
803 The command "vi -r" without a file name gives you the list of files
804 that were saved in the last system crash
807 the file just saved when the phone was hung up).
816 The toggle options are set by a command of the form:
820 and turned off with the command:
824 Commands requiring a value are set with a command of the form:
828 To display the value of a specific option type:
836 and to display the long table of all the settable parameters and
842 Most of the options have a long form and an abbreviation. Both are
843 listed in the following table as well as the normal default value.
845 To arrange to have values other than the default used every time you
848 place the appropriate
866 you can place the set command in the file .exrc in your home
873 line in the same column as the preceding line.
874 Tabbing to the right with <tab> or <^T> will move this boundary to
875 the right, and it can be moved to the left with <^D>.
879 Causes the current line to be printed after each ex text modifying command.
880 This is not of much interest in the normal \fBvi\fR visual mode.
886 interact with the outside world.
895 This is the directory in which \fBvi\fR puts its temporary file.
903 This option contains the value of hardware tabs in your terminal, or
904 of software tabs expanded by the Unix system.
913 Autoindent for \fBlisp\fR code. The commands \fB( ) [[\fR and \fB]]\fR
918 All printed lines have the <tab> and <nl> characters displayed visually.
922 Enable the metacharacters for matching. These include \fB. * < > [string]
936 Basically of use only when using the \fBex\fR capabilities. This
939 at the expense of losing typeahead on some versions of UNIX.
943 Each pair of characters in the string indicate \fBnroff\fR macros
944 which are to be treated as the beginning of a paragraph for the
945 \fB{\fR and \fB}\fR commands. The default string is for the \fB-ms\fR
948 quote a space in for the second character position. For example:
960 command mode the prompt character \fB:\fR will be printed when
965 On dumb terminals, force the screen to always be up to date,
970 This sets the threshold for the number of lines modified. When
972 \fBvi\fR will report the number of lines changed at the bottom of
977 This is the number of lines that the screen scrolls up or down when
978 using the <^U> and <^D> commands.
983 which are to be treated as the beginning of a section by the
984 \fB]]\fR and \fB[[\fR commands. The default string is for the \fB-ms\fR
986 To enter one letter \fBnroff\fR macros, use a quoted space as the
992 This is the name of the \fBsh\fR to be used for "escaped" commands.
996 This is the number of spaces that a <^T> or <^D> will move over for
997 indenting, and the amount < and > shift by.
1001 When a \fB)\fR or \fB}\fR is typed, show the matching \fB(\fR or \fB{\fR
1002 by moving the cursor to it for one second if it is on the current screen.
1006 On terminals that are slow and unintelligent, this option prevents the
1007 updating of the screen some of the time to improve speed.
1019 This is the terminal and controls the visual displays. It cannot be
1025 terminal type are found in the file \fB/etc/termcap\fR.
1029 When set, the error diagnostics are short.
1034 the shell without writing out the current changes.
1039 This is the number of lines in the window whenever \fBvi\fR must redraw
1044 These set window, but only within the corresponding speed ranges.
1051 baud, and a full screen (the default) at over 1200 baud.
1055 Searches will wrap around the end of the file when is option is set. When
1056 it is off, the search will terminate when it reaches the end or the
1057 beginning of the file.
1063 "wm" spaces of the right margin.
1064 Therefore with "wm=0" the option is off. Setting it to 10 would
1065 mean that any time you are within 10 spaces of the right margin
1068 to look at the screen while they type.
1069 (In version 3, wrapmargin behaves more like nroff, in that the
1070 boundary specified by the distance from the right edge of the screen
1071 is taken as the rightmost edge of the area where a break is allowed,
1072 instead of the leftmost edge.)
1077 This prevents the user from inadvertently destroying a file. When the