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