1 @comment Copyright (c) 1994
3 @comment The Regents of the University of California. All rights reserved.
4 @comment Copyright (c) 1994, 1995, 1996
5 @comment Keith Bostic. All rights reserved.
7 @comment See the LICENSE file for redistribution information.
9 @comment Id: ex.cmd.texi,v 8.2 2001/08/20 16:05:50 skimo Exp (Berkeley) Date: 2001/08/20 16:05:50
11 @chapter Ex Description
13 The following words have special meanings for
17 @cindex "<end-of-file>"
20 The end-of-file character is used to scroll the screen in the
23 This character is normally
25 However, whatever character is set for the current terminal is supported
31 A single-line address, given in any of the forms described in the
35 @LI{line}is the current line.
39 A line, or a pair of line addresses, separated by a comma or semicolon.
40 (See the section entitled
42 for more information.)
43 The default for range is the current line
51 The starting address must be less than, or equal to, the ending address.
55 A positive integer, specifying the number of lines to be affected by
56 the command; the default is 1.
57 Generally, a count past the end-of-file may be specified, e.g. the
60 in a 10 line file is acceptable, and will print from the current line
61 through the last line in the file.
65 One or more of the characters
70 When a command that accepts these flags completes, the addressed line(s)
71 are written out as if by the corresponding
77 In addition, any number of
81 characters can be specified before, after, or during the flags, in which
82 case the line written is not necessarily the one affected by the command,
83 but rather the line addressed by the offset address specified.
89 A pattern used to derive a pathname; the default is the current file.
90 File names are subjected to normal
95 Anywhere a file name is specified, it is also possible to use
98 This will be replaced with a temporary file name which can be used
99 for temporary work, e.g.
101 creates and edits a new file.
103 If both a count and a range are specified for commands that use either,
104 the starting line for the command is the
106 line addressed by the range, and
108 subsequent lines are affected by the command, e.g. the command
110 prints out lines 3, 4, 5 and 6.
112 When only a line or range is specified, with no command, the implied
119 The command used is the most recent of the three commands to have been
120 used (including any use as a flag).
121 If none of these commands have been used before, the
123 command is the implied command.
124 When no range or count is specified and the command line is a blank line,
125 the current line is incremented by 1 and then the current line is displayed.
127 Zero or more whitespace characters may precede or follow the addresses,
128 count, flags, or command name.
129 Any object following a command name (such as buffer, file, etc.),
130 that begins with an alphabetic character,
131 should be separated from the command name by at least one whitespace
134 Any character, including
135 @LI{<carriage-return>},
139 retain their literal value when preceded by a backslash.
142 The following section describes the commands available in the
145 In each entry below, the tag line is a usage synopsis for the command.
147 Each command can be entered as the abbreviation
148 (those characters in the synopsis command word preceding the
151 the full command (all characters shown for the command word,
157 or any leading subset of the full command down to the abbreviation.
158 For example, the args command (shown as
169 command described below notes the new current line after it
170 is executed, as well as any options that affect the command.
172 @deftypefn Command {} {"}
175 Command lines beginning with the double-quote character
178 This permits comments in editor scripts and startup files.
180 @cindex "<control-D>"
181 @cindex "<end-of-file>"
182 @deftypefn Command {} {<control-D>}
184 @deftypefnx Command {} {<end-of-file>}
187 Write the next N lines, where N is the value of the
190 The command is the end-of-file terminal character, which may be
191 different on different terminals.
192 Traditionally, it is the
197 command ignored any preceding count, and the
198 @LI{<end-of-file>}character was ignored unless it was entered as the first character
200 This implementation treats it as a command
202 if entered as the first character of the command line, and otherwise
203 treats it as any other character.
206 Set to the last line written.
214 @deftypefn Command {} {!} {argument(s)}
216 @deftypefnx Command {} {[range]!} {argument(s)}
217 Execute a shell command, or filter lines through a shell command.
218 In the first synopsis, the remainder of the line after the
220 character is passed to the program named by the
222 option, as a single argument.
224 Within the rest of the line,
228 are expanded into the current and alternate pathnames, respectively.
231 is expanded with the command text of the previous
234 (Therefore, the command
239 The special meanings of
244 can be overridden by escaping them with a backslash.
249 command has yet been executed, it is an error to use an unescaped
256 do shell expansion on the strings provided as arguments.
257 If any of the above expansions change the command the user entered,
258 the command is redisplayed at the bottom of the screen.
261 then executes the program named by the
265 flag followed by the arguments (which are bundled into a single argument).
269 command is permitted in an empty file.
271 If the file has been modified since it was last completely written,
274 command will warn you.
278 character is displayed when the command completes.
280 In the second form of the
282 command, the remainder of the line after the
284 is passed to the program named by the
286 option, as described above.
287 The specified lines are passed to the program as standard input,
288 and the standard and standard error output of the program replace
292 Unchanged if no range was specified, otherwise set to the first
303 @deftypefn Command {[range]} {#} {[count] [flags]}
306 @deftypefnx Command {[range]} {nu[mber]} {[count] [flags]}
307 Display the selected lines, each preceded with its line number.
309 The line number format is
311 followed by two spaces.
314 Set to the last line displayed.
322 @deftypefn Command {@@} {buffer}
325 @deftypefnx Command {} {*} {buffer}
327 Each line in the named buffer is executed as an
330 If no buffer is specified, or if the specified buffer is
334 the last buffer executed is used.
337 @deftypefn Command {[range]} {<[< ...]} {[count] [flags]}
339 Shift lines left or right.
340 The specified lines are shifted to the left (for the
342 command) or right (for the
344 command), by the number of columns specified by the
347 Only leading whitespace characters are deleted when shifting left;
348 once the first column of the line contains a nonblank character,
351 command will succeed, but the line will not be modified.
353 If the command character
357 is repeated more than once, the command is repeated once for each
358 additional command character.
361 If the current line is set to one of the lines that are affected
362 by the command, it is unchanged.
363 Otherwise, it is set to the first nonblank character of the lowest
364 numbered line shifted.
372 @deftypefn Command {[line]} {=} {[flags]}
374 Display the line number of
375 @LI{line}(which defaults to the last line in the file).
384 @deftypefn Command {[range]} {>[> ...]} {[count] [flags]}
387 The specified lines are shifted to the right by the number of columns
390 option, by inserting tab and space characters.
391 Empty lines are not changed.
393 If the command character
395 is repeated more than once, the command is repeated once for each
396 additional command character.
399 Set to the last line modified by the command.
407 @deftypefn Command {} {ab[brev]} {lhs rhs}
409 Add an abbreviation to the current abbreviation list.
410 When inserting text in
412 each time a non-word character is entered after a word character,
413 a set of characters ending at the word character are checked for
416 If a match is found, they are replaced with
418 The set of characters that are checked for a match are defined as follows,
419 for inexplicable historical reasons.
420 If only one or two characters were entered before the non-word character
421 that triggered the check,
422 and after the beginning of the insertion,
423 or the beginning of the line or the file,
425 @LI{<blank>}character that was entered,
426 then the one or the both characters are checked for a match.
427 Otherwise, the set includes both characters,
428 as well as the characters that precede them that are the same word
429 class (i.e. word or non-word) as the
431 to last character entered before the non-word character that triggered
434 @LI{<blank>}character,
435 the beginning of the insertion,
436 or the beginning of the line or the file.
438 For example, the abbreviations:
440 @multitable {:abbreviate} {/*#i} {/********************}
441 @item :abbreviate @tab abc @tab ABC
442 @item :abbreviate @tab #i @tab #include
443 @item :abbreviate @tab /*#i @tab /*#include
445 will all work, while the abbreviations:
447 @multitable {:abbreviate} {/*#i} {/********************}
448 @item :abbreviate @tab a#i @tab A#include
449 @item :abbreviate @tab /* @tab /********************
451 will not work, and are not permitted by
454 To keep the abbreviation expansion from happening,
455 the character immediately following the
456 @LI{lhs}characters should be quoted with a
457 @LI{<literal-next>}character.
460 @LI{rhs}is itself subject to both further abbreviation expansion and further
470 @deftypefn Command {[line]} {a[ppend][!]}
472 The input text is appended to the specified line.
473 If line 0 is specified, the text is inserted at the beginning of the file.
474 Set to the last line input.
475 If no lines are input, then set to
477 or to the first line of the file if a
478 @LI{line}of 0 was specified.
479 Following the command name with a
483 option to be toggled for the duration of the command.
496 @deftypefn Command {} {ar[gs]}
498 Display the argument list.
499 The current argument is displayed inside of
504 The argument list is the list of operands specified on startup,
505 which can be replaced using the
516 @deftypefn Command {} {bg}
520 Background the current screen.
521 The screen is unchanged,
522 but is no longer accessible and disappears from the display.
525 command to bring the screen back to the display foreground.
528 Set to the current line when the screen was last edited.
534 @deftypefn Command {[range]} {c[hange][!]} {[count]}
536 Replace the lines with input text.
537 Following the command name with a
541 option to be toggled for the duration of the command.
544 Set to the last line input, or, if no lines were input,
545 set to the line before the target line, or to the first
546 line of the file if there are no lines preceding the target line.
557 @deftypefn Command {} {chd[ir][!]} {[directory]}
559 @deftypefnx Command {} {cd[!]} {[directory]}
560 Change the current working directory.
562 @LI{directory}argument is subjected to
565 When invoked with no directory argument and the
566 @LI{HOME}environment variable is set, the directory named by the
567 @LI{HOME}environment variable becomes the new current directory.
568 Otherwise, the new current directory becomes the directory returned
575 command will fail if the file has been modified since the last complete
577 You can override this check by appending a
579 character to the command.
591 @deftypefn Command {[range]} {co[py]} {line [flags]}
593 @deftypefnx Command {[range]} {t} {line [flags]}
594 Copy the specified lines (range) after the destination line.
595 Line 0 may be specified to insert the lines at the beginning of
605 @deftypefn Command {} {cs[cope]} {command [args]}
610 For more information, see the section of the reference manual entitled
611 @QB{Tags, Tag Stacks, and Cscope} .
614 @deftypefn Command {[range]} {d[elete]} {[buffer] [count] [flags]}
616 Delete the lines from the file.
617 The deleted text is saved in the specified buffer, or, if no buffer
618 is specified, in the unnamed buffer.
619 If the command name is followed by a letter that could be interpreted
620 as either a buffer name or a flag value (because neither a
622 @LI{flags}values were given),
624 treats the letter as a
625 @LI{flags}value if the letter immediately follows the command name,
626 without any whitespace separation.
627 If the letter is preceded by whitespace characters,
628 it treats it as a buffer name.
631 Set to the line following the deleted lines,
632 or to the last line if the deleted lines were at the end.
638 @deftypefn Command {} {di[splay]} {b[uffers] | c[onnections] | s[creens] | t[ags]}
642 connections, screens or tags.
645 command takes one of three additional arguments, which are as follows:
648 Display all buffers (including named, unnamed, and numeric)
651 Display the source directories for all attached
655 Display the file names of all background screens.
657 Display the tags stack.
667 @deftypefn Command {} {e[dit][!]} {[+cmd] [file]}
668 @deftypefnx Command {} {ex[!]} {[+cmd] [file]}
669 @deftypefnx Command {} {vs[plit][!]} {[+cmd] [file]}
670 Edit a different file.
671 If the current buffer has been modified since the last complete write,
672 the command will fail.
673 You can override this by appending a
675 character to the command name.
679 option is specified, that
681 command will be executed in the new file.
684 command may be used, although the most common use of this feature is
685 to specify a line number or search pattern to set the initial location
688 Capitalizing the first letter of the command, i.e.,
694 mode, will edit the file in a new screen.
695 In this case, any modifications to the current file are ignored.
696 @cindex vertical split
697 @cindex splitting, vertically
698 @CO{vsplit} is similar, but the screen will be split vertically
699 to produce the new screen, rather than horizontally.
703 If you have previously edited the file, the current line will be set
704 to your last position in the file.
705 If that position does not exist, or you have not previously edited the
706 file, the current line will be set to the first line of the file if
709 mode, and the last line of the file if you are in
716 @deftypefn Command {} {exu[sage]} {[command]}
722 @LI{command}is specified, a usage statement for that command is displayed.
723 Otherwise, usage statements for all
725 commands are displayed.
734 @deftypefn Command {} {f[ile]} {[file]}
736 Display and optionally change the file name.
737 If a file name is specified, the current pathname is changed to the
739 The current pathname, the number of lines, and the current position
740 in the file are displayed.
749 @deftypefn Command {} {fg} {[name]}
753 Foreground the specified screen.
754 If the argument name doesn't exactly match the name of a file displayed
755 by a background screen,
756 it is compared against the last component of each of the file names.
757 If no background screen is specified,
758 the first background screen is foregrounded.
761 foregrounding causes the current screen to be swapped with the backgrounded
763 Capitalizing the first letter of the command, i.e.
765 will foreground the backgrounded screen in a new screen instead of
766 swapping it with the current screen.
769 Set to the current line when the screen was last edited.
775 @deftypefn Command {[range]} {g[lobal]} {/pattern/ [commands]}
778 @deftypefnx Command {[range]} {v} {/pattern/ [commands]}
779 Apply commands to lines matching (or not matching) a pattern.
780 The lines within the given range that match
784 the given pattern are selected.
787 command(s) are executed with the current line
789 set to each selected line.
790 If no range is specified, the entire file is searched for matching,
791 or not matching, lines.
793 Multiple commands can be specified, one per line, by escaping each
794 @LI{<newline>}character with a backslash, or by separating commands with a
797 If no commands are specified, the command defaults to the
806 commands, the input text must be part of the global command line.
807 In this case, the terminating period can be omitted if it ends the commands.
811 command may also be specified as one of the
814 In this mode, input is taken from the terminal.
819 mode causes the next line matching the pattern to be selected and
821 to be reentered, until the list is exhausted.
828 commands cannot be used as part of these commands.
835 are turned off for the duration of the
842 The last line modified.
858 @deftypefn Command {} {he[lp]}
860 Display a help message.
869 @deftypefn Command {[line]} {i[nsert][!]}
871 The input text is inserted before the specified line.
872 Following the command name with a
876 option setting to be toggled for the duration of this command.
879 Set to the last line input; if no lines were input,
880 set to the line before the target line, or to the first line
881 of the file if there are no lines preceding the target line.
890 @deftypefn Command {[range]} {j[oin][!]} {[count] [flags]}
892 Join lines of text together.
895 @LI{count}specified to the
897 command specifies that the last line of the
899 @LI{count}subsequent lines will be joined.
900 (Note, this differs by one from the general rule where only
902 subsequent lines are affected.)
904 If the current line ends with a whitespace character, all whitespace
905 is stripped from the next line.
906 Otherwise, if the next line starts with a open parenthesis
909 Otherwise, if the current line ends with a question mark
916 Otherwise, insert a single space.
920 character to the command name causes a simpler join with no
921 white-space processing.
930 @deftypefn Command {[range]} {l[ist]} {[count] [flags]}
932 Display the lines unambiguously.
933 Tabs are displayed as
935 and the end of the line is marked with a
940 Set to the last line displayed.
948 @deftypefn Command {} {map[!]} {[lhs rhs]}
950 Define or display maps (for
958 are not specified, the current set of command mode maps are displayed.
961 character is appended to to the command,
962 the text input mode maps are displayed.
966 character sequence is entered in
968 the action is as if the corresponding
973 character is appended to the command name,
974 the mapping is effective during text input mode,
975 otherwise, it is effective during command mode.
978 to have two different macro definitions at the same time: one for command
979 mode and one for input mode.
981 Whitespace characters require escaping with a
982 @LI{<literal-next>}character to be entered in the
983 @LI{lhs}string in visual mode.
985 Normally, keys in the
986 @LI{rhs}string are remapped (see the
989 and it is possible to create infinite loops.
990 However, keys which map to themselves are not further remapped,
991 regardless of the setting of the
994 For example, the command
1004 To exit an infinitely looping map, use the terminal
1005 @LI{<interrupt>}character.
1017 @deftypefn Command {[line]} {ma[rk]} {<character>}
1019 @deftypefnx Command {[line]} {k} {<character>}
1020 Mark the line with the mark
1026 can then be used as an address in any command that uses one.
1035 @deftypefn Command {[range]} {m[ove]} {line}
1037 Move the specified lines after the target line.
1038 A target line of 0 places the lines at the beginning of the file.
1041 Set to the first of the moved lines.
1047 @deftypefn Command {} {mk[exrc][!]} {file}
1049 Write the abbreviations, editor options and maps to the specified
1051 Information is written in a form which can later be read back in
1057 @LI{file}already exists, the
1060 This check can be overridden by appending a
1062 character to the command.
1071 @deftypefn Command {} {n[ext][!]} {[file ...]}
1073 Edit the next file from the argument list.
1076 command will fail if the file has been modified since the last complete
1078 This check can be overridden by appending the
1080 character to the command name.
1081 The argument list can optionally be replaced by specifying a new one
1082 as arguments to this command.
1083 In this case, editing starts with the first file on the new list.
1085 Capitalizing the first letter of the command, i.e.
1089 mode, will set the argument list and edit the file in a new screen.
1090 In this case, any modifications to the current file are ignored.
1093 Set as described for the
1097 Affected by the options
1104 @deftypefn Command {[line]} {o[pen]} {/pattern/ [flags]}
1107 Open mode is the same as being in
1109 but with a one-line window.
1112 commands are available.
1113 If a match is found for the optional RE argument,
1114 the cursor is set to the start of the matching pattern.
1116 @emph{This command is not yet implemented.}
1119 Unchanged, unless the optional RE is specified, in which case it is
1120 set to the line where the matching pattern is found.
1128 @deftypefn Command {} {pre[serve]}
1130 Save the file in a form that can later be recovered using the
1134 When the file is preserved, an email message is sent to the user.
1143 @deftypefn Command {} {prev[ious][!]}
1145 Edit the previous file from the argument list.
1148 command will fail if the file has been modified since the last complete
1150 This check can be overridden by appending the
1152 character to the command name.
1154 Capitalizing the first letter of the command, i.e.
1158 mode, will edit the file in a new screen.
1159 In this case, any modifications to the current file are ignored.
1162 Set as described for the
1166 Affected by the options
1174 @deftypefn Command {[range]} {p[rint]} {[count] [flags]}
1176 Display the specified lines.
1179 Set to the last line displayed.
1189 @deftypefn Command {[line]} {pu[t]} {[buffer]}
1191 Append buffer contents to the current line.
1192 If a buffer is specified, its contents are appended to the line,
1193 otherwise, the contents of the unnamed buffer are used.
1196 Set to the line after the current line.
1202 @deftypefn Command {} {q[uit][!]}
1204 End the editing session.
1205 If the file has been modified since the last complete write, the
1208 This check may be overridden by appending a
1210 character to the command.
1212 If there are more files to edit, the
1217 character to the command name or entering two
1225 in a row) will override this check and the editor will exit.
1234 @deftypefn Command {[line]} {r[ead][!]} {[file]}
1237 A copy of the specified file is appended to the line.
1239 @LI{line}is 0, the copy is inserted at the beginning of the file.
1240 If no file is specified, the current file is read; if there is no
1242 @LI{file}becomes the current file.
1243 If there is no current file and no
1244 @LI{file}is specified, then the
1249 @LI{file}is preceded by a
1252 @LI{file}is treated as if it were a shell command, and passed to the program
1256 The standard and standard error outputs of that command are read into
1257 the file after the specified line.
1258 The special meaning of the
1260 character can be overridden by escaping it with a backslash
1267 the current line is set to the last line read.
1270 the current line is set to the first line read.
1276 @deftypefn Command {} {rec[over]} {file}
1279 @LI{file}if it was previously saved.
1280 If no saved file by that name exists, the
1282 command behaves equivalently to the
1287 Set as described for the
1295 @deftypefn Command {} {res[ize]} {[+|-]size}
1299 Grow or shrink the current screen.
1301 @LI{size}is a positive, signed number, the current screen is grown by that many lines.
1303 @LI{size}is a negative, signed number, the current screen is shrunk by that many lines.
1305 @LI{size}is not signed, the current screen is set to the specified
1307 Applicable only to split screens.
1316 @deftypefn Command {} {rew[ind][!]}
1318 Rewind the argument list.
1319 If the current file has been modified since the last complete write,
1323 This check may be overridden by appending the
1325 character to the command.
1327 Otherwise, the current file is set to the first file in the argument
1331 Set as described for the
1343 @deftypefn Command {} {se[t]} {[option[=[value]] ...] [nooption ...] [option? ...] [all]}
1345 Display or set editor options.
1346 When no arguments are specified, the editor option
1348 and any editor options whose values have been changed from the
1349 default settings are displayed.
1351 @LI{all}is specified, the values of all of editor options are displayed.
1353 Specifying an option name followed by the character
1355 causes the current value of that option to be displayed.
1358 can be separated from the option name by whitespace characters.
1361 is necessary only for Boolean valued options.
1362 Boolean options can be given values by the form
1367 String and numeric options can be assigned by the form
1368 @QT{set option=value}.
1369 Any whitespace characters in strings can be included literally by preceding
1370 each with a backslash.
1371 More than one option can be set or listed by a single set command,
1372 by specifying multiple arguments, each separated from the next by
1373 whitespace characters.
1382 @deftypefn Command {} {sh[ell]}
1384 Run the shell program.
1385 The program named by the
1387 option is run with a
1389 (for interactive) flag.
1390 Editing is resumed when that program exits.
1401 @deftypefn Command {} {so[urce]} {file}
1405 commands from a file.
1407 commands may be nested.
1416 @deftypefn Command {[range]} {s[ubstitute]} {[/pattern/replace/] [options] [count] [flags]}
1419 @deftypefnx Command {[range]} {&} {[options] [count] [flags]}
1421 @deftypefnx Command {[range]} {~} {[options] [count] [flags]}
1423 Replace the first instance of
1424 @LI{pattern}with the string
1425 @LI{replace}on the specified line(s).
1428 argument is not specified, the
1433 Any character other than an alphabetic, numeric, <blank> or backslash
1434 character may be used as the delimiter.
1437 @LI{options}includes the letter
1439 (confirm), you will be prompted for confirmation before each replacement
1441 An affirmative response (in English, a
1443 character) causes the replacement to be made.
1444 A quit response (in English, a
1446 character) causes the
1448 command to be terminated.
1449 Any other response causes the replacement not to be made, and the
1453 @LI{options}includes the letter
1455 (global), all nonoverlapping instances of
1456 @LI{pattern}in the line are replaced.
1460 version of the command is the same as not specifying a pattern
1461 or replacement string to the
1465 is replaced by the pattern and replacement information from the
1466 previous substitute command.
1470 version of the command is the same as
1474 except that the search pattern used is the last RE used in
1476 command, not necessarily the one used in the last
1480 For example, in the sequence
1493 command may be interrupted, using the terminal interrupt character.
1494 All substitutions completed before the interrupt are retained.
1497 Set to the last line upon which a substitution was made.
1507 @deftypefn Command {} {su[spend][!]}
1510 @deftypefnx Command {} {st[op][!]}
1511 @deftypefnx Comamnd {} <control-Z>
1512 Suspend the edit session.
1515 character to these commands turns off the
1517 option for the command.
1530 @deftypefn Command {} {ta[g][!]} {tagstring}
1532 Edit the file containing the specified tag.
1533 If the tag is in a different file, then the new file is edited.
1534 If the current file has been modified since the last complete write,
1538 This check can be overridden by appending the
1540 character to the command name.
1544 command searches for
1545 @LI{tagstring}in the tags file(s) specified by the
1550 for more information on tags files.)
1552 Capitalizing the first letter of the command, i.e.
1556 mode, will edit the file in a new screen.
1557 In this case, any modifications to the current file are ignored.
1560 Set to the line indicated by the tag.
1572 @deftypefn Command {} {tagn[ext][!]}
1574 Edit the file containing the next context for the current tag.
1575 If the context is in a different file, then the new file is edited.
1576 If the current file has been modified since the last complete write,
1580 This check can be overridden by appending the
1582 character to the command name.
1584 Capitalizing the first letter of the command, i.e.
1588 mode, will edit the file in a new screen.
1589 In this case, any modifications to the current file are ignored.
1592 Set to the line indicated by the tag.
1602 @deftypefn Command {} {tagp[op][!]} {[file | number]}
1604 Pop to the specified tag in the tags stack.
1607 @LI{number}is specified, the
1609 command pops to the most recent entry on the tags stack.
1612 @LI{number}is specified, the
1614 command pops to the most recent entry in the tags stack for that file,
1615 or numbered entry in the tags stack, respectively.
1618 command for information on displaying the tags stack.)
1620 If the file has been modified since the last complete write, the
1623 This check may be overridden by appending a
1625 character to the command name.
1628 Set to the line indicated by the tag.
1638 @deftypefn Command {} {tagp[rev][!]}
1640 Edit the file containing the previous context for the current tag.
1641 If the context is in a different file, then the new file is edited.
1642 If the current file has been modified since the last complete write,
1646 This check can be overridden by appending the
1648 character to the command name.
1650 Capitalizing the first letter of the command, i.e.
1654 mode, will edit the file in a new screen.
1655 In this case, any modifications to the current file are ignored.
1658 Set to the line indicated by the tag.
1668 @deftypefn Command {} {tagt[op][!]}
1670 Pop to the least recent tag on the tags stack, clearing the tags stack.
1672 If the file has been modified since the last complete write, the
1675 This check may be overridden by appending a
1677 character to the command name.
1680 Set to the line indicated by the tag.
1690 @deftypefn Command {} {una[bbrev]} {lhs}
1692 Delete an abbreviation.
1694 @LI{lhs}from the current list of abbreviations.
1703 @deftypefn Command {} {u[ndo]}
1705 Undo the last change made to the file.
1710 and map sequences are considered a single command.
1713 command alternates between these two states, and is its own inverse.
1716 Set to the last line modified by the command.
1722 @deftypefn Command {} {unm[ap][!]} {lhs}
1724 Unmap a mapped string.
1725 Delete the command mode map definition for
1729 character is appended to the command name, delete the text input mode
1730 map definition instead.
1739 @deftypefn Command {} {ve[rsion]}
1741 Display the version of the
1746 @deftypefn Command {[line]} {vi[sual]} {[type] [count] [flags]}
1753 @LI{type}is optional, and can be
1761 command, to specify the position of the specified line in the screen
1763 (The default is to place the line at the top of the screen window.)
1765 @LI{count}specifies the number of lines that will initially be displayed.
1766 (The default is the value of the
1772 @LI{line}is specified, in which case it is set to that line.
1778 @deftypefn Command {} {vi[sual][!]} {[+cmd] [file]}
1784 @QT{edit[!] [+cmd] [file]}
1787 Capitalizing the first letter of the command, i.e.
1789 will edit the file in a new screen.
1790 In this case, any modifications to the current file are ignored.
1793 @deftypefn Command {} {viu[sage]} {[command]}
1799 @LI{command}is specified, a usage statement for that command is displayed.
1800 Otherwise, usage statements for all
1802 commands are displayed.
1811 @deftypefn Command {[range]} {w[rite][!]} {[>>] [file]}
1813 @deftypefnx Command {[range]} {w[rite]} {[!] [file]}
1815 @deftypefnx Command {[range]} {wn[!]} {[>>] [file]}
1817 @deftypefnx Command {[range]} {wq[!]} {[>>] [file]}
1819 The specified lines (the entire file, if no range is given) is written
1823 @LI{file}is not specified, the current pathname is used.
1825 @LI{file}is specified, and it exists, or if the current pathname was set using the
1827 command, and the file already exists, these commands will fail.
1830 character to the command name will override this check and the write
1831 will be attempted, regardless.
1833 Specifying the optional
1835 string will cause the write to be appended to the file, in which case
1836 no tests are made for the file already existing.
1838 If the file is preceded by a
1840 character, the program named by the shell edit option is
1841 invoked with file as its second argument, and the specified
1842 lines are passed as standard input to that command.
1845 in this usage must be separated from command name by at least one
1846 whitespace character.
1847 The special meaning of the
1849 may be overridden by escaping it with a backslash
1855 version of the write command will exit the editor after writing the file,
1856 if there are no further files to edit.
1859 character to the command name or entering two
1867 in a row) will override this check and the editor will exit,
1868 ignoring any files that have not yet been edited.
1872 version of the write command will move to the next file after writing
1873 the file, unless the write fails.
1886 @deftypefn Command {[range]} {x[it][!]} {[file]}
1888 Write the file if it has been modified.
1889 The specified lines are written to
1891 if the file has been modified since the last complete write to any
1894 @LI{range}is specified, the entire file is written.
1898 command will exit the editor after writing the file,
1899 if there are no further files to edit.
1902 character to the command name or entering two
1910 in a row) will override this check and the editor will exit,
1911 ignoring any files that have not yet been edited.
1924 @deftypefn Command {[range]} {ya[nk]} {[buffer] [count]}
1926 Copy the specified lines to a buffer.
1927 If no buffer is specified, the unnamed buffer is used.
1936 @deftypefn Command {[line]} {z} {[type] [count] [flags]}
1940 @LI{type}is specified, then
1941 @LI{count}lines following the specified line are displayed.
1943 @LI{count}is the value of the
1947 @LI{type}argument changes the position at which
1948 @LI{line}is displayed on the screen by changing the number of lines
1949 displayed before and after
1952 @LI{type}characters may be used:
1955 Place the line at the bottom of the screen.
1957 Place the line at the top of the screen.
1959 Place the line in the middle of the screen.
1961 Write out count lines starting
1962 @LI{count * 2}lines before
1964 the net effect of this is that a
1968 command writes the previous page.
1971 @LI{line}on the screen with a line of hyphens displayed immediately before and
1973 The number of preceding and following lines of text displayed are
1974 reduced to account for those lines.
1978 Set to the last line displayed, with the exception of the
1981 where the current line is set to the line specified by the command.