Commit | Line | Data |
---|---|---|
44b08951 BJ |
1 | .ds CH |
2 | .ds CF | |
3 | .de TS | |
4 | .br | |
5 | .if !\\n(1T .RT | |
6 | .ul 0 | |
7 | .ti \\n(.iu | |
8 | .if t .sp 0.25 | |
9 | .if n .sp | |
10 | .if \a\\$1\aH\a .TQ | |
11 | .nr IX 1 | |
12 | .. | |
13 | .nr PS 9 | |
14 | .ps 9 | |
15 | .nr VS 11 | |
16 | .vs 11 | |
17 | .nr HM .50i | |
18 | .nr FM .25i | |
19 | .nr PO 0 | |
20 | .po 0 | |
21 | .nr LL 3.5i | |
22 | .ll 3.5i | |
23 | .de nc | |
24 | .bp | |
25 | .. | |
26 | .de h | |
27 | .LG | |
28 | .B | |
29 | \\$1 | |
30 | .R | |
31 | .NL | |
32 | .. | |
33 | .LG | |
34 | .LG | |
35 | .B | |
36 | .ce | |
37 | Ex Quick Reference | |
38 | .R | |
39 | .NL | |
40 | .LP | |
41 | .LP | |
42 | .h "Entering ex" | |
43 | .TS | |
44 | aw(1.4i)b aw(1.8i). | |
45 | % ex \fIname\fP edit \fIname\fP, start at end | |
46 | % ex +\fIn\fP \fIname\fP ... at line \fIn\fP | |
47 | % ex \-t \fItag\fP start at \fItag\fP | |
48 | % ex \-r list saved files | |
49 | % ex \-r \fIname\fP recover file \fIname\fP | |
50 | % ex \fIname\fP ... edit first; rest via \fB:n\fP | |
51 | .TE | |
52 | .h "Ex states" | |
53 | .TS | |
54 | lw(1i) lw(2.0i). | |
55 | Command T{ | |
56 | Normal and initial state. Input prompted for by \fB:\fP. | |
57 | Your kill character cancels partial command. | |
58 | T} | |
59 | Insert T{ | |
60 | Entered by \fBa\fP \fBi\fP and \fBc\fP. | |
61 | Arbitrary text then terminates with line having only \fB.\fP | |
62 | character on it or abnormally with interrupt. | |
63 | T} | |
64 | Open/visual T{ | |
65 | Entered by \fBo\fP or \fBv\fP, terminates with \fBq\fP | |
66 | or two successive interrupts. | |
67 | T} | |
68 | .TE | |
69 | .h "Ex commands" | |
70 | .TS | |
71 | lw(.45i) lw(.08i)b lw(.45i) lw(.08i)b lw(.45i) lw(.08i)b. | |
72 | append a next n substitute s | |
73 | args ar number nu undo u | |
74 | change c open o version ve | |
75 | copy co preserve pre visual vi | |
76 | delete d print p write w | |
77 | edit e put pu yank ya | |
78 | file f quit q \fIwindow\fP z | |
79 | global g read re \fIescape\fP ! | |
80 | insert i recover rec \fIlshift\fP < | |
81 | join j rewind rew \fIprint next\fP \fRCR\fP | |
82 | list l set se \fIresubst\fP & | |
83 | mark ma shell sh \fIrshift\fP > | |
84 | move m source so \fIscroll\fP ^D | |
85 | .TE | |
86 | .h "Ex command addresses" | |
87 | .TS | |
88 | lw(.3i)b lw(0.8i) lw(.3i)b lw(0.8i). | |
89 | \fIn\fP line \fIn\fP /\fIpat\fP next with \fIpat\fP | |
90 | \&. current ?\fIpat\fP previous with \fIpat\fP | |
91 | $ last \fIx\fP-\fIn\fP \fIn\fP before \fIx\fP | |
92 | + next \fIx\fP,\fIy\fP \fIx\fP through \fIy\fP | |
93 | \- previous \(aa\fIx\fP marked with \fIx\fP | |
94 | +\fIn\fP \fIn\fP forward \(aa\(aa previous context | |
95 | .TE | |
96 | .nc | |
97 | .h "Specifying terminal type" | |
98 | .TS | |
99 | aw(1.7i)b aw(1.5i). | |
100 | % setenv TERM \fItype\fP \fIcsh\fP and all version 6 | |
101 | $ TERM=\fItype\fP \fIsh\fP in Version 7 | |
102 | .TE | |
103 | .h "Some terminal types" | |
104 | .TS | |
105 | lw(.4i) lw(.4i) lw(.4i) lw(.4i) lw(.4i). | |
106 | 2621 43 adm31 dw1 i100 | |
107 | 2645 733 adm3a dw2 mime | |
108 | 300s 745 c100 gt40 owl | |
109 | 33 act4 dm1520 gt42 t1061 | |
110 | 37 act5 dm2500 h1500 vt52 | |
111 | 4014 adm3 dm3025 h1510 | |
112 | .TE | |
113 | .h "Initializing options" | |
114 | .TS | |
115 | lw(.9i)b aw(1.5i). | |
116 | \&.exrc place \fBset\fP's here in \s-2HOME\s0 directory | |
117 | set \fIx\fP enable option | |
118 | set no\fIx\fP disable option | |
119 | set \fIx\fP=\fIval\fP give value \fIval\fP | |
120 | set show changed options | |
121 | set \fIx\fP? show value of option \fIx\fP | |
122 | .TE | |
123 | .h "Useful options" | |
124 | .TS | |
125 | lw(.9i)b lw(.3i) lw(1.0i). | |
126 | autoindent ai supply indent | |
127 | beautify bf discard nonprinting chars | |
128 | ignorecase ic in scanning | |
129 | lisp \fB( ) { }\fP are s-exp's | |
130 | list print ^I for tab, $ at end | |
131 | magic \fB. [ *\fP special in patterns | |
132 | number nu number lines | |
133 | paragraphs para macro names which start ... | |
134 | redraw simulate smart terminal | |
135 | sections sect macro names ... | |
136 | shiftwidth sw for \fB< >\fP, and input \fB^D ^T\fP | |
137 | showmatch sm to \fB)\fP and \fB}\fP as typed | |
138 | slowopen slow choke updates during insert | |
139 | wrapscan ws around end of buffer? | |
140 | wrapmargin wm automatic line splitting | |
141 | .TE | |
142 | .LP | |
143 | .h "Scanning pattern formation" | |
144 | .TS | |
145 | aw(.9i)b aw(1.0i). | |
146 | \(ua beginning of line | |
147 | $ end of line | |
148 | \fB.\fR any character | |
149 | \e< beginning of word | |
150 | \e> end of word | |
151 | [\fIstr\fP] any char in \fIstr\fP | |
152 | [\(ua\fIstr\fP] ... not in \fIstr\fP | |
153 | [\fIx\-y\fP] ... between \fIx\fP and \fIy\fP | |
154 | * any number of preceding | |
155 | .TE | |
156 | .nc | |
157 | .LP | |
158 | .LG | |
159 | .LG | |
160 | .B | |
161 | .ce | |
162 | Vi Quick Reference | |
163 | .NL | |
164 | .R | |
165 | .LP | |
166 | .LP | |
167 | .h "Starting vi" | |
168 | .TS | |
169 | aw(1.4i)b aw(1.8i). | |
170 | % vi \fIname\fP edit \fIname\fP at top | |
171 | % vi +\fIn\fP \fIname\fP ... at line \fIn\fP | |
172 | % vi + \fIname\fP ... at end | |
173 | % vi \-r list saved files | |
174 | % vi \-r \fIname\fP recover file \fIname\fP | |
175 | % vi \fIname\fP ... edit first; rest via \fB:n\fP | |
176 | % vi \-t \fItag\fP start at \fItag\fP | |
177 | .TE | |
178 | .h "The display" | |
179 | .TS | |
180 | lw(.75i) lw(2.2i). | |
181 | Last line T{ | |
182 | Error messages, echoing input to \fB: / ?\fP and \fB!\fR, | |
183 | feedback about i/o and large changes. | |
184 | T} | |
185 | @ lines On screen only, not in file. | |
186 | ~ lines Lines past end of file. | |
187 | ^\fIx\fP Control characters, ^? is delete. | |
188 | tabs Expand to spaces, cursor at last. | |
189 | .TE | |
190 | .LP | |
191 | .h "Vi states" | |
192 | .TS | |
193 | lw(.75i) lw(2.2i). | |
194 | Command T{ | |
195 | Normal and initial state. Others return here. | |
196 | ESC (escape) cancels partial command. | |
197 | T} | |
198 | Insert T{ | |
199 | Entered by \fBa i A I o O c C s S\fP \fBR\fP. | |
200 | Arbitrary text then terminates with ESC character, | |
201 | or abnormally with interrupt. | |
202 | T} | |
203 | Last line T{ | |
204 | Reading input for \fB: / ?\fP or \fB!\fP; terminate | |
205 | with ESC or CR to execute, interrupt to cancel. | |
206 | T} | |
207 | .TE | |
208 | .h "Counts before vi commands" | |
209 | .TS | |
210 | lw(1.5i) lw(1.7i)b. | |
211 | new window size : / ? [[ ]] ^F ^B \(ga \(aa | |
212 | line/column number z G | | |
213 | scroll amount ^D ^U | |
214 | replicate insert a i A I | |
215 | repeat effect \fRmost rest\fP | |
216 | .TE | |
217 | .h "Simple commands" | |
218 | .TS | |
219 | lw(1.5i)b lw(1.7i). | |
220 | dw delete a word | |
221 | de ... leaving punctuation | |
222 | dd delete a line | |
223 | 3dd ... 3 lines | |
224 | i\fItext\fP\fRESC\fP insert text \fIabc\fP | |
225 | cw\fInew\fP\fRESC\fP change word to \fInew\fP | |
226 | ea\fIs\fP\fRESC\fP pluralize word | |
227 | xp transpose characters | |
228 | .TE | |
229 | .nc | |
230 | .h "Interrupting, cancelling" | |
231 | .TS | |
232 | aw(0.75i)b aw(1.6i). | |
233 | ESC end insert or incomplete cmd | |
234 | ^? (delete or rubout) interrupts | |
235 | ^L reprint screen if \fB^?\fR scrambles it | |
236 | .TE | |
237 | .h "File manipulation" | |
238 | .TS | |
239 | aw(0.75i)b aw(1.6i). | |
240 | :w write back changes | |
241 | :wq write and quit | |
242 | :q quit | |
243 | :q! quit, discard changes | |
244 | :e \fIname\fP edit file \fIname\fP | |
245 | :e! reedit, discard changes | |
246 | :e + \fIname\fP edit, starting at end | |
247 | :e +\fIn\fR edit starting at line \fIn\fR | |
248 | :e # edit alternate file | |
249 | ^\(ua synonym for \fB:e #\fP | |
250 | :w \fIname\fP write file \fIname\fP | |
251 | :w! \fIname\fP overwrite file \fIname\fP | |
252 | :sh run shell, then return | |
253 | :!\fIcmd\fP run \fIcmd\fR, then return | |
254 | :n edit next file in arglist | |
255 | :n \fIargs\fP specify new arglist | |
256 | :f show current file and line | |
257 | ^G synonym for \fB:f\fP | |
258 | :ta \fItag\fP to tag file entry \fItag\fP | |
259 | ^] \fB:ta\fP, following word is \fItag\fP | |
260 | .TE | |
261 | .h "Positioning within file" | |
262 | .TS | |
263 | aw(0.75i)b aw(1.6i). | |
264 | ^F forward screenful | |
265 | ^B backward screenful | |
266 | ^D scroll down half screen | |
267 | ^U scroll up half screen | |
268 | G goto line (end default) | |
269 | /\fIpat\fR next line matching \fIpat\fR | |
270 | ?\fIpat\fR prev line matching \fIpat\fR | |
271 | n repeat last \fB/\fR or \fB?\fR | |
272 | N reverse last \fB/\fR or \fB?\fR | |
273 | /\fIpat\fP/+\fIn\fP n'th line after \fIpat\fR | |
274 | ?\fIpat\fP?\-\fIn\fP n'th line before \fIpat\fR | |
275 | ]] next section/function | |
276 | [[ previous section/function | |
277 | % find matching \fB( ) {\fP or \fB}\fP | |
278 | .TE | |
279 | .h "Adjusting the screen" | |
280 | .TS | |
281 | aw(0.75i)b aw(1.6i). | |
282 | ^L clear and redraw | |
283 | ^R retype, eliminate @ lines | |
284 | z\fRCR\fP redraw, current at window top | |
285 | z\- ... at bottom | |
286 | z\|. ... at center | |
287 | /\fIpat\fP/z\- \fIpat\fP line at bottom | |
288 | z\fIn\fP\|. use \fIn\fP line window | |
289 | .TE | |
290 | .nc | |
291 | .h "Marking and returning | |
292 | .TS | |
293 | aw(0.5i)b aw(2.0i). | |
294 | \(ga\(ga previous context | |
295 | \(aa\(aa ... at first non-white in line | |
296 | m\fIx\fP mark position with letter \fIx\fP | |
297 | \(ga\fIx\fP to mark \fIx\fP | |
298 | \(aa\fIx\fP ... at first non-white in line | |
299 | .TE | |
300 | .h "Line positioning" | |
301 | .TS | |
302 | aw(0.5i)b aw(2.0i). | |
303 | H home window line | |
304 | L last window line | |
305 | M middle window line | |
306 | + next line, at first non-white | |
307 | \- previous line, at first non-white | |
308 | \fRCR\fP return, same as + | |
309 | ^N next line, same column | |
310 | ^P previous line, same column | |
311 | \fBLF\fP linefeed, same as \fB^N\fP | |
312 | .TE | |
313 | .h "Character positioning" | |
314 | .TS | |
315 | aw(0.5i)b aw(2.0i). | |
316 | \(ua first non white | |
317 | 0 beginning of line | |
318 | $ end of line | |
319 | \fRspace\fP forward | |
320 | ^H backwards | |
321 | h same as \fB^H\fP | |
322 | f\fIx\fP find \fIx\fP forward | |
323 | F\fIx\fP \fBf\fR backward | |
324 | t\fIx\fP upto \fIx\fP forward | |
325 | T\fIx\fP back upto \fIx\fP | |
326 | ; repeat last \fBf F t\fP or \fBT\fP | |
327 | , inverse of \fB;\fP | |
328 | | to specified column | |
329 | % find matching \fB( { )\fP or \fB}\fR | |
330 | .TE | |
331 | .h "Words, sentences, paragraphs" | |
332 | .TS | |
333 | aw(0.5i)b aw(2.0i). | |
334 | w word forward | |
335 | b back word | |
336 | e end of word | |
337 | ) to next sentence | |
338 | } to next paragraph | |
339 | ( back sentence | |
340 | { back paragraph | |
341 | W blank delimited word | |
342 | B back \fBW\fP | |
343 | E to end of \fBW\fP | |
344 | .TE | |
345 | .h "Commands for \s-2LISP\s0" | |
346 | .TS | |
347 | aw(0.5i)b aw(2.0i). | |
348 | ) Forward s-expression | |
349 | } ... but don't stop at atoms | |
350 | ( Back s-expression | |
351 | { ... but don't stop at atoms | |
352 | .TE | |
353 | .nc | |
354 | .h "Corrections during insert" | |
355 | .TS | |
356 | aw(.5i)b aw(2.0i). | |
357 | ^H erase last character | |
358 | ^W erases last word | |
359 | \fRerase\fP your erase, same as \fB^H\fP | |
360 | \fRkill\fP your kill, erase input this line | |
361 | \e escapes \fB^H\fR, your erase and kill | |
362 | \fRESC\fP ends insertion, back to command | |
363 | ^? interrupt, terminates insert | |
364 | ^D backtab over \fIautoindent\fP | |
365 | \(ua^D kill \fIautoindent\fP, save for next | |
366 | 0^D ... but at margin next also | |
367 | ^Q quote non-printing character | |
368 | ^T \fIshiftwidth\fP forward tab | |
369 | .TE | |
370 | .h "Insert and replace" | |
371 | .TS | |
372 | aw(.5i)b aw(2.0i). | |
373 | a append after cursor | |
374 | i insert before | |
375 | A append at end of line | |
376 | I insert before first non-blank | |
377 | o open line below | |
378 | O open above | |
379 | r\fIx\fP replace single char with \fIx\fP | |
380 | R replace characters | |
381 | .TE | |
382 | .h "Operators (double to affect lines)" | |
383 | .TS | |
384 | aw(0.5i)b aw(2.0i). | |
385 | d delete | |
386 | c change | |
387 | < left shift | |
388 | > right shift | |
389 | ! filter through command | |
390 | \&\= indent for \s-2LISP\s0 | |
391 | y yank lines to buffer | |
392 | .TE | |
393 | .h "Miscellaneous operations" | |
394 | .TS | |
395 | aw(0.5i)b aw(2.0i). | |
396 | C change rest of line | |
397 | D delete rest of line | |
398 | s substitute chars | |
399 | S substitute lines | |
400 | J join lines | |
401 | x delete characters | |
402 | X ... before cursor | |
403 | Y yank lines | |
404 | .TE | |
405 | .h "Yank and put" | |
406 | .TS | |
407 | aw(0.5i)b aw(2.0i). | |
408 | p put back lines | |
409 | P put before | |
410 | "\fIx\fPp put from buffer \fIx\fP | |
411 | "\fIx\fPy yank to buffer \fIx\fP | |
412 | "\fIx\fPd delete into buffer \fIx\fP | |
413 | .TE | |
414 | .h "Undo, redo, retrieve" | |
415 | .TS | |
416 | aw(0.5i)b aw(2.0i). | |
417 | u undo last change | |
418 | U restore current line | |
419 | \fB.\fP repeat last change | |
420 | "\fId\fP\|p retrieve \fId\fP'th last delete | |
421 | .TE |