1 .\" Copyright (c) 1980, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" %sccs.include.redist.roff%
6 .\" $Id: vi.summary,v 8.3 1996/08/18 11:35:55 bostic Exp $ (Berkeley) $Date: 1996/08/18 11:35:55 $
49 .h "Entering/leaving ex"
52 % ex \fIname\fP edit \fIname\fP, start at end
53 % ex +\fIn\fP \fIname\fP ... at line \fIn\fP
54 % ex \-t \fItag\fP start at \fItag\fP
55 % ex \-r list saved files
56 % ex \-r \fIname\fP recover file \fIname\fP
57 % ex \fIname\fP ... edit first; rest via \fB:n\fP
58 % ex \-R \fIname\fP read only mode
59 : x exit, saving changes
60 : q! exit, discarding changes
66 Normal and initial state. Input prompted for by \fB:\fP.
67 Your kill character cancels partial command.
70 Entered by \fBa\fP \fBi\fP and \fBc\fP.
71 Arbitrary text then terminates with line having only \fB.\fP
72 character on it or abnormally with interrupt.
75 Entered by \fBopen\fP or \fBvi\fP, terminates with \fBQ\fP
81 lw(.45i) lw(.08i)b lw(.45i) lw(.08i)b lw(.45i) lw(.08i)b.
82 abbrev ab next n unabbrev una
83 append a number nu undo u
84 args ar open o unmap unm
85 change c preserve pre version ve
86 copy co print p visual vi
87 delete d put pu write w
89 file f read re yank ya
90 global g recover rec \fIwindow\fP z
91 insert i rewind rew \fIescape\fP !
92 join j set se \fIlshift\fP <
93 list l shell sh \fIprint next\fP \fRCR\fP
94 map source so \fIresubst\fP &
95 mark ma stop st \fIrshift\fP >
96 move m substitute s \fIscroll\fP ^D
98 .h "Ex command addresses"
100 lw(.3i)b lw(0.8i) lw(.3i)b lw(0.8i).
101 \fIn\fP line \fIn\fP /\fIpat\fP next with \fIpat\fP
102 \&. current ?\fIpat\fP previous with \fIpat\fP
103 $ last \fIx\fP-\fIn\fP \fIn\fP before \fIx\fP
104 + next \fIx\fP,\fIy\fP \fIx\fP through \fIy\fP
105 \- previous \(aa\fIx\fP marked with \fIx\fP
106 +\fIn\fP \fIn\fP forward \(aa\(aa previous context
110 .h "Specifying terminal type"
113 % setenv TERM \fItype\fP \fIcsh\fP and all version 6
114 $ TERM=\fItype\fP; export TERM \fIsh\fP in Version 7
115 See also \fItset\fR(1)
117 .h "Some terminal types"
119 lw(.4i) lw(.4i) lw(.4i) lw(.4i) lw(.4i).
120 2621 43 adm31 dw1 h19
121 2645 733 adm3a dw2 i100
122 300s 745 c100 gt40 mime
123 33 act4 dm1520 gt42 owl
124 37 act5 dm2500 h1500 t1061
125 4014 adm3 dm3025 h1510 vt52
127 .h "Initializing options"
130 EXINIT place \fBset\fP's here in environment var.
131 set \fIx\fP enable option
132 set no\fIx\fP disable option
133 set \fIx\fP=\fIval\fP give value \fIval\fP
134 set show changed options
135 set all show all options
136 set \fIx\fP? show value of option \fIx\fP
140 lw(.9i)b lw(.3i) lw(1.0i).
141 autoindent ai supply indent
142 autowrite aw write before changing files
143 ignorecase ic in scanning
144 lisp \fB( ) { }\fP are s-exp's
145 list print ^I for tab, $ at end
146 magic \fB. [ *\fP special in patterns
147 number nu number lines
148 paragraphs para macro names which start ...
149 redraw simulate smart terminal
150 scroll command mode lines
151 sections sect macro names ...
152 shiftwidth sw for \fB< >\fP, and input \fB^D\fP
153 showmatch sm to \fB)\fP and \fB}\fP as typed
154 slowopen slow choke updates during insert
155 window visual mode lines
156 wrapscan ws around end of buffer?
157 wrapmargin wm automatic line splitting
160 .h "Scanning pattern formation"
163 \(ua beginning of line
165 \fB.\fR any character
166 \e< beginning of word
168 [\fIstr\fP] any char in \fIstr\fP
169 [\(ua\fIstr\fP] ... not in \fIstr\fP
170 [\fIx\-y\fP] ... between \fIx\fP and \fIy\fP
171 * any number of preceding
184 .h "Entering/leaving vi"
187 % vi \fIname\fP edit \fIname\fP at top
188 % vi +\fIn\fP \fIname\fP ... at line \fIn\fP
189 % vi + \fIname\fP ... at end
190 % vi \-r list saved files
191 % vi \-r \fIname\fP recover file \fIname\fP
192 % vi \fIname\fP ... edit first; rest via \fB:n\fP
193 % vi \-t \fItag\fP start at \fItag\fP
194 % vi +/\fIpat\fP \fIname\fP search for \fIpat\fP
195 % view \fIname\fP read only mode
196 ZZ exit from vi, saving changes
197 ^Z stop vi for later resumption
203 Error messages, echoing input to \fB: / ?\fP and \fB!\fR,
204 feedback about i/o and large changes.
206 @ lines On screen only, not in file.
207 ~ lines Lines past end of file.
208 ^\fIx\fP Control characters, ^? is delete.
209 tabs Expand to spaces, cursor at last.
216 Normal and initial state. Others return here.
217 ESC (escape) cancels partial command.
220 Entered by \fBa i A I o O c C s S\fP \fBR\fP.
221 Arbitrary text then terminates with ESC character,
222 or abnormally with interrupt.
225 Reading input for \fB: / ?\fP or \fB!\fP; terminate
226 with ESC or CR to execute, interrupt to cancel.
229 .h "Counts before vi commands"
232 line/column number z G |
234 replicate insert a i A I
235 repeat effect \fRmost rest\fP
241 de ... leaving punctuation
244 i\fItext\fP\fRESC\fP insert text \fIabc\fP
245 cw\fInew\fP\fRESC\fP change word to \fInew\fP
246 ea\fIs\fP\fRESC\fP pluralize word
247 xp transpose characters
250 .h "Interrupting, cancelling"
253 ESC end insert or incomplete cmd
254 ^? (delete or rubout) interrupts
255 ^L reprint screen if \fB^?\fR scrambles it
257 .h "File manipulation"
260 :w write back changes
263 :q! quit, discard changes
264 :e \fIname\fP edit file \fIname\fP
265 :e! reedit, discard changes
266 :e + \fIname\fP edit, starting at end
267 :e +\fIn\fR edit starting at line \fIn\fR
268 :e # edit alternate file
269 ^\(ua synonym for \fB:e #\fP
270 :w \fIname\fP write file \fIname\fP
271 :w! \fIname\fP overwrite file \fIname\fP
272 :sh run shell, then return
273 :!\fIcmd\fP run \fIcmd\fR, then return
274 :n edit next file in arglist
275 :n \fIargs\fP specify new arglist
276 :f show current file and line
277 ^G synonym for \fB:f\fP
278 :ta \fItag\fP to tag file entry \fItag\fP
279 ^] \fB:ta\fP, following word is \fItag\fP
281 .h "Positioning within file"
284 ^F forward screenfull
285 ^B backward screenfull
286 ^D scroll down half screen
287 ^U scroll up half screen
288 G goto line (end default)
289 /\fIpat\fR next line matching \fIpat\fR
290 ?\fIpat\fR prev line matching \fIpat\fR
291 n repeat last \fB/\fR or \fB?\fR
292 N reverse last \fB/\fR or \fB?\fR
293 /\fIpat\fP/+\fIn\fP n'th line after \fIpat\fR
294 ?\fIpat\fP?\-\fIn\fP n'th line before \fIpat\fR
295 ]] next section/function
296 [[ previous section/function
297 % find matching \fB( ) {\fP or \fB}\fP
299 .h "Adjusting the screen"
303 ^R retype, eliminate @ lines
304 z\fRCR\fP redraw, current at window top
307 /\fIpat\fP/z\- \fIpat\fP line at bottom
308 z\fIn\fP\|. use \fIn\fP line window
309 ^E scroll window down 1 line
310 ^Y scroll window up 1 line
313 .h "Marking and returning
316 \(ga\(ga previous context
317 \(aa\(aa ... at first non-white in line
318 m\fIx\fP mark position with letter \fIx\fP
319 \(ga\fIx\fP to mark \fIx\fP
320 \(aa\fIx\fP ... at first non-white in line
322 .h "Line positioning"
328 + next line, at first non-white
329 \- previous line, at first non-white
330 \fRCR\fP return, same as +
331 \(da \fRor\fP j next line, same column
332 \(ua \fRor\fP k previous line, same column
334 .h "Character positioning"
340 h \fRor\fP \(-> forward
341 l \fRor\fP \(<- backwards
342 ^H same as \fB\(<-\fP
343 \fRspace\fP same as \fB\(->\fP
344 f\fIx\fP find \fIx\fP forward
345 F\fIx\fP \fBf\fR backward
346 t\fIx\fP upto \fIx\fP forward
347 T\fIx\fP back upto \fIx\fP
348 ; repeat last \fBf F t\fP or \fBT\fP
350 | to specified column
351 % find matching \fB( { )\fP or \fB}\fR
353 .h "Words, sentences, paragraphs"
363 W blank delimited word
367 .h "Commands for \s-2LISP\s0"
370 ) Forward s-expression
371 } ... but don't stop at atoms
373 { ... but don't stop at atoms
376 .h "Corrections during insert"
379 ^H erase last character
381 \fRerase\fP your erase, same as \fB^H\fP
382 \fRkill\fP your kill, erase input this line
383 \e escapes \fB^H\fR, your erase and kill
384 \fRESC\fP ends insertion, back to command
385 ^? interrupt, terminates insert
386 ^D backtab over \fIautoindent\fP
387 \(ua^D kill \fIautoindent\fP, save for next
388 0^D ... but at margin next also
389 ^V quote non-printing character
391 .h "Insert and replace"
394 a append after cursor
396 A append at end of line
397 I insert before first non-blank
400 r\fIx\fP replace single char with \fIx\fP
403 .h "Operators (double to affect lines)"
410 ! filter through command
411 \&= indent for \s-2LISP\s0
412 y yank lines to buffer
414 .h "Miscellaneous operations"
417 C change rest of line
418 D delete rest of line
431 "\fIx\fPp put from buffer \fIx\fP
432 "\fIx\fPy yank to buffer \fIx\fP
433 "\fIx\fPd delete into buffer \fIx\fP
435 .h "Undo, redo, retrieve"
439 U restore current line
440 \fB.\fP repeat last change
441 "\fId\fP\|p retrieve \fId\fP'th last delete