BSD 1 development
[unix-history] / exrefm / exrefm5.n
CommitLineData
2fd0a8e1
BJ
1.if !\n(xx .so tmac.e
2.SH
3Command summary
4.PP
5Summarizing the discussion above,
6the general form of an
7.EX
8command is:
9.tr **
10.DS
11\fIaddress\fR \fBcommand\fR \fI! parameters count flags\fR
12.DE
13All parts are optional; the degenerate case is the
14empty command which prints the next line in the file.
15.PP
16The following table summarizes
17.EX
18command formats and
19the shortest allowable abbreviations for commands.
20Except as noted, all commands which take addresses
21assume the current line as default if no addresses are given.
22Each command will be discussed in more detail in the next section.
23.TS H
24center box;
25c s s
26a | l | l
27aB | lB | l.
28Command summary
29_
30Prototype Abbr. Description
31_
32.TH
33append \fI!\fR a \fRAppend text after addressed lines\fR\fR
34args \fI!\fR ar \fRPrint argument list\fR\fR
35cd \fIdir\fR cd \fRSynonym for \fIchdir\fR\fR
36change \fI!\fR c \fRChange text of specified lines\fR\fR
37chdir \fIdir\fR chd \fRChange working directory\fR\fR
38copy \fIaddr\fR co \fRMake a copy of specified lines after \fIaddr\fR\fR\fR
39delete \fIcount\fR d \fRDelete specified lines\fR\fR
40echo \fItext\fR ec \fREcho \fItext\fR to output\fR\fR
41edit \fIfile\fR ed \fRSynonym for \fIex\fR\fR\fR
42ex \fIfile\fR e \fREdit specified file\fR\fR
43expand \fIcount\fR exp \fRExpand tabs to spaces\fR\fR
44file \fIfile\fR f \fRDisplay/change current file\fR\fR
45global \fI/pat\|\fR/ \fIcmds\fR\|\u\s-2\(dg\s0\d\|\u\s-2\(dd\s0\d g \fRExecute \fIcmds\fR on lines matching \fIpat\fR\fR\fR
46help \fItopic\fR h \fRProvide information on \fItopic\fR\fR
47insert \fI!\fR i \fRInsert text before addressed line\fR\fR
48join \fI!\fR \fIcount\fR j \fRJoin lines together\fR\fR
49k \fIx\fR k \fRSynonym for \fImark\fR\fR\fR
50list \fIcount\fR l \fRPrint lines more unambiguously\fR\fR
51mark \fIx\fR ma \fRMark addressed line with letter \fIx\fR\fR\fR
52move \fIaddr\fR m \fRMove specified lines after \fIaddr\fR\fR\fR
53next \fI!\fR n \fREdit next file in argument list\fR\fR
54next \fI!\fR \fIfilelist\fR n \fRRespecify argument list; edit first file\fR\fR
55open \fI/pat\fR\|/ o \fRIntraline edit of specified line\fR\fR
56preserve pre \fRSave buffer when disaster strikes\fR\fR
57print \fIcount\fR p \fRPrint addressed lines\fR\fR
58put pu \fRRestore lines\fR\fR
59quit \fI!\fR q \fRTerminate editor session\fR\fR
60read \fIfile\fR r \fRRead \fIfile\fR into buffer after current line\fR\fR
61recover \fIfile\fR rec \fRRecover editing buffer after disaster\fR\fR
62reset res \fRRestore option default values\fR\fR
63rewind rew \fRRewind argument list; edit first file\fR\fR
64set \fIparams\fR se \fRSet/interrogate options\fR\fR
65shell sh \fRInvoke another, interactive, shell\fR\fR
66source \fIfile\fR so \fRRead editor commands from \fIfile\fR\fR\fR
67substitute\fI/pat\|\fR/\fIrepl\|\fR/ \fIflags\fR \fIcount\fR\|\u\s-2\(dg\s0\d su \fRSubstitute \fIrepl\fR for \fIpat\fR\fR\fR
68sync sy \fRSynchronize the temporary file\fR\fR
69tabulate \fIcount\fR ta \fRConvert (leading) blanks to tabs\fR\fR
70transcribe \fIaddr\fR t \fRSynonym for \fIcopy\fR\fR\fR
71undo \fI!\fR u \fRReverse effect of last command\fR\fR
72v\u\s-2\(dg\s0\d v \fR\fRSynonym for ``\fIglobal!\fR\|'' variant\fR\fR
73version ve \fRPrint current version information\fR\fR
74visual \fItype\fR vi \fREnter visual mode\fR\fR
75write \fI!\fR \fIfile\fR\|\u\s-2\(dd\s0\d w \fRWrite specified lines to \fIfile\fR\fR\fR
76write \fI!\fR >> \fIfile\fR\|\u\s-2\(dd\s0\d w \fRWrite addressed lines at end of \fIfile\fR\fR\fR
77xpand \fIcount\fR x \fRSynonym for \fIexpand\fR\fR\fR
78yank \fIcount\fR ya \fRDefine lines to be \fIput\fR\fR
79z \fItype count\fR z \fRContext display\fR\fR
80! \fIcommand\fR - \fRSend \fIcommand\fR to a shell\fR\fR
81=\fR\u\s-2\(dd\s0\d - \fRShow line number in buffer\fR\fR
82> \fIcount\fR - \fRRight shift\fR\fR
83< \fIcount\fR - \fRLeft shift\fR\fR
84\s-2EOF\s0 - \fRScroll (\s-2EOF\s0 is generated by \s-2CTRL\s0(D))\fR\fR
85\s-2CR\s0 \fRor\fB \s-2NL\s0 \fB- \fRNull command prints addressed (next) line\fR\fR
86# \fIcount\fR - \fRSynonym for \fInumber\fR\fR\fR
87: \fIcount\fR - \fRPrint inhibiting \fIlist\fR and \fInumber\fR options.\fR\fR
88& \fIflags\fR \fIcount\fR - \fRRepeat last \fIsubstitute\fR command\fR\fR
89\s+2\d~\u\s0 \fIflags\fR \fIcount\fR - \fRSubstitute last \fIrepl\fR for last pattern\fR\fR
90|\fR - \fRMultiple command per line separator\fR\fR
91_
92.T&
93lp-2 s s.
94T{
95\(dg \fIPat\fR may be delimited by other characters;
96`\e/' and `\e&/' are also permitted as in address formation,
97and with these forms
98.I repl
99is terminated by `/' in a
100.I substitute .
101T}
102\(dd Default address is entire buffer (last line for `=').
103.TE
104.SH
105Command variants
106.PP
107A number of command have variants,
108introduced by following the command name with a `!'.
109These variants are summarized in the following table.
110.KS
111.TS
112center box;
113c s
114l | l
115a | l.
116Command variants
117_
118Variant Description
119_
120\fBappend\fR \fI!\fR Toggle \fIautoindent\fR during \fIappend\fR
121\fBargs\fR \fI!\fR Print all arguments, not just those remaining
122\fBchange\fR \fI!\fR \fIcount\fR Like \fIappend!\fR
123\fBex\fR \fI!\fR \fIfile\fR Suppress ``No write'' complaint before executing
124\fBedit\fR \fI!\fR \fIfile\fR Like \fIex!\fR
125\fBglobal\fR \fI!\fR /\fIpat\fR/ \fIcmds\fR Execute \fIcmds\fR on lines not matching \fIpat\fR
126\fBinsert\fR \fI!\fR Like \fIappend!\fR
127\fBjoin\fR \fI!\fR \fIcount\fR Join lines without massaging blank space
128\fBnext\fR \fI!\fR Like \fIex!\fR
129\fBquit\fR \fI!\fR Suppress ``More files'' and ``No write'' complaints
130\fBtabulate\fR \fI!\fR \fIcount\fR Convert all blanks to tabs, not just initial
131\fBundo\fR \fI!\fR No error if ``Nothing to undo'' or ``No change''
132\fBwrite\fR \fI!\fR \fIfile\fR Suppress \fIwrite\fR checks (i.e. overwrite file)
133\fBwrite\fR \fI!\fR >> \fIfile\fR Like \fIwrite!\fR (\fIfile\fR can be non-existent)
134.TE
135.KE
136.bp
137.tr *\(**