1 @comment Copyright (c) 1994
2 @comment The Regents of the University of California. All rights reserved.
3 @comment Copyright (c) 1994, 1995, 1996
4 @comment Keith Bostic. All rights reserved.
6 @comment See the LICENSE file for redistribution information.
8 @comment Id: ex.cmd.texi,v 8.2 2001/08/20 16:05:50 skimo Exp (Berkeley) Date: 2001/08/20 16:05:50
10 @chapter Ex Description
12 The following words have special meanings for
16 @cindex "<end-of-file>"
19 The end-of-file character is used to scroll the screen in the
22 This character is normally
24 However, whatever character is set for the current terminal is supported
30 A single-line address, given in any of the forms described in the
34 @LI{line}is the current line.
38 A line, or a pair of line addresses, separated by a comma or semicolon.
39 (See the section entitled
41 for more information.)
42 The default for range is the current line
50 The starting address must be less than, or equal to, the ending address.
54 A positive integer, specifying the number of lines to be affected by
55 the command; the default is 1.
56 Generally, a count past the end-of-file may be specified, e.g. the
59 in a 10 line file is acceptable, and will print from the current line
60 through the last line in the file.
64 One or more of the characters
69 When a command that accepts these flags completes, the addressed line(s)
70 are written out as if by the corresponding
76 In addition, any number of
80 characters can be specified before, after, or during the flags, in which
81 case the line written is not necessarily the one affected by the command,
82 but rather the line addressed by the offset address specified.
88 A pattern used to derive a pathname; the default is the current file.
89 File names are subjected to normal
94 Anywhere a file name is specified, it is also possible to use
97 This will be replaced with a temporary file name which can be used
98 for temporary work, e.g.
100 creates and edits a new file.
102 If both a count and a range are specified for commands that use either,
103 the starting line for the command is the
105 line addressed by the range, and
107 subsequent lines are affected by the command, e.g. the command
109 prints out lines 3, 4, 5 and 6.
111 When only a line or range is specified, with no command, the implied
118 The command used is the most recent of the three commands to have been
119 used (including any use as a flag).
120 If none of these commands have been used before, the
122 command is the implied command.
123 When no range or count is specified and the command line is a blank line,
124 the current line is incremented by 1 and then the current line is displayed.
126 Zero or more whitespace characters may precede or follow the addresses,
127 count, flags, or command name.
128 Any object following a command name (such as buffer, file, etc.),
129 that begins with an alphabetic character,
130 should be separated from the command name by at least one whitespace
133 Any character, including
134 @LI{<carriage-return>},
138 retain their literal value when preceded by a backslash.
141 The following section describes the commands available in the
144 In each entry below, the tag line is a usage synopsis for the command.
146 Each command can be entered as the abbreviation
147 (those characters in the synopsis command word preceding the
150 the full command (all characters shown for the command word,
156 or any leading subset of the full command down to the abbreviation.
157 For example, the args command (shown as
168 command described below notes the new current line after it
169 is executed, as well as any options that affect the command.
171 @deftypefn Command {} {"}
174 Command lines beginning with the double-quote character
177 This permits comments in editor scripts and startup files.
179 @cindex "<control-D>"
180 @cindex "<end-of-file>"
181 @deftypefn Command {} {<control-D>}
183 @deftypefnx Command {} {<end-of-file>}
186 Write the next N lines, where N is the value of the
189 The command is the end-of-file terminal character, which may be
190 different on different terminals.
191 Traditionally, it is the
196 command ignored any preceding count, and the
197 @LI{<end-of-file>}character was ignored unless it was entered as the first character
199 This implementation treats it as a command
201 if entered as the first character of the command line, and otherwise
202 treats it as any other character.
205 Set to the last line written.
213 @deftypefn Command {} {!} {argument(s)}
215 @deftypefnx Command {} {[range]!} {argument(s)}
216 Execute a shell command, or filter lines through a shell command.
217 In the first synopsis, the remainder of the line after the
219 character is passed to the program named by the
221 option, as a single argument.
223 Within the rest of the line,
227 are expanded into the current and alternate pathnames, respectively.
230 is expanded with the command text of the previous
233 (Therefore, the command
238 The special meanings of
243 can be overridden by escaping them with a backslash.
248 command has yet been executed, it is an error to use an unescaped
255 do shell expansion on the strings provided as arguments.
256 If any of the above expansions change the command the user entered,
257 the command is redisplayed at the bottom of the screen.
260 then executes the program named by the
264 flag followed by the arguments (which are bundled into a single argument).
268 command is permitted in an empty file.
270 If the file has been modified since it was last completely written,
273 command will warn you.
277 character is displayed when the command completes.
279 In the second form of the
281 command, the remainder of the line after the
283 is passed to the program named by the
285 option, as described above.
286 The specified lines are passed to the program as standard input,
287 and the standard and standard error output of the program replace
291 Unchanged if no range was specified, otherwise set to the first
302 @deftypefn Command {[range]} {#} {[count] [flags]}
305 @deftypefnx Command {[range]} {nu[mber]} {[count] [flags]}
306 Display the selected lines, each preceded with its line number.
308 The line number format is
310 followed by two spaces.
313 Set to the last line displayed.
321 @deftypefn Command {@@} {buffer}
324 @deftypefnx Command {} {*} {buffer}
326 Each line in the named buffer is executed as an
329 If no buffer is specified, or if the specified buffer is
333 the last buffer executed is used.
336 @deftypefn Command {[range]} {<[< ...]} {[count] [flags]}
338 Shift lines left or right.
339 The specified lines are shifted to the left (for the
341 command) or right (for the
343 command), by the number of columns specified by the
346 Only leading whitespace characters are deleted when shifting left;
347 once the first column of the line contains a nonblank character,
350 command will succeed, but the line will not be modified.
352 If the command character
356 is repeated more than once, the command is repeated once for each
357 additional command character.
360 If the current line is set to one of the lines that are affected
361 by the command, it is unchanged.
362 Otherwise, it is set to the first nonblank character of the lowest
363 numbered line shifted.
371 @deftypefn Command {[line]} {=} {[flags]}
373 Display the line number of
374 @LI{line}(which defaults to the last line in the file).
383 @deftypefn Command {[range]} {>[> ...]} {[count] [flags]}
386 The specified lines are shifted to the right by the number of columns
389 option, by inserting tab and space characters.
390 Empty lines are not changed.
392 If the command character
394 is repeated more than once, the command is repeated once for each
395 additional command character.
398 Set to the last line modified by the command.
406 @deftypefn Command {} {ab[brev]} {lhs rhs}
408 Add an abbreviation to the current abbreviation list.
409 When inserting text in
411 each time a non-word character is entered after a word character,
412 a set of characters ending at the word character are checked for
415 If a match is found, they are replaced with
417 The set of characters that are checked for a match are defined as follows,
418 for inexplicable historical reasons.
419 If only one or two characters were entered before the non-word character
420 that triggered the check,
421 and after the beginning of the insertion,
422 or the beginning of the line or the file,
424 @LI{<blank>}character that was entered,
425 then the one or the both characters are checked for a match.
426 Otherwise, the set includes both characters,
427 as well as the characters that precede them that are the same word
428 class (i.e. word or non-word) as the
430 to last character entered before the non-word character that triggered
433 @LI{<blank>}character,
434 the beginning of the insertion,
435 or the beginning of the line or the file.
437 For example, the abbreviations:
439 @multitable {:abbreviate} {/*#i} {/********************}
440 @item :abbreviate @tab abc @tab ABC
441 @item :abbreviate @tab #i @tab #include
442 @item :abbreviate @tab /*#i @tab /*#include
444 will all work, while the abbreviations:
446 @multitable {:abbreviate} {/*#i} {/********************}
447 @item :abbreviate @tab a#i @tab A#include
448 @item :abbreviate @tab /* @tab /********************
450 will not work, and are not permitted by
453 To keep the abbreviation expansion from happening,
454 the character immediately following the
455 @LI{lhs}characters should be quoted with a
456 @LI{<literal-next>}character.
459 @LI{rhs}is itself subject to both further abbreviation expansion and further
469 @deftypefn Command {[line]} {a[ppend][!]}
471 The input text is appended to the specified line.
472 If line 0 is specified, the text is inserted at the beginning of the file.
473 Set to the last line input.
474 If no lines are input, then set to
476 or to the first line of the file if a
477 @LI{line}of 0 was specified.
478 Following the command name with a
482 option to be toggled for the duration of the command.
495 @deftypefn Command {} {ar[gs]}
497 Display the argument list.
498 The current argument is displayed inside of
503 The argument list is the list of operands specified on startup,
504 which can be replaced using the
515 @deftypefn Command {} {bg}
519 Background the current screen.
520 The screen is unchanged,
521 but is no longer accessible and disappears from the display.
524 command to bring the screen back to the display foreground.
527 Set to the current line when the screen was last edited.
533 @deftypefn Command {[range]} {c[hange][!]} {[count]}
535 Replace the lines with input text.
536 Following the command name with a
540 option to be toggled for the duration of the command.
543 Set to the last line input, or, if no lines were input,
544 set to the line before the target line, or to the first
545 line of the file if there are no lines preceding the target line.
556 @deftypefn Command {} {chd[ir][!]} {[directory]}
558 @deftypefnx Command {} {cd[!]} {[directory]}
559 Change the current working directory.
561 @LI{directory}argument is subjected to
564 When invoked with no directory argument and the
565 @LI{HOME}environment variable is set, the directory named by the
566 @LI{HOME}environment variable becomes the new current directory.
567 Otherwise, the new current directory becomes the directory returned
574 command will fail if the file has been modified since the last complete
576 You can override this check by appending a
578 character to the command.
590 @deftypefn Command {[range]} {co[py]} {line [flags]}
592 @deftypefnx Command {[range]} {t} {line [flags]}
593 Copy the specified lines (range) after the destination line.
594 Line 0 may be specified to insert the lines at the beginning of
604 @deftypefn Command {} {cs[cope]} {command [args]}
609 For more information, see the section of the reference manual entitled
610 @QB{Tags, Tag Stacks, and Cscope} .
613 @deftypefn Command {[range]} {d[elete]} {[buffer] [count] [flags]}
615 Delete the lines from the file.
616 The deleted text is saved in the specified buffer, or, if no buffer
617 is specified, in the unnamed buffer.
618 If the command name is followed by a letter that could be interpreted
619 as either a buffer name or a flag value (because neither a
621 @LI{flags}values were given),
623 treats the letter as a
624 @LI{flags}value if the letter immediately follows the command name,
625 without any whitespace separation.
626 If the letter is preceded by whitespace characters,
627 it treats it as a buffer name.
630 Set to the line following the deleted lines,
631 or to the last line if the deleted lines were at the end.
637 @deftypefn Command {} {di[splay]} {b[uffers] | c[onnections] | s[creens] | t[ags]}
641 connections, screens or tags.
644 command takes one of three additional arguments, which are as follows:
647 Display all buffers (including named, unnamed, and numeric)
650 Display the source directories for all attached
654 Display the file names of all background screens.
656 Display the tags stack.
666 @deftypefn Command {} {e[dit][!]} {[+cmd] [file]}
667 @deftypefnx Command {} {ex[!]} {[+cmd] [file]}
668 @deftypefnx Command {} {vs[plit][!]} {[+cmd] [file]}
669 Edit a different file.
670 If the current buffer has been modified since the last complete write,
671 the command will fail.
672 You can override this by appending a
674 character to the command name.
678 option is specified, that
680 command will be executed in the new file.
683 command may be used, although the most common use of this feature is
684 to specify a line number or search pattern to set the initial location
687 Capitalizing the first letter of the command, i.e.,
693 mode, will edit the file in a new screen.
694 In this case, any modifications to the current file are ignored.
695 @cindex vertical split
696 @cindex splitting, vertically
697 @CO{vsplit} is similar, but the screen will be split vertically
698 to produce the new screen, rather than horizontally.
702 If you have previously edited the file, the current line will be set
703 to your last position in the file.
704 If that position does not exist, or you have not previously edited the
705 file, the current line will be set to the first line of the file if
708 mode, and the last line of the file if you are in
715 @deftypefn Command {} {exu[sage]} {[command]}
721 @LI{command}is specified, a usage statement for that command is displayed.
722 Otherwise, usage statements for all
724 commands are displayed.
733 @deftypefn Command {} {f[ile]} {[file]}
735 Display and optionally change the file name.
736 If a file name is specified, the current pathname is changed to the
738 The current pathname, the number of lines, and the current position
739 in the file are displayed.
748 @deftypefn Command {} {fg} {[name]}
752 Foreground the specified screen.
753 If the argument name doesn't exactly match the name of a file displayed
754 by a background screen,
755 it is compared against the last component of each of the file names.
756 If no background screen is specified,
757 the first background screen is foregrounded.
760 foregrounding causes the current screen to be swapped with the backgrounded
762 Capitalizing the first letter of the command, i.e.
764 will foreground the backgrounded screen in a new screen instead of
765 swapping it with the current screen.
768 Set to the current line when the screen was last edited.
774 @deftypefn Command {[range]} {g[lobal]} {/pattern/ [commands]}
777 @deftypefnx Command {[range]} {v} {/pattern/ [commands]}
778 Apply commands to lines matching (or not matching) a pattern.
779 The lines within the given range that match
783 the given pattern are selected.
786 command(s) are executed with the current line
788 set to each selected line.
789 If no range is specified, the entire file is searched for matching,
790 or not matching, lines.
792 Multiple commands can be specified, one per line, by escaping each
793 @LI{<newline>}character with a backslash, or by separating commands with a
796 If no commands are specified, the command defaults to the
805 commands, the input text must be part of the global command line.
806 In this case, the terminating period can be omitted if it ends the commands.
810 command may also be specified as one of the
813 In this mode, input is taken from the terminal.
818 mode causes the next line matching the pattern to be selected and
820 to be reentered, until the list is exhausted.
827 commands cannot be used as part of these commands.
834 are turned off for the duration of the
841 The last line modified.
857 @deftypefn Command {} {he[lp]}
859 Display a help message.
868 @deftypefn Command {[line]} {i[nsert][!]}
870 The input text is inserted before the specified line.
871 Following the command name with a
875 option setting to be toggled for the duration of this command.
878 Set to the last line input; if no lines were input,
879 set to the line before the target line, or to the first line
880 of the file if there are no lines preceding the target line.
889 @deftypefn Command {[range]} {j[oin][!]} {[count] [flags]}
891 Join lines of text together.
894 @LI{count}specified to the
896 command specifies that the last line of the
898 @LI{count}subsequent lines will be joined.
899 (Note, this differs by one from the general rule where only
901 subsequent lines are affected.)
903 If the current line ends with a whitespace character, all whitespace
904 is stripped from the next line.
905 Otherwise, if the next line starts with a open parenthesis
908 Otherwise, if the current line ends with a question mark
915 Otherwise, insert a single space.
919 character to the command name causes a simpler join with no
920 white-space processing.
929 @deftypefn Command {[range]} {l[ist]} {[count] [flags]}
931 Display the lines unambiguously.
932 Tabs are displayed as
934 and the end of the line is marked with a
939 Set to the last line displayed.
947 @deftypefn Command {} {map[!]} {[lhs rhs]}
949 Define or display maps (for
957 are not specified, the current set of command mode maps are displayed.
960 character is appended to to the command,
961 the text input mode maps are displayed.
965 character sequence is entered in
967 the action is as if the corresponding
972 character is appended to the command name,
973 the mapping is effective during text input mode,
974 otherwise, it is effective during command mode.
977 to have two different macro definitions at the same time: one for command
978 mode and one for input mode.
980 Whitespace characters require escaping with a
981 @LI{<literal-next>}character to be entered in the
982 @LI{lhs}string in visual mode.
984 Normally, keys in the
985 @LI{rhs}string are remapped (see the
988 and it is possible to create infinite loops.
989 However, keys which map to themselves are not further remapped,
990 regardless of the setting of the
993 For example, the command
1003 To exit an infinitely looping map, use the terminal
1004 @LI{<interrupt>}character.
1016 @deftypefn Command {[line]} {ma[rk]} {<character>}
1018 @deftypefnx Command {[line]} {k} {<character>}
1019 Mark the line with the mark
1025 can then be used as an address in any command that uses one.
1034 @deftypefn Command {[range]} {m[ove]} {line}
1036 Move the specified lines after the target line.
1037 A target line of 0 places the lines at the beginning of the file.
1040 Set to the first of the moved lines.
1046 @deftypefn Command {} {mk[exrc][!]} {file}
1048 Write the abbreviations, editor options and maps to the specified
1050 Information is written in a form which can later be read back in
1056 @LI{file}already exists, the
1059 This check can be overridden by appending a
1061 character to the command.
1070 @deftypefn Command {} {n[ext][!]} {[file ...]}
1072 Edit the next file from the argument list.
1075 command will fail if the file has been modified since the last complete
1077 This check can be overridden by appending the
1079 character to the command name.
1080 The argument list can optionally be replaced by specifying a new one
1081 as arguments to this command.
1082 In this case, editing starts with the first file on the new list.
1084 Capitalizing the first letter of the command, i.e.
1088 mode, will set the argument list and edit the file in a new screen.
1089 In this case, any modifications to the current file are ignored.
1092 Set as described for the
1096 Affected by the options
1103 @deftypefn Command {[line]} {o[pen]} {/pattern/ [flags]}
1106 Open mode is the same as being in
1108 but with a one-line window.
1111 commands are available.
1112 If a match is found for the optional RE argument,
1113 the cursor is set to the start of the matching pattern.
1115 @emph{This command is not yet implemented.}
1118 Unchanged, unless the optional RE is specified, in which case it is
1119 set to the line where the matching pattern is found.
1127 @deftypefn Command {} {pre[serve]}
1129 Save the file in a form that can later be recovered using the
1133 When the file is preserved, an email message is sent to the user.
1142 @deftypefn Command {} {prev[ious][!]}
1144 Edit the previous file from the argument list.
1147 command will fail if the file has been modified since the last complete
1149 This check can be overridden by appending the
1151 character to the command name.
1153 Capitalizing the first letter of the command, i.e.
1157 mode, will edit the file in a new screen.
1158 In this case, any modifications to the current file are ignored.
1161 Set as described for the
1165 Affected by the options
1173 @deftypefn Command {[range]} {p[rint]} {[count] [flags]}
1175 Display the specified lines.
1178 Set to the last line displayed.
1188 @deftypefn Command {[line]} {pu[t]} {[buffer]}
1190 Append buffer contents to the current line.
1191 If a buffer is specified, its contents are appended to the line,
1192 otherwise, the contents of the unnamed buffer are used.
1195 Set to the line after the current line.
1201 @deftypefn Command {} {q[uit][!]}
1203 End the editing session.
1204 If the file has been modified since the last complete write, the
1207 This check may be overridden by appending a
1209 character to the command.
1211 If there are more files to edit, the
1216 character to the command name or entering two
1224 in a row) will override this check and the editor will exit.
1233 @deftypefn Command {[line]} {r[ead][!]} {[file]}
1236 A copy of the specified file is appended to the line.
1238 @LI{line}is 0, the copy is inserted at the beginning of the file.
1239 If no file is specified, the current file is read; if there is no
1241 @LI{file}becomes the current file.
1242 If there is no current file and no
1243 @LI{file}is specified, then the
1248 @LI{file}is preceded by a
1251 @LI{file}is treated as if it were a shell command, and passed to the program
1255 The standard and standard error outputs of that command are read into
1256 the file after the specified line.
1257 The special meaning of the
1259 character can be overridden by escaping it with a backslash
1266 the current line is set to the last line read.
1269 the current line is set to the first line read.
1275 @deftypefn Command {} {rec[over]} {file}
1278 @LI{file}if it was previously saved.
1279 If no saved file by that name exists, the
1281 command behaves equivalently to the
1286 Set as described for the
1294 @deftypefn Command {} {res[ize]} {[+|-]size}
1298 Grow or shrink the current screen.
1300 @LI{size}is a positive, signed number, the current screen is grown by that many lines.
1302 @LI{size}is a negative, signed number, the current screen is shrunk by that many lines.
1304 @LI{size}is not signed, the current screen is set to the specified
1306 Applicable only to split screens.
1315 @deftypefn Command {} {rew[ind][!]}
1317 Rewind the argument list.
1318 If the current file has been modified since the last complete write,
1322 This check may be overridden by appending the
1324 character to the command.
1326 Otherwise, the current file is set to the first file in the argument
1330 Set as described for the
1342 @deftypefn Command {} {se[t]} {[option[=[value]] ...] [nooption ...] [option? ...] [all]}
1344 Display or set editor options.
1345 When no arguments are specified, the editor option
1347 and any editor options whose values have been changed from the
1348 default settings are displayed.
1350 @LI{all}is specified, the values of all of editor options are displayed.
1352 Specifying an option name followed by the character
1354 causes the current value of that option to be displayed.
1357 can be separated from the option name by whitespace characters.
1360 is necessary only for Boolean valued options.
1361 Boolean options can be given values by the form
1366 String and numeric options can be assigned by the form
1367 @QT{set option=value}.
1368 Any whitespace characters in strings can be included literally by preceding
1369 each with a backslash.
1370 More than one option can be set or listed by a single set command,
1371 by specifying multiple arguments, each separated from the next by
1372 whitespace characters.
1381 @deftypefn Command {} {sh[ell]}
1383 Run the shell program.
1384 The program named by the
1386 option is run with a
1388 (for interactive) flag.
1389 Editing is resumed when that program exits.
1400 @deftypefn Command {} {so[urce]} {file}
1404 commands from a file.
1406 commands may be nested.
1415 @deftypefn Command {[range]} {s[ubstitute]} {[/pattern/replace/] [options] [count] [flags]}
1418 @deftypefnx Command {[range]} {&} {[options] [count] [flags]}
1420 @deftypefnx Command {[range]} {~} {[options] [count] [flags]}
1422 Replace the first instance of
1423 @LI{pattern}with the string
1424 @LI{replace}on the specified line(s).
1427 argument is not specified, the
1432 Any character other than an alphabetic, numeric, <blank> or backslash
1433 character may be used as the delimiter.
1436 @LI{options}includes the letter
1438 (confirm), you will be prompted for confirmation before each replacement
1440 An affirmative response (in English, a
1442 character) causes the replacement to be made.
1443 A quit response (in English, a
1445 character) causes the
1447 command to be terminated.
1448 Any other response causes the replacement not to be made, and the
1452 @LI{options}includes the letter
1454 (global), all nonoverlapping instances of
1455 @LI{pattern}in the line are replaced.
1459 version of the command is the same as not specifying a pattern
1460 or replacement string to the
1464 is replaced by the pattern and replacement information from the
1465 previous substitute command.
1469 version of the command is the same as
1473 except that the search pattern used is the last RE used in
1475 command, not necessarily the one used in the last
1479 For example, in the sequence
1492 command may be interrupted, using the terminal interrupt character.
1493 All substitutions completed before the interrupt are retained.
1496 Set to the last line upon which a substitution was made.
1506 @deftypefn Command {} {su[spend][!]}
1509 @deftypefnx Command {} {st[op][!]}
1510 @deftypefnx Comamnd {} <control-Z>
1511 Suspend the edit session.
1514 character to these commands turns off the
1516 option for the command.
1529 @deftypefn Command {} {ta[g][!]} {tagstring}
1531 Edit the file containing the specified tag.
1532 If the tag is in a different file, then the new file is edited.
1533 If the current file has been modified since the last complete write,
1537 This check can be overridden by appending the
1539 character to the command name.
1543 command searches for
1544 @LI{tagstring}in the tags file(s) specified by the
1549 for more information on tags files.)
1551 Capitalizing the first letter of the command, i.e.
1555 mode, will edit the file in a new screen.
1556 In this case, any modifications to the current file are ignored.
1559 Set to the line indicated by the tag.
1571 @deftypefn Command {} {tagn[ext][!]}
1573 Edit the file containing the next context for the current tag.
1574 If the context is in a different file, then the new file is edited.
1575 If the current file has been modified since the last complete write,
1579 This check can be overridden by appending the
1581 character to the command name.
1583 Capitalizing the first letter of the command, i.e.
1587 mode, will edit the file in a new screen.
1588 In this case, any modifications to the current file are ignored.
1591 Set to the line indicated by the tag.
1601 @deftypefn Command {} {tagp[op][!]} {[file | number]}
1603 Pop to the specified tag in the tags stack.
1606 @LI{number}is specified, the
1608 command pops to the most recent entry on the tags stack.
1611 @LI{number}is specified, the
1613 command pops to the most recent entry in the tags stack for that file,
1614 or numbered entry in the tags stack, respectively.
1617 command for information on displaying the tags stack.)
1619 If the file has been modified since the last complete write, the
1622 This check may be overridden by appending a
1624 character to the command name.
1627 Set to the line indicated by the tag.
1637 @deftypefn Command {} {tagp[rev][!]}
1639 Edit the file containing the previous context for the current tag.
1640 If the context is in a different file, then the new file is edited.
1641 If the current file has been modified since the last complete write,
1645 This check can be overridden by appending the
1647 character to the command name.
1649 Capitalizing the first letter of the command, i.e.
1653 mode, will edit the file in a new screen.
1654 In this case, any modifications to the current file are ignored.
1657 Set to the line indicated by the tag.
1667 @deftypefn Command {} {tagt[op][!]}
1669 Pop to the least recent tag on the tags stack, clearing the tags stack.
1671 If the file has been modified since the last complete write, the
1674 This check may be overridden by appending a
1676 character to the command name.
1679 Set to the line indicated by the tag.
1689 @deftypefn Command {} {una[bbrev]} {lhs}
1691 Delete an abbreviation.
1693 @LI{lhs}from the current list of abbreviations.
1702 @deftypefn Command {} {u[ndo]}
1704 Undo the last change made to the file.
1709 and map sequences are considered a single command.
1712 command alternates between these two states, and is its own inverse.
1715 Set to the last line modified by the command.
1721 @deftypefn Command {} {unm[ap][!]} {lhs}
1723 Unmap a mapped string.
1724 Delete the command mode map definition for
1728 character is appended to the command name, delete the text input mode
1729 map definition instead.
1738 @deftypefn Command {} {ve[rsion]}
1740 Display the version of the
1745 @deftypefn Command {[line]} {vi[sual]} {[type] [count] [flags]}
1752 @LI{type}is optional, and can be
1760 command, to specify the position of the specified line in the screen
1762 (The default is to place the line at the top of the screen window.)
1764 @LI{count}specifies the number of lines that will initially be displayed.
1765 (The default is the value of the
1771 @LI{line}is specified, in which case it is set to that line.
1777 @deftypefn Command {} {vi[sual][!]} {[+cmd] [file]}
1783 @QT{edit[!] [+cmd] [file]}
1786 Capitalizing the first letter of the command, i.e.
1788 will edit the file in a new screen.
1789 In this case, any modifications to the current file are ignored.
1792 @deftypefn Command {} {viu[sage]} {[command]}
1798 @LI{command}is specified, a usage statement for that command is displayed.
1799 Otherwise, usage statements for all
1801 commands are displayed.
1810 @deftypefn Command {[range]} {w[rite][!]} {[>>] [file]}
1812 @deftypefnx Command {[range]} {w[rite]} {[!] [file]}
1814 @deftypefnx Command {[range]} {wn[!]} {[>>] [file]}
1816 @deftypefnx Command {[range]} {wq[!]} {[>>] [file]}
1818 The specified lines (the entire file, if no range is given) is written
1822 @LI{file}is not specified, the current pathname is used.
1824 @LI{file}is specified, and it exists, or if the current pathname was set using the
1826 command, and the file already exists, these commands will fail.
1829 character to the command name will override this check and the write
1830 will be attempted, regardless.
1832 Specifying the optional
1834 string will cause the write to be appended to the file, in which case
1835 no tests are made for the file already existing.
1837 If the file is preceded by a
1839 character, the program named by the shell edit option is
1840 invoked with file as its second argument, and the specified
1841 lines are passed as standard input to that command.
1844 in this usage must be separated from command name by at least one
1845 whitespace character.
1846 The special meaning of the
1848 may be overridden by escaping it with a backslash
1854 version of the write command will exit the editor after writing the file,
1855 if there are no further files to edit.
1858 character to the command name or entering two
1866 in a row) will override this check and the editor will exit,
1867 ignoring any files that have not yet been edited.
1871 version of the write command will move to the next file after writing
1872 the file, unless the write fails.
1885 @deftypefn Command {[range]} {x[it][!]} {[file]}
1887 Write the file if it has been modified.
1888 The specified lines are written to
1890 if the file has been modified since the last complete write to any
1893 @LI{range}is specified, the entire file is written.
1897 command will exit the editor after writing the file,
1898 if there are no further files to edit.
1901 character to the command name or entering two
1909 in a row) will override this check and the editor will exit,
1910 ignoring any files that have not yet been edited.
1923 @deftypefn Command {[range]} {ya[nk]} {[buffer] [count]}
1925 Copy the specified lines to a buffer.
1926 If no buffer is specified, the unnamed buffer is used.
1935 @deftypefn Command {[line]} {z} {[type] [count] [flags]}
1939 @LI{type}is specified, then
1940 @LI{count}lines following the specified line are displayed.
1942 @LI{count}is the value of the
1946 @LI{type}argument changes the position at which
1947 @LI{line}is displayed on the screen by changing the number of lines
1948 displayed before and after
1951 @LI{type}characters may be used:
1954 Place the line at the bottom of the screen.
1956 Place the line at the top of the screen.
1958 Place the line in the middle of the screen.
1960 Write out count lines starting
1961 @LI{count * 2}lines before
1963 the net effect of this is that a
1967 command writes the previous page.
1970 @LI{line}on the screen with a line of hyphens displayed immediately before and
1972 The number of preceding and following lines of text displayed are
1973 reduced to account for those lines.
1977 Set to the last line displayed, with the exception of the
1980 where the current line is set to the line specified by the command.