Commit | Line | Data |
---|---|---|
2fd0a8e1 BJ |
1 | .if !\n(xx .so tmac.e |
2 | .SH | |
3 | Command summary | |
4 | .PP | |
5 | Summarizing the discussion above, | |
6 | the general form of an | |
7 | .EX | |
8 | command is: | |
9 | .tr ** | |
10 | .DS | |
11 | \fIaddress\fR \fBcommand\fR \fI! parameters count flags\fR | |
12 | .DE | |
13 | All parts are optional; the degenerate case is the | |
14 | empty command which prints the next line in the file. | |
15 | .PP | |
16 | The following table summarizes | |
17 | .EX | |
18 | command formats and | |
19 | the shortest allowable abbreviations for commands. | |
20 | Except as noted, all commands which take addresses | |
21 | assume the current line as default if no addresses are given. | |
22 | Each command will be discussed in more detail in the next section. | |
23 | .TS H | |
24 | center box; | |
25 | c s s | |
26 | a | l | l | |
27 | aB | lB | l. | |
28 | Command summary | |
29 | _ | |
30 | Prototype Abbr. Description | |
31 | _ | |
32 | .TH | |
33 | append \fI!\fR a \fRAppend text after addressed lines\fR\fR | |
34 | args \fI!\fR ar \fRPrint argument list\fR\fR | |
35 | cd \fIdir\fR cd \fRSynonym for \fIchdir\fR\fR | |
36 | change \fI!\fR c \fRChange text of specified lines\fR\fR | |
37 | chdir \fIdir\fR chd \fRChange working directory\fR\fR | |
38 | copy \fIaddr\fR co \fRMake a copy of specified lines after \fIaddr\fR\fR\fR | |
39 | delete \fIcount\fR d \fRDelete specified lines\fR\fR | |
40 | echo \fItext\fR ec \fREcho \fItext\fR to output\fR\fR | |
41 | edit \fIfile\fR ed \fRSynonym for \fIex\fR\fR\fR | |
42 | ex \fIfile\fR e \fREdit specified file\fR\fR | |
43 | expand \fIcount\fR exp \fRExpand tabs to spaces\fR\fR | |
44 | file \fIfile\fR f \fRDisplay/change current file\fR\fR | |
45 | global \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 | |
46 | help \fItopic\fR h \fRProvide information on \fItopic\fR\fR | |
47 | insert \fI!\fR i \fRInsert text before addressed line\fR\fR | |
48 | join \fI!\fR \fIcount\fR j \fRJoin lines together\fR\fR | |
49 | k \fIx\fR k \fRSynonym for \fImark\fR\fR\fR | |
50 | list \fIcount\fR l \fRPrint lines more unambiguously\fR\fR | |
51 | mark \fIx\fR ma \fRMark addressed line with letter \fIx\fR\fR\fR | |
52 | move \fIaddr\fR m \fRMove specified lines after \fIaddr\fR\fR\fR | |
53 | next \fI!\fR n \fREdit next file in argument list\fR\fR | |
54 | next \fI!\fR \fIfilelist\fR n \fRRespecify argument list; edit first file\fR\fR | |
55 | open \fI/pat\fR\|/ o \fRIntraline edit of specified line\fR\fR | |
56 | preserve pre \fRSave buffer when disaster strikes\fR\fR | |
57 | print \fIcount\fR p \fRPrint addressed lines\fR\fR | |
58 | put pu \fRRestore lines\fR\fR | |
59 | quit \fI!\fR q \fRTerminate editor session\fR\fR | |
60 | read \fIfile\fR r \fRRead \fIfile\fR into buffer after current line\fR\fR | |
61 | recover \fIfile\fR rec \fRRecover editing buffer after disaster\fR\fR | |
62 | reset res \fRRestore option default values\fR\fR | |
63 | rewind rew \fRRewind argument list; edit first file\fR\fR | |
64 | set \fIparams\fR se \fRSet/interrogate options\fR\fR | |
65 | shell sh \fRInvoke another, interactive, shell\fR\fR | |
66 | source \fIfile\fR so \fRRead editor commands from \fIfile\fR\fR\fR | |
67 | substitute\fI/pat\|\fR/\fIrepl\|\fR/ \fIflags\fR \fIcount\fR\|\u\s-2\(dg\s0\d su \fRSubstitute \fIrepl\fR for \fIpat\fR\fR\fR | |
68 | sync sy \fRSynchronize the temporary file\fR\fR | |
69 | tabulate \fIcount\fR ta \fRConvert (leading) blanks to tabs\fR\fR | |
70 | transcribe \fIaddr\fR t \fRSynonym for \fIcopy\fR\fR\fR | |
71 | undo \fI!\fR u \fRReverse effect of last command\fR\fR | |
72 | v\u\s-2\(dg\s0\d v \fR\fRSynonym for ``\fIglobal!\fR\|'' variant\fR\fR | |
73 | version ve \fRPrint current version information\fR\fR | |
74 | visual \fItype\fR vi \fREnter visual mode\fR\fR | |
75 | write \fI!\fR \fIfile\fR\|\u\s-2\(dd\s0\d w \fRWrite specified lines to \fIfile\fR\fR\fR | |
76 | write \fI!\fR >> \fIfile\fR\|\u\s-2\(dd\s0\d w \fRWrite addressed lines at end of \fIfile\fR\fR\fR | |
77 | xpand \fIcount\fR x \fRSynonym for \fIexpand\fR\fR\fR | |
78 | yank \fIcount\fR ya \fRDefine lines to be \fIput\fR\fR | |
79 | z \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& | |
93 | lp-2 s s. | |
94 | T{ | |
95 | \(dg \fIPat\fR may be delimited by other characters; | |
96 | `\e/' and `\e&/' are also permitted as in address formation, | |
97 | and with these forms | |
98 | .I repl | |
99 | is terminated by `/' in a | |
100 | .I substitute . | |
101 | T} | |
102 | \(dd Default address is entire buffer (last line for `='). | |
103 | .TE | |
104 | .SH | |
105 | Command variants | |
106 | .PP | |
107 | A number of command have variants, | |
108 | introduced by following the command name with a `!'. | |
109 | These variants are summarized in the following table. | |
110 | .KS | |
111 | .TS | |
112 | center box; | |
113 | c s | |
114 | l | l | |
115 | a | l. | |
116 | Command variants | |
117 | _ | |
118 | Variant 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 *\(** |