include problem
[unix-history] / .ref-BSD-3 / usr / doc / ex / vi.summary
CommitLineData
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
37Ex Quick Reference
38.R
39.NL
40.LP
41.LP
42.h "Entering ex"
43.TS
44aw(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
54lw(1i) lw(2.0i).
55Command T{
56Normal and initial state. Input prompted for by \fB:\fP.
57Your kill character cancels partial command.
58T}
59Insert T{
60Entered by \fBa\fP \fBi\fP and \fBc\fP.
61Arbitrary text then terminates with line having only \fB.\fP
62character on it or abnormally with interrupt.
63T}
64Open/visual T{
65Entered by \fBo\fP or \fBv\fP, terminates with \fBq\fP
66or two successive interrupts.
67T}
68.TE
69.h "Ex commands"
70.TS
71lw(.45i) lw(.08i)b lw(.45i) lw(.08i)b lw(.45i) lw(.08i)b.
72append a next n substitute s
73args ar number nu undo u
74change c open o version ve
75copy co preserve pre visual vi
76delete d print p write w
77edit e put pu yank ya
78file f quit q \fIwindow\fP z
79global g read re \fIescape\fP !
80insert i recover rec \fIlshift\fP <
81join j rewind rew \fIprint next\fP \fRCR\fP
82list l set se \fIresubst\fP &
83mark ma shell sh \fIrshift\fP >
84move m source so \fIscroll\fP ^D
85.TE
86.h "Ex command addresses"
87.TS
88lw(.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
99aw(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
105lw(.4i) lw(.4i) lw(.4i) lw(.4i) lw(.4i).
1062621 43 adm31 dw1 i100
1072645 733 adm3a dw2 mime
108300s 745 c100 gt40 owl
10933 act4 dm1520 gt42 t1061
11037 act5 dm2500 h1500 vt52
1114014 adm3 dm3025 h1510
112.TE
113.h "Initializing options"
114.TS
115lw(.9i)b aw(1.5i).
116\&.exrc place \fBset\fP's here in \s-2HOME\s0 directory
117set \fIx\fP enable option
118set no\fIx\fP disable option
119set \fIx\fP=\fIval\fP give value \fIval\fP
120set show changed options
121set \fIx\fP? show value of option \fIx\fP
122.TE
123.h "Useful options"
124.TS
125lw(.9i)b lw(.3i) lw(1.0i).
126autoindent ai supply indent
127beautify bf discard nonprinting chars
128ignorecase ic in scanning
129lisp \fB( ) { }\fP are s-exp's
130list print ^I for tab, $ at end
131magic \fB. [ *\fP special in patterns
132number nu number lines
133paragraphs para macro names which start ...
134redraw simulate smart terminal
135sections sect macro names ...
136shiftwidth sw for \fB< >\fP, and input \fB^D ^T\fP
137showmatch sm to \fB)\fP and \fB}\fP as typed
138slowopen slow choke updates during insert
139wrapscan ws around end of buffer?
140wrapmargin wm automatic line splitting
141.TE
142.LP
143.h "Scanning pattern formation"
144.TS
145aw(.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
162Vi Quick Reference
163.NL
164.R
165.LP
166.LP
167.h "Starting vi"
168.TS
169aw(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
180lw(.75i) lw(2.2i).
181Last line T{
182Error messages, echoing input to \fB: / ?\fP and \fB!\fR,
183feedback about i/o and large changes.
184T}
185@ lines On screen only, not in file.
186~ lines Lines past end of file.
187^\fIx\fP Control characters, ^? is delete.
188tabs Expand to spaces, cursor at last.
189.TE
190.LP
191.h "Vi states"
192.TS
193lw(.75i) lw(2.2i).
194Command T{
195Normal and initial state. Others return here.
196ESC (escape) cancels partial command.
197T}
198Insert T{
199Entered by \fBa i A I o O c C s S\fP \fBR\fP.
200Arbitrary text then terminates with ESC character,
201or abnormally with interrupt.
202T}
203Last line T{
204Reading input for \fB: / ?\fP or \fB!\fP; terminate
205with ESC or CR to execute, interrupt to cancel.
206T}
207.TE
208.h "Counts before vi commands"
209.TS
210lw(1.5i) lw(1.7i)b.
211new window size : / ? [[ ]] ^F ^B \(ga \(aa
212line/column number z G |
213scroll amount ^D ^U
214replicate insert a i A I
215repeat effect \fRmost rest\fP
216.TE
217.h "Simple commands"
218.TS
219lw(1.5i)b lw(1.7i).
220dw delete a word
221de ... leaving punctuation
222dd delete a line
2233dd ... 3 lines
224i\fItext\fP\fRESC\fP insert text \fIabc\fP
225cw\fInew\fP\fRESC\fP change word to \fInew\fP
226ea\fIs\fP\fRESC\fP pluralize word
227xp transpose characters
228.TE
229.nc
230.h "Interrupting, cancelling"
231.TS
232aw(0.75i)b aw(1.6i).
233ESC 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
239aw(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
263aw(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
268G goto line (end default)
269/\fIpat\fR next line matching \fIpat\fR
270?\fIpat\fR prev line matching \fIpat\fR
271n repeat last \fB/\fR or \fB?\fR
272N 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
281aw(0.75i)b aw(1.6i).
282^L clear and redraw
283^R retype, eliminate @ lines
284z\fRCR\fP redraw, current at window top
285z\- ... at bottom
286z\|. ... at center
287/\fIpat\fP/z\- \fIpat\fP line at bottom
288z\fIn\fP\|. use \fIn\fP line window
289.TE
290.nc
291.h "Marking and returning
292.TS
293aw(0.5i)b aw(2.0i).
294\(ga\(ga previous context
295\(aa\(aa ... at first non-white in line
296m\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
302aw(0.5i)b aw(2.0i).
303H home window line
304L last window line
305M 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
315aw(0.5i)b aw(2.0i).
316\(ua first non white
3170 beginning of line
318$ end of line
319\fRspace\fP forward
320^H backwards
321h same as \fB^H\fP
322f\fIx\fP find \fIx\fP forward
323F\fIx\fP \fBf\fR backward
324t\fIx\fP upto \fIx\fP forward
325T\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
333aw(0.5i)b aw(2.0i).
334w word forward
335b back word
336e end of word
337) to next sentence
338} to next paragraph
339( back sentence
340{ back paragraph
341W blank delimited word
342B back \fBW\fP
343E to end of \fBW\fP
344.TE
345.h "Commands for \s-2LISP\s0"
346.TS
347aw(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
356aw(.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
3660^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
372aw(.5i)b aw(2.0i).
373a append after cursor
374i insert before
375A append at end of line
376I insert before first non-blank
377o open line below
378O open above
379r\fIx\fP replace single char with \fIx\fP
380R replace characters
381.TE
382.h "Operators (double to affect lines)"
383.TS
384aw(0.5i)b aw(2.0i).
385d delete
386c change
387< left shift
388> right shift
389! filter through command
390\&\= indent for \s-2LISP\s0
391y yank lines to buffer
392.TE
393.h "Miscellaneous operations"
394.TS
395aw(0.5i)b aw(2.0i).
396C change rest of line
397D delete rest of line
398s substitute chars
399S substitute lines
400J join lines
401x delete characters
402X ... before cursor
403Y yank lines
404.TE
405.h "Yank and put"
406.TS
407aw(0.5i)b aw(2.0i).
408p put back lines
409P 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
416aw(0.5i)b aw(2.0i).
417u undo last change
418U restore current line
419\fB.\fP repeat last change
420"\fId\fP\|p retrieve \fId\fP'th last delete
421.TE