diff options
author | Jason McIntyre <jmc@cvs.openbsd.org> | 2004-01-30 23:14:27 +0000 |
---|---|---|
committer | Jason McIntyre <jmc@cvs.openbsd.org> | 2004-01-30 23:14:27 +0000 |
commit | 0453c3a4f18d5579fd863a8fa1220f6686cbbead (patch) | |
tree | 9f614a3378a49667e78d2b0ae498680aad18ae89 /usr.bin/vi/docs | |
parent | a63eece62bccebd1a96df8cd8f1876d1d9117f6d (diff) |
install exref; includes updates to sync with current behaviour;
fixes, help, and ok millert@
Diffstat (limited to 'usr.bin/vi/docs')
-rw-r--r-- | usr.bin/vi/docs/USD.doc/exref/Makefile | 7 | ||||
-rw-r--r-- | usr.bin/vi/docs/USD.doc/exref/ex.rm | 723 | ||||
-rw-r--r-- | usr.bin/vi/docs/USD.doc/exref/ex.summary | 178 |
3 files changed, 483 insertions, 425 deletions
diff --git a/usr.bin/vi/docs/USD.doc/exref/Makefile b/usr.bin/vi/docs/USD.doc/exref/Makefile index c413a8836f1..225792fb7e4 100644 --- a/usr.bin/vi/docs/USD.doc/exref/Makefile +++ b/usr.bin/vi/docs/USD.doc/exref/Makefile @@ -1,15 +1,20 @@ -# $OpenBSD: Makefile,v 1.3 2001/01/29 01:58:33 niklas Exp $ +# $OpenBSD: Makefile,v 1.4 2004/01/30 23:14:26 jmc Exp $ DIR= usd/13.ex SRCS= ex.rm +EXTRA= ex.summary MACROS= -ms CLEANFILES=summary.* paper.ps: ${SRCS} summary.ps ${ROFF} ${SRCS} > ${.TARGET} +paper.txt: ${SRCS} summary.txt + ${ROFF} -Tascii ${SRCS} > ${.TARGET} summary.ps: ex.summary ${TBL} ex.summary | ${ROFF} > ${.TARGET} +summary.txt: ex.summary + ${TBL} ex.summary | ${ROFF} -Tascii > ${.TARGET} .include <bsd.doc.mk> diff --git a/usr.bin/vi/docs/USD.doc/exref/ex.rm b/usr.bin/vi/docs/USD.doc/exref/ex.rm index acf972d4de2..aa272af6efc 100644 --- a/usr.bin/vi/docs/USD.doc/exref/ex.rm +++ b/usr.bin/vi/docs/USD.doc/exref/ex.rm @@ -1,4 +1,4 @@ -.\" $OpenBSD: ex.rm,v 1.6 2003/11/08 19:17:29 jmc Exp $ +.\" $OpenBSD: ex.rm,v 1.7 2004/01/30 23:14:26 jmc Exp $ .\" .\" Copyright (c) 1980, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,6 +29,10 @@ .\" .\" @(#)ex.rm 8.5 (Berkeley) 8/18/96 .\" +.if n \{\ +.po 5n +.ll 70n +.\} .nr LL 6.5i .nr FL 6.5i .EH 'USD:12-%''Ex Reference Manual' @@ -50,7 +54,7 @@ .LP .ta 4.0i .. -.bd S B 3 +.\" .bd S B 3 .\".RP .TL Ex Reference Manual @@ -67,14 +71,14 @@ University of California, Berkeley Berkeley, Ca. 94720 .AB .I Ex -a line oriented text editor, which supports both command and display +is a line oriented text editor, which supports both command and display oriented editing. This reference manual describes the command oriented part of -.I ex; +.I ex ; the display editing features of .I ex are described in -.I "An Introduction to Display Editing with Vi." +.I "An Introduction to Display Editing with Vi" . Other documents about the editor include the introduction .I "Edit: A tutorial", the @@ -93,50 +97,64 @@ acknowledged. .FE Each instance of the editor has a set of options, which can be set to tailor it to your liking. -The command -.I edit -invokes a version of -.I ex -designed for more casual or beginning -users by changing the default settings of some of these options. -To simplify the description which follows we -assume the default settings of the options. +.\" The command +.\" .I edit +.\" invokes a version of +.\" .I ex +.\" designed for more casual or beginning +.\" users by changing the default settings of some of these options. +.\" To simplify the description which follows we +.\" assume the default settings of the options. .PP When invoked, .I ex determines the terminal type from the \s-2TERM\s0 variable in the environment. -It there is a \s-2TERMCAP\s0 variable in the environment, and the type -of the terminal described there matches the \s-2TERM\s0 variable, -then that description -is used. Also if the \s-2TERMCAP\s0 variable contains a pathname (beginning -with a \fB/\fR) then the editor will seek the description of the terminal -in that file (rather than the default /etc/termcap). -If there is a variable \s-2EXINIT\s0 in the environment, then the editor +.\" If there is a \s-2TERMCAP\s0 variable in the environment, and the type +.\" of the terminal described there matches the \s-2TERM\s0 variable, +.\" then that description +.\" is used. Also if the \s-2TERMCAP\s0 variable contains a pathname (beginning +.\" with a \fB/\fR) then the editor will seek the description of the terminal +.\" in that file (rather than the default /etc/termcap). +If there is a variable \s-2NEXINIT\s0 in the environment, then the editor will execute the commands in that variable, -otherwise if there is a file -.I \&.exrc +otherwise if there is a variable \s-2EXINIT\s0 in the environment, +then the editor will execute the commands in that variable. +If there is a file +.I \&.nexrc in your \s-2HOME\s0 directory .I ex reads commands from that file, simulating a .I source command. +Otherwise, if there is a file +.I \&.exrc +in your \s-2HOME\s0 directory, +.I ex +will read that. +Additionally, +.I ex +will read startup commands from the current working directory, +if they are placed in the files +.I \&.nexrc +or +.I \&.exrc . Option setting commands placed in -\s-2EXINIT\s0 or +\s-2NEXINIT\s0, \s-2EXINIT\s0, +.I \&.nexrc , +or .I \&.exrc will be executed before each editor session. .PP A command to enter .I ex -has the following prototype:\(dg -.FS -\(dg Brackets `[' `]' surround optional parameters here. -.FE +has the following prototype +(brackets `[' `]' surround optional parameters here): .DS -\fBex\fP [ \fB\-\fP ] [ \fB\-v\fP ] [ \fB\-t\fP \fItag\fP ] [ \fB\-r\fP ] [ \fB\-l\fP ] [ \fB\-w\fP\fIn\fP ] [ \fB\-x\fP ] [ \fB\-R\fP ] [ \fB+\fP\fIcommand\fP ] name ... +\fBex\fP [\fB\-\fP] [\fB\-FRrSsv\fP] [\fB\-c\fP \fIcmd\fP] [\fB\-t\fP \fItag\fP] [\fB\-w\fP \fIsize\fP] [\fB+\fP\fIcommand\fP] [\fIfile ...\fP] .DE The most common case edits a single file with no options, i.e.: -.DS -\fBex\fR name +.DS I +ex name .DE The .B \- @@ -144,11 +162,16 @@ command line option option suppresses all interactive-user feedback and is useful in processing editor scripts in command files. The +.B \-s +option is the POSIX equivalent to +.B \- ; +both forms are identical. +The .B \-v option is equivalent to using .I vi rather than -.I ex. +.I ex . The .B \-t option is equivalent to an initial @@ -162,33 +185,49 @@ option is used in recovering after an editor or system crash, retrieving the last saved version of the named file or, if no file is specified, typing a list of saved files. -The -.B \-l -option sets up for editing \s-2LISP\s0, setting the -.I showmatch -and -.I lisp -options. +.\" The +.\" .B \-l +.\" option sets up for editing \s-2LISP\s0, setting the +.\" .I showmatch +.\" and +.\" .I lisp +.\" options. The .B \-w option sets the default window size to -.I n, +.I n , and is useful on dialups to start in small windows. -The -.B \-x -option causes -.I ex -to prompt for a -.I key , -which is used to encrypt and decrypt the contents of the file, -which should already be encrypted using the same key, -see -.I crypt (1). +.\" The +.\" .B \-x +.\" option causes +.\" .I ex +.\" to prompt for a +.\" .I key , +.\" which is used to encrypt and decrypt the contents of the file, +.\" which should already be encrypted using the same key, +.\" see +.\" .I crypt (1). +.PP The .B \-R option sets the .I readonly option at the start. +The +.B \-S +option +cause +.I ex +to be run with the +.I secure +option, disallowing all access to external programs. +The +.B \-F +option prevents +.I ex +from copying the entire file at startup +(the default is to make a copy of the file at startup). +.PP .I Name arguments indicate files to be edited. An argument of the form @@ -200,6 +239,11 @@ is omitted, then it defaults to ``$'', positioning the editor at the last line of the first file initially. Other useful commands here are scanning patterns of the form ``/pat'' or line numbers, e.g. ``+100'' starting at line 100. +The form +\fB\-c \fIcmd\fR +is the POSIX equivalent to +\fB+\fIcommand\fR; +both forms are identical. .NH 1 File manipulation .NH 2 @@ -226,13 +270,13 @@ its name becomes the current file name, and its contents are read into the buffer. .PP The current file is almost always considered to be -.I edited. +.I edited . This means that the contents of the buffer are logically connected with the current file name, so that writing the current buffer contents onto that file, even if it exists, is a reasonable action. -If the current file is not +If the current file is not .I edited then .I ex @@ -263,23 +307,21 @@ the character `%' in filenames is replaced by the file name and the character `#' by the .I alternate -file name.\(dg -.FS -\(dg This makes it easy to deal alternately with +file name. +This makes it easy to deal alternately with two files and eliminates the need for retyping the name supplied on an .I edit -command after a +command after a .I "No write since last change" diagnostic is received. -.FE .NH 2 Multiple files and named buffers .PP If more than one file is given on the command line, then the first file is edited as described above. The remaining arguments are placed with the first file in the -.I "argument list." +.I "argument list" . The current argument list may be displayed with the .I args command. @@ -305,16 +347,14 @@ of operations are available on them. The buffers have names .I a through -.I z.\(dd -.FS -\(dd It is also possible to refer to +.I z . +It is also possible to refer to .I A through -.I Z; +.I Z ; the upper case buffers are the same as the lower but commands append to named buffers rather than replacing if upper case names are used. -.FE .NH 2 Read only .PP @@ -369,11 +409,11 @@ changes from the last point before the hangup or editor crash. To recover a file you can use the .B \-r option. If you were editing the file -.I resume, +.I resume , then you should change to the directory where you were when the crash occurred, giving the command -.DS -\fBex \-r\fP\fI resume\fP +.DS I +ex -r resume .DE After checking that the retrieved file is indeed ok, you can .I write @@ -381,8 +421,8 @@ it over the previous contents of that file. .PP You will normally get mail from the system telling you when a file has been saved after a crash. The command -.DS -\fBex\fP \-\fBr\fP +.DS I +ex -r .DE will print a list of the files which have been saved for you. (In the case of a hangup, @@ -397,11 +437,11 @@ has five distinct modes. The primary mode is mode. Commands are entered in command mode when a `:' prompt is present, and are executed each time a complete line is sent. In .I "text input" -mode +mode, .I ex gathers input lines and places them in the file. The -.I append, -.I insert, +.I append , +.I insert , and .I change commands use text input mode. @@ -410,27 +450,28 @@ This mode is left by typing a `.' alone at the beginning of a line, and .I command mode resumes. .PP -The last three modes are -.I open -and +The last two modes are +.\" .I open +.\" and .I visual -modes, entered by the commands of the same name, and, within open and -visual modes +mode, entered by the command of the same name, and, within +visual mode .I "text insertion" mode. -.I Open -and -.I visual -modes allow local editing operations to be performed on the text in the -file. The -.I open -command displays one line at a time on any terminal while -.I visual -works on \s-2CRT\s0 terminals with random positioning cursors, using the -screen as a (single) window for file editing changes. +.\" .I Open +.\" and +.I Visual +mode allows local editing operations to be performed on the text in the +file. +.\" The +.\" .I open +.\" command displays one line at a time on any terminal while +.I Visual +mode works on \s-2CRT\s0 terminals with random positioning cursors, using the +screen as a window for file editing changes. These modes are described (only) in -.I "An Introduction to Display Editing with Vi." -.NH +.I "An Introduction to Display Editing with Vi" . +.NH Command structure .PP Most command names are English words, @@ -438,10 +479,10 @@ and initial prefixes of the words are acceptable abbreviations. The ambiguity of abbreviations is resolved in favor of the more commonly used commands.* .FS -* As an example, the command +* As an example, the command .I substitute can be abbreviated `s' -while the shortest available abbreviation for the +while the shortest available abbreviation for the .I set command is `se'. .FE @@ -453,18 +494,15 @@ upon which they are to have effect. The forms of these addresses will be discussed below. A number of commands also may take a trailing .I count -specifying the number of lines to be involved in the command.\(dg -.FS -\(dg Counts are rounded down if necessary. -.FE +argument, specifying the number of lines to be involved in the command. +Counts are rounded down if necessary. Thus the command ``10p'' will print the tenth line in the buffer while ``delete 5'' will delete five lines from the buffer, starting with the current line. .PP Some commands take other information or parameters, -this information always being given after the command name.\(dd -.FS -\(dd Examples would be option names in a +this information always being given after the command name. +Examples would be option names in a .I set command i.e. ``set number'', a file name in an @@ -476,7 +514,6 @@ command, or a target address for a .I copy command, i.e. ``1,5 copy 25''. -.FE .NH 2 Command variants .PP @@ -533,11 +570,11 @@ feedback if the scope of the change exceeds a threshold given by the option. This feedback helps to detect undesirably large changes so that they may be quickly and easily reversed with an -.I undo. +.I undo . After commands with more global effect such as .I global or -.I visual, +.I visual , you will be informed if the net change in the number of lines in the buffer during this command exceeds this threshold. .NH 1 @@ -555,38 +592,38 @@ sequentially from 1. .IP \fB$\fR 20 The last line in the buffer. .IP \fB%\fR 20 -An abbreviation for ``1,$'', the entire buffer. -.IP \fI+n\fR\ \fI\-n\fR 20 -An offset relative to the current buffer line.\(dg +An abbreviation for ``1,$''; the entire buffer. +.IP \fI+n\fR,\ \fI\-n\fR 20 +An offset relative to the current buffer line.* .FS -\(dg -The forms `.+3' `+3' and `+++' are all equivalent; -if the current line is line 100 they all address line 103. +* +The forms `.+3', `+3', and `+++' are all equivalent; +if the current line is line 100i, they all address line 103. .FE -.IP \fB/\fIpat\fR\fB/\fR\ \fB?\fIpat\fR\fB?\fR 20 +.IP \fB/\fIpat\fR\fB/\fR,\ \fB?\fIpat\fR\fB?\fR 20 Scan forward and backward respectively for a line containing \fIpat\fR, a regular expression (as defined below). The scans normally wrap around the end of the buffer. If all that is desired is to print the next line containing \fIpat\fR, then the trailing \fB/\fR or \fB?\fR may be omitted. If \fIpat\fP is omitted or explicitly empty, then the last -regular expression specified is located.\(dd +regular expression specified is located.* .FS -\(dd The forms \fB\e/\fP and \fB\e?\fP scan +* The forms \fB\e/\fP and \fB\e?\fP scan using the last regular expression used in a scan; after a substitute \fB//\fP and \fB??\fP would scan using the substitute's regular expression. .FE .IP \fB\(aa\(aa\fP\ \fB\(aa\fP\fIx\fP 20 Before each non-relative motion of the current line `\fB.\fP', the previous current line is marked with a tag, subsequently referred to as -`\(aa\(aa'. +\(aa\(aa. This makes it easy to refer or return to this previous context. Marks may also be established by the .I mark command, using single lower case letters .I x and the marked lines referred to as -`\(aa\fIx\fR'. +\(aa\fIx\fR. .NH 2 Combining addressing primitives .PP @@ -599,9 +636,9 @@ before the next address is interpreted. If more addresses are given than the command requires, then all but the last one or two are ignored. If the command takes two addresses, the first addressed line must -precede the second in the buffer.\(dg +precede the second in the buffer.** .FS -\(dg Null address specifications are permitted in a list of addresses, +** Null address specifications are permitted in a list of addresses, the default in this case is the current line `.'; thus `,100' is equivalent to `\fB.\fR,100'. It is an error to give a prefix address to a command which expects none. @@ -625,7 +662,7 @@ ignores a ``:'' preceding any command. In the following command descriptions, the default addresses are shown in parentheses, which are -.I not, +.I not , however, part of the command. .LC @@ -661,21 +698,19 @@ The variant flag to toggles the setting for the .I autoindent option during the input of -.I text. +.I text . .LC \fBargs\fR .ZP The members of the argument list are printed, with the current argument delimited by `[' and `]'. -.ig -.PP +.LC \fBcd\fR \fIdirectory\fR .ZP The .I cd command is a synonym for -.I chdir. -.. +.I chdir . .LC ( \fB.\fP , \fB.\fP ) \fBchange\fP \fIcount\fP abbr: \fBc\fP .br @@ -685,7 +720,7 @@ command is a synonym for .ZP Replaces the specified lines with the input \fItext\fP. The current line becomes the last line input; -if no lines were input it is left as for a +if no lines were input, it is left as for a \fIdelete\fP. .LC \fBc!\fP @@ -698,9 +733,8 @@ The variant toggles .I autoindent during the .I change. -.ig .LC -\fBchdir\fR \fIdirectory\fR +\fBchdir\fR \fIdirectory\fR abbrev: \fBchd\fP .ZP The specified \fIdirectory\fR becomes the current directory. If no directory is specified, the current value of the @@ -710,14 +744,13 @@ After a .I chdir the current file is not considered to have been edited so that write restrictions on pre-existing files apply. -.. .LC ( \fB.\fP , \fB.\fP )\|\fBcopy\fP \fIaddr\fP \fIflags\fP abbr: \fBco\fP .ZP A .I copy of the specified lines is placed after -.I addr, +.I addr , which may be `0'. The current line `\fB.\fR' @@ -725,7 +758,7 @@ addresses the last line of the copy. The command .I t is a synonym for -.I copy. +.I copy . .LC ( \fB.\fR , \fB.\fR )\|\fBdelete\fR \fIbuffer\fR \fIcount\fR \fIflags\fR abbr: \fBd\fR .ZP @@ -754,32 +787,24 @@ command is aborted. The command otherwise deletes the entire contents of the editor buffer, makes the named file the current file and prints the new filename. -After insuring that this file is sensible\(dg +After ensuring that this file is sensible* .FS -\(dg I.e., that it is not a binary file such as a directory, +* I.e., that it is not a special file such as a directory, a block or character special file other than -.I /dev/tty, -a terminal, -or a binary or executable file -(as indicated by the first word). +.I /dev/tty , +or a terminal. .FE the editor reads the file into its buffer. .IP If the read of the file completes without error, the number of lines and characters read is typed. -If there were any non-\s-2ASCII\s0 characters -in the file they are stripped of their non-\s-2ASCII\s0 -high bits, -and any null characters in the file are discarded. -If none of these errors occurred, the file is considered -.I edited. If the last line of the input file is missing the trailing newline character, it will be supplied and a complaint will be issued. -This command leaves the current line `\fB.\fR' at the last line read.\(dd +This command leaves the current line `\fB.\fR' at the last line read.** .FS -\(dd If executed from within -.I open -or +** If executed from within +.\" .I open +.\" or .I visual, the current line is initially the first line of the file. .FE @@ -801,7 +826,7 @@ rather than at the last line; .ZP Prints the current file name, whether it has been `[Modified]' since the last -.I write +.I write command, whether it is .I "read only" , @@ -818,8 +843,8 @@ destroy a file unrelated to the current contents of the buffer. \fBfile\fR \fIfile\fR .ZP The current file name is changed to -.I file -which is considered +.I file , +which is considered `[Not edited]'. .LC ( 1 , $ ) \fBglobal\fR /\fIpat\|\fR/ \fIcmds\fR abbr: \fBg\fR @@ -837,22 +862,22 @@ If (and possibly the trailing \fB/\fR delimiter) is omitted, each line matching .I pat is printed. -.I Append, -.I insert, +.I Append , +.I insert , and .I change commands and associated input are permitted; the `\fB.\fR' terminating input may be omitted if it would be on the last line of the command list. -.I Open -and -.I visual +.\" .I Open +.\" and +.I Visual commands are permitted in the command list and take input from the terminal. .IP The .I global command itself may not appear in -.I cmds. +.I cmds . The .I undo command is also not permitted there, @@ -866,20 +891,20 @@ The options and .I autoindent are inhibited during a -.I global, +.I global , (and possibly the trailing \fB/\fR delimiter) and the value of the .I report option is temporarily infinite, in deference to a \fIreport\fR for the entire global. -Finally, the context mark `\'\'' is set to the value of +Finally, the context mark ('') is set to the value of `.' before the global command begins and is not changed during a global command, -except perhaps by an -.I open -or +except perhaps by a +.\" .I open +.\" or .I visual within the -.I global. +.I global . .LC \fBg!\fR \fB/\fIpat\fB/\fR \fIcmds\fR abbr: \fBv\fR .IP @@ -916,17 +941,17 @@ during the .ZP Places the text from a specified range of lines together on one line. -White space is adjusted at each junction to provide at least +Whitespace is adjusted at each junction to provide at least one blank character, two if there was a `\fB.\fR' at the end of the line, or none if the first following character is a `)'. -If there is already white space at the end of the line, -then the white space at the start of the next line will be discarded. +If there is already whitespace at the end of the line, +then the whitespace at the start of the next line will be discarded. .LC \fBj!\fR .ZP The variant causes a simpler .I join -with no white space processing; the characters in the lines are simply +with no whitespace processing; the characters in the lines are simply concatenated. .LC ( \fB.\fR ) \fBk\fR \fIx\fR @@ -934,7 +959,7 @@ concatenated. The .I k command is a synonym for -.I mark. +.I mark . It does not require a blank or tab before the following letter. .LC ( \fB.\fR , \fB.\fR ) \fBlist\fR \fIcount\fR \fIflags\fR @@ -958,18 +983,18 @@ is typed in .I visual mode, it will be as though the corresponding \fIrhs\fR had been typed. On terminals without function keys, you can type ``#n''. -See section 6.9 of the ``Introduction to Display Editing with Vi'' +See section 6.8 of the ``Introduction to Display Editing with Vi'' for more details. .LC ( \fB.\fR ) \fBmark\fR \fIx\fR .ZP Gives the specified line mark -.I x, +.I x , a single lower case letter. The .I x must be preceded by a blank or a tab. -The addressing form `\'x' then addresses this line. +The addressing form 'x then addresses this line. The current line is not affected by this command. .LC ( \fB.\fR , \fB.\fR ) \fBmove\fR \fIaddr\fR abbr: \fBm\fR @@ -1008,25 +1033,25 @@ is given (it must contain no spaces), then it is executed after editing the firs Prints each specified line preceded by its buffer line number. The current line is left at the last line printed. -.KS -.LC -( \fB.\fR ) \fBopen\fR \fIflags\fR abbr: \fBo\fR -.br -( \fB.\fR ) \fBopen\fR /\fIpat\|\fR/ \fIflags\fR -.ZP -Enters intraline editing \fIopen\fR mode at each addressed line. -If -.I pat -is given, -then the cursor will be placed initially at the beginning of the -string matched by the pattern. -To exit this mode use Q. -See -.I "An Introduction to Display Editing with Vi" -for more details. -.KE -.LC -\fBpreserve\fR +.\" .KS +.\" .LC +.\" ( \fB.\fR ) \fBopen\fR \fIflags\fR abbr: \fBo\fR +.\" .br +.\" ( \fB.\fR ) \fBopen\fR /\fIpat\|\fR/ \fIflags\fR +.\" .ZP +.\" Enters intraline editing \fIopen\fR mode at each addressed line. +.\" If +.\" .I pat +.\" is given, +.\" then the cursor will be placed initially at the beginning of the +.\" string matched by the pattern. +.\" To exit this mode use Q. +.\" See +.\" .I "An Introduction to Display Editing with Vi" +.\" for more details. +.\" .KE +.LC +\fBpreserve\fR abbrev: \fBpre\fR .ZP The current editor buffer is saved as though the system had just crashed. This command is for use only in emergencies when a @@ -1070,7 +1095,7 @@ text is restored.* or .I yank and the -.I put, +.I put , nor may lines be moved between files without using a named buffer. .FE By using a named buffer, text may be restored that was saved there at any @@ -1078,7 +1103,7 @@ previous time. .LC \fBquit\fR abbr: \fBq\fR .ZP -Causes +Causes .I ex to terminate. No automatic write of the editor buffer to a file is performed. @@ -1088,13 +1113,13 @@ issues a warning message if the file has changed since the last .I write command was issued, and does not -.I quit.\(dg +.I quit .** .FS -\(dg \fIEx\fR +** \fIEx\fR will also issue a diagnostic if there are more files in the argument list. .FE -Normally, you will wish to save your changes, and you +Normally, you will wish to save your changes, and you should give a \fIwrite\fR command; if you wish to discard them, use the \fBq!\fR command variant. .LC @@ -1106,14 +1131,14 @@ Quits from the editor, discarding changes to the buffer without complaint. .ZP Places a copy of the text of the given file in the editing buffer after the specified line. -If no +If no .I file -is given the current file name is used. -The current file name is not changed unless there is none in which +is given, the current file name is used. +The current file name is not changed unless there is none, in which case .I file becomes the current name. -The sensibility restrictions for the +The sensibility restrictions for the .I edit command apply here also. If the file buffer is empty and there is no current name then @@ -1124,19 +1149,20 @@ command. .IP Address `0' is legal for this command and causes the file to be read at the beginning of the buffer. -Statistics are given as for the +Statistics are given as for the .I edit -command when the +command when the .I read successfully terminates. After a .I read -the current line is the last line read.\(dd +the current line is the last line read.* .FS -\(dd Within -.I open -and +* Within +.\" .I open +.\" and .I visual +mode, the current line is set to the first line read rather than the last. .FE .LC @@ -1148,8 +1174,8 @@ into the buffer after the specified line. This is not a variant form of the command, rather a read specifying a .I command -rather than a -.I filename; +rather than a +.I filename ; a blank or tab before the \fB!\fR is mandatory. .LC \fBrecover \fIfile\fR @@ -1157,7 +1183,7 @@ a blank or tab before the \fB!\fR is mandatory. Recovers .I file from the system save area. -Used after a accidental hangup of the phone** +Used, for example, after a remote connection has timed out** .FS ** The system saves a copy of the file you were editing only if you have made changes to the file. @@ -1194,8 +1220,8 @@ Boolean options are given values either by the form string and numeric options are assigned via the form `set \fIoption\fR=value'. .IP -More than one parameter may be given to -.I set \|; +More than one parameter may be given to +.I set ; they are interpreted left-to-right. .LC \fBshell\fR abbr: \fBsh\fR @@ -1209,12 +1235,12 @@ Reads and executes commands from the specified file. .I Source commands may be nested. .LC -( \fB.\fR , \fB.\fR ) \fBsubstitute\fR /\fIpat\fR\|/\fIrepl\fR\|/ \fIoptions\fR \fIcount\fR \fIflags\fR abbr: \fBs\fR +( \fB.\fR , \fB.\fR ) \fBsubstitute\fR /\fIpat\fR\|/\fIrepl\fR\|/ \fIoptions\fR \fIcount\fR \fIflags\fR\ \&abbr: \fBs\fR .IP On each specified line, the first instance of pattern .I pat is replaced by replacement pattern -.I repl. +.I repl . If the .I global indicator option character `g' @@ -1224,8 +1250,8 @@ if the indication character `c' appears, then before each substitution the line to be substituted is typed with the string to be substituted marked -with `\(ua' characters. -By typing an `y' one can cause the substitution to be performed, +with `^' characters. +By typing a `y' one can cause the substitution to be performed, any other input causes no change to take place. After a .I substitute @@ -1251,7 +1277,7 @@ is set and there are unsaved changes, a write is done first unless the form .B stop ! is used. -This commands is only available where supported by the teletype driver +This command is only available where supported by the tty driver and operating system. .LC ( \fB.\fR , \fB.\fR ) \fBsubstitute\fR \fIoptions\fR \fIcount\fR \fIflags\fR abbr: \fBs\fR @@ -1269,17 +1295,17 @@ command. .ZP The .I t -command is a synonym for +command is a synonym for .I copy . .LC -\fBta\fR \fItag\fR +\fBtag\fR \fItagstring\fR abbrev: ta .ZP The focus of editing switches to the location of -.I tag, +.I tagstring , switching to a different line in the current file where it is defined, -or if necessary to another file.\(dd +or if necessary to another file.* .FS -\(dd If you have modified the current file before giving a +* If you have modified the current file before giving a .I tag command, you must write it out; giving another .I tag @@ -1289,7 +1315,7 @@ will reuse the previous tag. .FE .IP The tags file is normally created by a program such as -.I ctags, +.I ctags , and consists of a number of lines with three fields separated by blanks or tabs. The first field gives the name of the tag, the second the name of the file where the tag resides, and the third @@ -1298,7 +1324,7 @@ this field is usually a contextual scan using `/\fIpat\fR/' to be immune to minor changes in the file. Such scans are always performed as if .I nomagic was set. -.PP +.IP The tag names in the tags file must be sorted alphabetically. .LC \fBunabbreviate\fR \fIword\fP abbr: \fBuna\fP @@ -1313,12 +1339,12 @@ Reverses the changes made in the buffer by the last buffer editing command. Note that .I global -commands are considered a single command for the purpose of +commands are considered a single command for the purpose of .I undo -(as are -.I open -and -.I visual.) +(as is +.\" .I open +.\" and +.I visual .) Also, the commands .I write and @@ -1330,7 +1356,7 @@ is its own inverse. .IP .I Undo always marks the previous value of the current line `\fB.\fR' -as `\'\''. +as ''. After an .I undo the current line is the first line restored @@ -1341,7 +1367,7 @@ such as and .I visual the current line regains it's pre-command value after an -.I undo. +.I undo . .LC \fBunmap\fR \fIlhs\fR .ZP @@ -1367,7 +1393,7 @@ as well as the date the editor was last changed. .ZP Enters visual mode at the specified line. .I Type -is optional and may be `\-' , `\(ua' or `\fB.\fR' +is optional and may be `\-' , `^' or `\fB.\fR' as in the .I z command to specify the placement of the specified line on the screen. @@ -1377,11 +1403,12 @@ is omitted, the specified line is placed as the first on the screen. A .I count specifies an initial window size; the default is the value of the option -.I window. +.I window . See the document .I "An Introduction to Display Editing with Vi" for more details. -To exit this mode, type Q. +To exit this mode, type +.I Q . .LC \fBvisual\fP file .br @@ -1402,11 +1429,11 @@ the current file and is .I edited , if the file does not exist, or if the file is actually a teletype, -.I /dev/tty, -.I /dev/null. +.I /dev/tty , +.I /dev/null . Otherwise, you must give the variant form \fBw!\fR to force the write. .FE -If the file does not exist it is created. +If the file does not exist, it is created. The current file name is changed only if there is no current file name; the current line is never changed. .IP @@ -1429,7 +1456,7 @@ and will write to any file which the system permits. .LC ( 1 , $ ) \fBw\fR \fB!\fR\fIcommand\fR .ZP -Writes the specified lines into +Writes the specified lines into .I command. Note the difference between \fBw!\fR which overrides checks and \fBw\ \ !\fR which writes to a command. @@ -1444,7 +1471,7 @@ The variant overrides checking on the sensibility of the .I write command, as \fBw!\fR does. .LC -\fBxit\fP \fIname\fR +\fBxit\fP \fIname\fR abbr: \fBx\fR .ZP If any changes have been made and not written, writes the buffer out. Then, in any case, quits. @@ -1465,7 +1492,7 @@ Print the next \fIcount\fR lines, default \fIwindow\fR. ( \fB.\fR ) \fBz\fR \fItype\fR \fIcount\fR .ZP Prints a window of text with the specified line at the top. -If \fItype\fR is `\-' the line is placed at the bottom; a `\fB.\fR' causes +If \fItype\fR is `\-', the line is placed at the bottom; a `\fB.\fR' causes the line to be placed in the center.* A count gives the number of lines to be displayed rather than double the number specified by the \fIscroll\fR option. @@ -1473,10 +1500,10 @@ On a \s-2CRT\s0 the screen is cleared before display begins unless a count which is less than the screen size is given. The current line is left at the last line printed. .FS -* Forms `z=' and `z\(ua' also exist; `z=' places the current line in the +* Forms `z=' and `z^' also exist; `z=' places the current line in the center, surrounds it with lines of `\-' characters and leaves the current -line at this line. The form `z\(ua' prints the window before `z\-' -would. The characters `+', `\(ua' and `\-' may be repeated for cumulative +line at this line. The form `z^' prints the window before `z\-' +would. The characters `+', `^' and `\-' may be repeated for cumulative effect. On some v2 editors, no .I type @@ -1489,7 +1516,7 @@ The remainder of the line after the `!' character is sent to a shell to be executed. Within the text of .I command -the characters +the characters `%' and `#' are expanded as in filenames and the character `!' is replaced with the text of the previous command. Thus, in particular, @@ -1506,7 +1533,7 @@ A single `!' is printed when the command completes. .ZP Takes the specified address range and supplies it as standard input to -.I command; +.I command ; the resulting output then replaces the input lines. .LC ( $ ) \fB=\fR @@ -1521,11 +1548,11 @@ The current line is unchanged. ( \fB.\fR , \fB.\fR ) \fB<\fR \fIcount\fR \fIflags\fR .IP Perform intelligent shifting on the specified lines; -\fB<\fR shifts left and \fB>\fR shift right. +\fB<\fR shifts left and \fB>\fR shifts right. The quantity of shift is determined by the .I shiftwidth option and the repetition of the specification character. -Only white space (blanks and tabs) is shifted; +Only whitespace (blanks and tabs) is shifted; no non-white characters are discarded in a left-shift. The current line becomes the last line which changed due to the shifting. @@ -1540,7 +1567,7 @@ option specifies the size of the scroll, normally a half screen of text. .LC ( \fB.\fR+1 , \fB.\fR+1 ) .br -( \fB.\fR+1 , \fB.\fR+1 ) | +( \fB.\fR+1 , \fB.\fR+1 ) .ZP An address alone causes the addressed lines to be printed. A blank line prints the next line in the file. @@ -1577,7 +1604,7 @@ can always be referred to by a null \fIre\fR, e.g. `//' or `??'. Magic and nomagic .PP The regular expressions allowed by -.I ex +.I ex are constructed in one of two ways depending on the setting of the .I magic @@ -1597,9 +1624,9 @@ is that the user must remember that these metacharacters are and precede them with the character `\e' to use them as ``ordinary'' characters. With -.I nomagic, -the default for -.I edit, +.I nomagic , +.\" the default for +.\" .I edit , regular expressions are much simpler, there being only two metacharacters. The power of the other metacharacters is still available by preceding @@ -1609,12 +1636,12 @@ Note that `\e' is thus always a metacharacter. The remainder of the discussion of regular expressions assumes that that the setting of this option is -.I magic.\(dg +.I magic .* .FS -\(dg To discern what is true with +* To discern what is true with .I nomagic it suffices to remember that the only -special characters in this case will be `\(ua' at the beginning +special characters in this case will be `^' at the beginning of a regular expression, `$' at the end of a regular expression, and `\e'. @@ -1631,12 +1658,12 @@ The following basic constructs are used to construct mode regular expressions. .IP \fIchar\fR 15 An ordinary character matches itself. -The characters `\(ua' at the beginning of a line, +The characters `^' at the beginning of a line, `$' at the end of line, `*' as any character other than the first, `.', `\e', `[', and `\s+2~\s0' are not ordinary characters and must be escaped (preceded) by `\e' to be treated as such. -.IP \fB\(ua\fR +.IP \fB^\fR At the beginning of a pattern forces the match to succeed only at the beginning of a line. .IP \fB$\fR @@ -1655,9 +1682,9 @@ these. Similar to `\e<', but matching the end of a ``variable'' or ``word'', i.e. either the end of the line or before character which is neither a letter, nor a digit, nor the underline character. -.IP \fB[\fIstring\fR]\fR +.IP \fB[\fIstring\fB]\fR Matches any (single) character in the class defined by -.I string. +.I string . Most characters in .I string define themselves. @@ -1668,14 +1695,17 @@ bounds, thus `[a\-z]' as a regular expression matches any (single) lower-case letter. If the first character of .I string -is an `\(ua' then the construct +is an `^' then the construct matches those characters which it otherwise would not; -thus `[\(uaa\-z]' matches anything but a lower-case letter (and of course a +thus `[^a\-z]' matches anything but a lower-case letter (and of course a newline). To place any of the characters -`\(ua', `[', or `\-' in +`^', `[', or `\-' in .I string you must escape them with a preceding `\e'. +.\" +.\" document extended regexps (set extended) +.\" .NH 2 Combining regular expression primitives .PP @@ -1714,9 +1744,9 @@ Other metasequences possible in the replacement pattern are always introduced by the escaping character `\e'. The sequence `\e\fIn\fR' is replaced by the text matched by the \fIn\fR-th regular subexpression enclosed between -`\e(' and `\e)'.\(dg +`\e(' and `\e)'.* .FS -\(dg When nested, parenthesized subexpressions are present, +* When nested, parenthesized subexpressions are present, \fIn\fR is determined by counting occurrences of `\e(' starting from the left. .FE The sequences `\eu' and `\el' cause the immediately following character in @@ -1740,12 +1770,11 @@ Option descriptions Can be used to ease the preparation of structured program text. At the beginning of each .I append , -.I change +.I change , or .I insert command -or when a new line is -.I opened +or when a new line is opened or created by an .I append , .I change , @@ -1753,20 +1782,20 @@ or created by an or .I substitute operation within -.I open -or +.\" .I open +.\" or .I visual mode, .I ex looks at the line being appended after, the first line changed -or the line inserted before and calculates the amount of white space +or the line inserted before and calculates the amount of whitespace at the start of the line. It then aligns the cursor at the level of indentation so determined. .IP If the user then types lines of text in, they will continue to be justified at the displayed indenting level. -If more white space is typed at the beginning of a line, +If more whitespace is typed at the beginning of a line, the following line will start aligned with the first non-white character of the previous line. To back the cursor up to the preceding tab stop one can hit @@ -1780,12 +1809,12 @@ backspace over the indent, except by sending an end-of-file with a \fB^D\fR. .IP Specially processed in this mode is a line with no characters added -to it, which turns into a completely blank line (the white -space provided for the +to it, which turns into a completely blank line (the whitespace +provided for the .I autoindent is discarded.) Also specially processed in this mode are lines beginning with -an `\(ua' and immediately followed by a \fB^D\fR. +a `^' and immediately followed by a \fB^D\fR. This causes the input to be repositioned at the beginning of the line, but retaining the previous indent for the next line. Similarly, a `0' followed by a \fB^D\fR @@ -1806,9 +1835,10 @@ Causes the current line to be printed after each .I move , .I substitute , .I t , -.I undo +.I undo , or -shift command. +.I shift +command. This has the same effect as supplying a trailing `p' to each such command. .I Autoprint @@ -1819,20 +1849,20 @@ and only applies to the last of many commands on a line. .ZP Causes the contents of the buffer to be written to the current file if you have modified it and give a -.I next, -.I rewind, -.I stop, -.I tag, +.I next , +.I rewind , +.I stop , +.I tag , or .I ! -command, or a \fB^\(ua\fR (switch files) or \fB^]\fR (tag goto) command +command, or a \fB^^\fR (switch files) or \fB^]\fR (tag goto) command in -.I visual. +.I visual . Note, that the -.I edit -and +.\" .I edit +.\" and .I ex -commands do +command does .B not autowrite. In each case, there is an equivalent way of switching when autowrite @@ -1842,7 +1872,8 @@ is set to avoid the for .I next , .I rewind! -for .I rewind , +for +.I rewind , .I stop! for .I stop , @@ -1854,7 +1885,7 @@ for .I ! , and \fB:e\ #\fR and a \fB:ta!\fR command from within -.I visual). +.I visual ). .LC \fBbeautify\fR, \fBbf\fR default: nobeautify .ZP @@ -1871,12 +1902,12 @@ Specifies the directory in which .I ex places its buffer file. If this directory in not -writable, then the editor will exit abruptly when it fails to be -able to create its buffer there. +writable, then the editor will exit abruptly when it fails to +create its buffer there. .LC \fBedcompatible\fR default: noedcompatible .ZP -Causes the presence of absence of +Causes the presence or absence of .B g and .B c @@ -1886,23 +1917,23 @@ by repeating the suffices. The suffix makes the substitution be as in the .I ~ command, instead of like -.I &. +.I & . .LC \fBerrorbells\fR, \fBeb\fR default: noeb .ZP Error messages are preceded by a bell.* .FS * Bell ringing in -.I open -and +.\" .I open +.\" and .I visual -on errors is not suppressed by setting -.I noeb. +mode on errors is not suppressed by setting +.I noeb . .FE If possible the editor always places the error message in a standout mode of the terminal (such as inverse video) instead of ringing the bell. .LC -\fBhardtabs\fR, \fBht\fR default: ht=8 +\fBhardtabs\fR, \fBht\fR default: ht=0 .ZP Gives the boundaries on which terminal hardware tabs are set (or on which the system expands tabs). @@ -1913,16 +1944,16 @@ All upper case characters in the text are mapped to lower case in regular expression matching. In addition, all upper case characters in regular expressions are mapped to lower case except in character class specifications. -.LC -\fBlisp\fR default: nolisp -.ZP -\fIAutoindent\fR indents appropriately for -.I lisp -code, and the \fB( ) { } [[\fR and \fB]]\fR commands in -.I open -and -.I visual -are modified to have meaning for \fIlisp\fR. +.\" .LC +.\" \fBlisp\fR default: nolisp +.\" .ZP +.\" \fIAutoindent\fR indents appropriately for +.\" .I lisp +.\" code, and the \fB( ) { } [[\fR and \fB]]\fR commands in +.\" .I open +.\" and +.\" .I visual +.\" are modified to have meaning for \fIlisp\fR. .LC \fBlist\fR default: nolist .ZP @@ -1931,15 +1962,15 @@ showing tabs and end-of-lines as in the .I list command. .LC -\fBmagic\fR default: magic for \fIex\fR and \fIvi\fR\(dg -.FS -\(dg \fINomagic\fR for \fIedit\fR. -.FE +\fBmagic\fR default: magic for \fIex\fR and \fIvi\fR +.\" .FS +.\" \(dg \fINomagic\fR for \fIedit\fR. +.\" .FE .ZP If .I nomagic is set, the number of regular expression metacharacters is greatly reduced, -with only `\(ua' and `$' having special effects. +with only `^' and `$' having special effects. In addition the metacharacters `~' and @@ -1968,12 +1999,12 @@ To be recognized as a command line, the line must have the string .B ex: or .B vi: -preceeded by a tab or a space. This string may be anywhere in the -line and anything after the -.I : +preceded by a tab or a space. This string may be anywhere in the +line and anything after the +.B : is interpeted as editor commands. This option defaults to off because of unexpected behavior when editting files such as -.I /etc/passwd. +.I /etc/passwd . .LC \fBnumber, nu\fR default: nonumber .ZP @@ -1989,10 +2020,10 @@ If \fInoopen\fR, the commands and .I visual are not permitted. -This is set for -.I edit -to prevent confusion resulting from accidental entry to -open or visual mode. +.\" This is set for +.\" .I edit +.\" to prevent confusion resulting from accidental entry to +.\" open or visual mode. .LC \fBoptimize, opt\fR default: optimize .ZP @@ -2000,14 +2031,15 @@ Throughput of text is expedited by setting the terminal to not do automatic carriage returns when printing more than one (logical) line of output, greatly speeding output on terminals without addressable -cursors when text with leading white space is printed. +cursors when text with leading whitespace is printed. .LC -\fBparagraphs,\ para\fR default: para=IPLPPPQPP\0LIbp +\fBparagraphs,\ para\fR default: para=IPLPPPQPP\ \&LIpplpipbp .ZP Specifies the paragraphs for the \fB{\fR and \fB}\fR operations in -.I open -and -.I visual. +.\" .I open +.\" and +.I visual +mode. The pairs of characters in the option's value are the names of the macros which start paragraphs. .LC @@ -2021,7 +2053,7 @@ The editor simulates (using great amounts of output), an intelligent terminal on a dumb terminal (e.g. during insertions in .I visual the characters to the right of the cursor position are refreshed -as each input character is typed.) +as each input character is typed). Useful only at very high speed. .LC \fBremap\fP default: remap @@ -2046,10 +2078,10 @@ but if is set, it will map to .B O . .LC -\fBreport\fR default: report=5\(dg -.FS -\(dg 2 for \fIedit\fR. -.FE +\fBreport\fR default: report=5 +.\" .FS +.\" \(dg 2 for \fIedit\fR. +.\" .FE .ZP Specifies a threshold for feedback from commands. Any command which modifies more than the specified number of lines @@ -2076,19 +2108,20 @@ and the number of lines printed by a command mode command (double the value of .I scroll ). .LC -\fBsections\fR default: sections=SHNHH\0HU +\fBsections\fR default: sections=NHSHH\ \&HU .ZP Specifies the section macros for the \fB[[\fR and \fB]]\fR operations in -.I open -and -.I visual. +.\" .I open +.\" and +.I visual +mode. The pairs of characters in the options's value are the names of the macros which start paragraphs. .LC \fBshell\fR, \fBsh\fR default: sh=/bin/sh .ZP -Gives the path name of the shell forked for +Gives the path name of the shell forked for the shell escape command `!', and by the .I shell command. @@ -2110,18 +2143,19 @@ and .I visual mode, when a \fB)\fR or \fB}\fR is typed, move the cursor to the matching \fB(\fR or \fB{\fR for one second if this matching character is on the -screen. Extremely useful with -.I lisp. -.LC -\fBslowopen, slow\fR terminal dependent -.ZP -Affects the display algorithm used in -.I visual -mode, holding off display updating during input of new text to improve -throughput when the terminal in use is both slow and unintelligent. -See -.I "An Introduction to Display Editing with Vi" -for more details. +screen. +.\" Extremely useful with +.\" .I lisp. +.\" .LC +.\" \fBslowopen, slow\fR terminal dependent +.\" .ZP +.\" Affects the display algorithm used in +.\" .I visual +.\" mode, holding off display updating during input of new text to improve +.\" throughput when the terminal in use is both slow and unintelligent. +.\" See +.\" .I "An Introduction to Display Editing with Vi" +.\" for more details. .LC \fBtabstop,\ ts\fR default: ts=8 .ZP @@ -2134,7 +2168,7 @@ boundaries for the purposes of display. Tags are not significant beyond this many characters. A value of zero (the default) means that all characters are significant. .LC -\fBtags\fR default: tags=tags /usr/lib/tags +\fBtags\fR default: tags=tags .ZP A path of files to be used as tag files for the .I tag @@ -2142,8 +2176,9 @@ command. A requested tag is searched for in the specified files, sequentially. By default, files called .B tags -are searched for in the current directory and in /usr/lib -(a master file for the entire system). +are searched for in the current directory. +.\" and in /usr/lib +.\" (a master file for the entire system). .LC \fBterm\fR from environment TERM .ZP @@ -2158,7 +2193,7 @@ Shorter error diagnostics are produced for the experienced user. Warn if there has been `[No write since last change]' before a `!' command escape. .LC -\fBwindow\fR default: window=speed dependent +\fBwindow\fR from environment LINES .ZP The number of lines in a text window in the .I visual @@ -2184,10 +2219,10 @@ will wrap around past the end of the file. \fBwrapmargin\fR, \fBwm\fR default: wm=0 .ZP Defines a margin for automatic wrapover of text during input in -.I open -and +.\" .I open +.\" and .I visual -modes. See +mode. See .I "An Introduction to Text Editing with Vi" for details. .LC @@ -2201,7 +2236,7 @@ mechanism will allow. Acknowledgements .PP Chuck Haley contributed greatly to the early development of -.I ex. +.I ex . Bruce Englar encouraged the redesign which led to .I ex version 1. diff --git a/usr.bin/vi/docs/USD.doc/exref/ex.summary b/usr.bin/vi/docs/USD.doc/exref/ex.summary index 789ebd791db..0213189bc7f 100644 --- a/usr.bin/vi/docs/USD.doc/exref/ex.summary +++ b/usr.bin/vi/docs/USD.doc/exref/ex.summary @@ -1,4 +1,4 @@ -.\" $OpenBSD: ex.summary,v 1.5 2003/06/03 02:56:22 millert Exp $ +.\" $OpenBSD: ex.summary,v 1.6 2004/01/30 23:14:26 jmc Exp $ .\" .\" Copyright (c) 1980, 1993 .\" The Regents of the University of California. All rights reserved. @@ -47,54 +47,57 @@ .ps 12 .ft B .ce 1 -Ex/Edit Command Summary (Version 2.0) +.\" Ex/Edit Command Summary (Version 2.0) +Ex Command Summary (Version 2.0) .sp 1 .ft R .nr VS 11 .nr PS 9 -.2C +.\" .2C .PP .I Ex -and -.I edit -are text editors, used for creating +.\" and +.\" .I edit +is a text editor, used for creating and modifying files of text on the \*U computer system. -.I Edit -is a variant of -.I ex -with features designed to -make it less complicated -to learn and use. -In terms of command syntax and effect -the editors are essentially identical, -and this command summary applies to both. +.\" .I Edit +.\" is a variant of +.\" .I ex +.\" with features designed to +.\" make it less complicated +.\" to learn and use. +.\" In terms of command syntax and effect +.\" the editors are essentially identical, +.\" and this command summary applies to both. .PP The summary is meant as a quick reference for users already acquainted with -.I edit -or \fIex\fP. -Fuller explanations of the editors are available -in the documents -.I -Edit: A Tutorial -.R -(a self-teaching introduction) and the +.\" .I edit +.\" or +.I ex . +A fuller explanation of the editor is available +in the document +.\" .I +.\" Edit: A Tutorial +.\" .R +.\" (a self-teaching introduction) and the .I Ex Reference Manual .R (the comprehensive reference source for -both \fIedit\fP and \fIex\fP). -Both of these writeups are available in the -Computing Services Library. +.\" both \fIedit\fP and +.I ex ). +.\" Both of these writeups are available in the +.\" Computing Services Library. .PP In the examples included with the summary, commands and text entered by the user are printed in \fBboldface\fR to distinguish them from responses printed by the computer. -.sp 0.45v +.sp 1v .LP .B The Editor Buffer @@ -115,7 +118,7 @@ file in order to update the old version. The buffer disappears at the end of the editing session. -.sp 0.45v +.sp 1v .LP .B Editing: Command and Text Input Modes @@ -126,10 +129,10 @@ two usual modes of operation: \fIcommand\fP mode and \fItext input\fP mode. (This disregards, for the moment, -.I open -and +.\" .I open +.\" and .I visual -modes, discussed below.) +mode, discussed below.) In command mode, the editor issues a colon prompt (:) to show that it is ready to @@ -141,7 +144,7 @@ Text input mode is initiated by the commands \fIappend\fP, \fIinsert\fP, and \fIchange\fP, and is terminated by typing a period as the first and only character on a line. -.sp 0.45v +.sp 1v .LP .B Line Numbers and Command Syntax @@ -198,21 +201,22 @@ information; only the more important instances of this are mentioned in the summary. -.sp 0.25v +.sp 1v .LP .B -Open and Visual Modes +.\" Open and Visual Modes +Visual Mode .PP .R Besides command and text input modes, .I ex -and -.I edit -provide on some CRT terminals other modes of editing, -.I open -and +.\" and +.\" .I edit +provides on some CRT terminals another mode of editing: +.\" .I open +.\" and .I visual . -In these modes the cursor can +In this mode the cursor can be moved to individual words or characters in a line. The commands then given are very different @@ -222,7 +226,7 @@ typed. An Introduction to Display Editing with Vi .R provides a full discussion. -.sp 0.25v +.sp 1v .LP .B Special Characters @@ -232,20 +236,23 @@ Special Characters Some characters take on special meanings when used in context searches and in patterns given to the \fIsubstitute\fP command. -For \fIedit\fR, these are ``^'' and ``$'', -meaning the beginning and end of a line, -respectively. +.\" For \fIedit\fR, these are ``^'' and ``$'', +.\" meaning the beginning and end of a line, +.\" respectively. .I Ex -has the following additional special characters: +has the following special characters: +.sp 1v .B .ce 1 -\&. & * [ ] ~ +^ $ \&. & * [ ] ~ .R +.sp 1v To use one of the special characters as its simple graphic representation rather than with its special meaning, precede it by a backslash (\\). The backslash always has a special meaning. +.sp 1v .1C .TS cp10 cp10 cp10 cp10 @@ -297,9 +304,10 @@ The example places a copy of lines 8 through 12, inclusive, after line 25. T} T{ .nf -\fR:\fB8,12co 25 -\fRLast line copied is printed -\fR\*c +\fR:\fB8,12co 25\fP +Last line copied +is printed +\*c .fi T} .SP @@ -308,8 +316,9 @@ Removes lines from the buffer and prints the current line after the deletion. T} T{ .nf -\fR:\fB13,15d -\fRNew current line is printed +\fR:\fB13,15d\fP +New current line +is printed \*c .fi T} @@ -341,9 +350,11 @@ using the form \fBe!\fR overrides this protective mechanism. T} T{ .nf \fR:\fBe ch10\fR -No write since last change +No write since +last change :\fBe! ch10\fR -"ch10" 3 lines, 62 characters +"ch10" 3 lines, +62 characters \*c .fi T} @@ -355,10 +366,12 @@ If used without \fIname\fR, prints the name of the current file. T} T{ .nf -\fR:\fBf ch9 -\fR"ch9" [Modified] 3 lines ... -:\fBf -\fR"ch9" [Modified] 3 lines ... +\fR:\fBf ch9\fP +"ch9" [Modified] +3 lines ... +:\fBf\fP +"ch9" [Modified] +3 lines ... \*c .fi T} @@ -389,20 +402,22 @@ In other words, \fB1i\fR has the same effect as \fB0a\fR. T} T{ .nf :\fB1i -These lines of text will -be added prior to line 1. +These lines of text +will be added prior +to line 1. \&. \fR: .fi T} .SP \fR(.,.+1)\fBjoin j T{ -Join lines together, adjusting white space (spaces +Join lines together, adjusting whitespace (spaces and tabs) as necessary. T} T{ .nf :\fB2,5j\fR -Resulting line is printed +Resulting line is +printed : .fi T} @@ -412,7 +427,7 @@ T} cp10 cp10 cp10 cp10 ltw(1.0i) lt2w(0.40i)fB ltw(3.0i) ltw(1.8i). Name Abbr Description Examples -.sp 1.75 +.sp 1.75v \fR(.,.)\fBlist l T{ \fRPrints lines in a more unambiguous way than the \fIprint\fR @@ -437,7 +452,8 @@ indicated by \fIaddr\fR. T} T{ .nf \fR:\fB12,15m 25\fR -New current line is printed +New current line is +printed \*c .fi T} @@ -452,25 +468,25 @@ T} T{ \*c .fi T} -.SP -\fR(.)\fBopen o T{ -Too involved to discuss here, -but if you enter open mode -accidentally, press -the \s-2ESC\s0 key followed by -\fBq\fR to -get back into normal editor -command mode. -\fIEdit\fP is designed to -prevent accidental use of -the open command. -T} +.\" .SP +.\" \fR(.)\fBopen o T{ +.\" Too involved to discuss here, +.\" but if you enter open mode +.\" accidentally, press +.\" the \s-2ESC\s0 key followed by +.\" \fBq\fR to +.\" get back into normal editor +.\" command mode. +.\" \fIEdit\fP is designed to +.\" prevent accidental use of +.\" the open command. +.\" T} .SP \fBpreserve pre T{ Saves a copy of the current buffer contents as though the system had just crashed. This is for use in an emergency when a .I write -command has failed and you don't know how else to save your work.\(dg +command has failed and you don't know how else to save your work.* T} T{ .nf :\fBpreserve\fR @@ -490,7 +506,7 @@ T} .TE .FS .ll 6.5i -\(dg You should seek assistance from a system administrator as soon as +* You should seek assistance from a system administrator as soon as possible after saving a file with the .I preserve command, because the preserved copy of the file is saved in a @@ -599,10 +615,12 @@ T} T{ .nf \fR:\fB1,15d \fR15 lines deleted -new line number 1 is printed +new line number 1 +is printed :\fBu \fR15 more lines in file ... -old line number 1 is printed +old line number 1 +is printed \*c .fi T} |