1 .\" Copyright (c) 1980, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)vi.summary 8.3 (Berkeley) 8/18/96
75 .h "Entering/leaving ex"
78 % ex \fIname\fP edit \fIname\fP, start at end
79 % ex +\fIn\fP \fIname\fP ... at line \fIn\fP
80 % ex \-t \fItag\fP start at \fItag\fP
81 % ex \-r list saved files
82 % ex \-r \fIname\fP recover file \fIname\fP
83 % ex \fIname\fP ... edit first; rest via \fB:n\fP
84 % ex \-R \fIname\fP read only mode
85 : x exit, saving changes
86 : q! exit, discarding changes
92 Normal and initial state. Input prompted for by \fB:\fP.
93 Your kill character cancels partial command.
96 Entered by \fBa\fP \fBi\fP and \fBc\fP.
97 Arbitrary text then terminates with line having only \fB.\fP
98 character on it or abnormally with interrupt.
101 Entered by \fBopen\fP or \fBvi\fP, terminates with \fBQ\fP
107 lw(.45i) lw(.08i)b lw(.45i) lw(.08i)b lw(.45i) lw(.08i)b.
108 abbrev ab next n unabbrev una
109 append a number nu undo u
110 args ar open o unmap unm
111 change c preserve pre version ve
112 copy co print p visual vi
113 delete d put pu write w
115 file f read re yank ya
116 global g recover rec \fIwindow\fP z
117 insert i rewind rew \fIescape\fP !
118 join j set se \fIlshift\fP <
119 list l shell sh \fIprint next\fP \fRCR\fP
120 map source so \fIresubst\fP &
121 mark ma stop st \fIrshift\fP >
122 move m substitute s \fIscroll\fP ^D
124 .h "Ex command addresses"
126 lw(.3i)b lw(0.8i) lw(.3i)b lw(0.8i).
127 \fIn\fP line \fIn\fP /\fIpat\fP next with \fIpat\fP
128 \&. current ?\fIpat\fP previous with \fIpat\fP
129 $ last \fIx\fP-\fIn\fP \fIn\fP before \fIx\fP
130 + next \fIx\fP,\fIy\fP \fIx\fP through \fIy\fP
131 \- previous \(aa\fIx\fP marked with \fIx\fP
132 +\fIn\fP \fIn\fP forward \(aa\(aa previous context
136 .h "Specifying terminal type"
139 % setenv TERM \fItype\fP \fIcsh\fP and all version 6
140 $ TERM=\fItype\fP; export TERM \fIsh\fP in Version 7
141 See also \fItset\fR(1)
143 .h "Some terminal types"
145 lw(.4i) lw(.4i) lw(.4i) lw(.4i) lw(.4i).
146 2621 43 adm31 dw1 h19
147 2645 733 adm3a dw2 i100
148 300s 745 c100 gt40 mime
149 33 act4 dm1520 gt42 owl
150 37 act5 dm2500 h1500 t1061
151 4014 adm3 dm3025 h1510 vt52
153 .h "Initializing options"
156 EXINIT place \fBset\fP's here in environment var.
157 set \fIx\fP enable option
158 set no\fIx\fP disable option
159 set \fIx\fP=\fIval\fP give value \fIval\fP
160 set show changed options
161 set all show all options
162 set \fIx\fP? show value of option \fIx\fP
166 lw(.9i)b lw(.3i) lw(1.0i).
167 autoindent ai supply indent
168 autowrite aw write before changing files
169 ignorecase ic in scanning
170 lisp \fB( ) { }\fP are s-exp's
171 list print ^I for tab, $ at end
172 magic \fB. [ *\fP special in patterns
173 number nu number lines
174 paragraphs para macro names which start ...
175 redraw simulate smart terminal
176 scroll command mode lines
177 sections sect macro names ...
178 shiftwidth sw for \fB< >\fP, and input \fB^D\fP
179 showmatch sm to \fB)\fP and \fB}\fP as typed
180 slowopen slow choke updates during insert
181 window visual mode lines
182 wrapscan ws around end of buffer?
183 wrapmargin wm automatic line splitting
186 .h "Scanning pattern formation"
189 \(ua beginning of line
191 \fB.\fR any character
192 \e< beginning of word
194 [\fIstr\fP] any char in \fIstr\fP
195 [\(ua\fIstr\fP] ... not in \fIstr\fP
196 [\fIx\-y\fP] ... between \fIx\fP and \fIy\fP
197 * any number of preceding
210 .h "Entering/leaving vi"
213 % vi \fIname\fP edit \fIname\fP at top
214 % vi +\fIn\fP \fIname\fP ... at line \fIn\fP
215 % vi + \fIname\fP ... at end
216 % vi \-r list saved files
217 % vi \-r \fIname\fP recover file \fIname\fP
218 % vi \fIname\fP ... edit first; rest via \fB:n\fP
219 % vi \-t \fItag\fP start at \fItag\fP
220 % vi +/\fIpat\fP \fIname\fP search for \fIpat\fP
221 % view \fIname\fP read only mode
222 ZZ exit from vi, saving changes
223 ^Z stop vi for later resumption
229 Error messages, echoing input to \fB: / ?\fP and \fB!\fR,
230 feedback about i/o and large changes.
232 @ lines On screen only, not in file.
233 ~ lines Lines past end of file.
234 ^\fIx\fP Control characters, ^? is delete.
235 tabs Expand to spaces, cursor at last.
242 Normal and initial state. Others return here.
243 ESC (escape) cancels partial command.
246 Entered by \fBa i A I o O c C s S\fP \fBR\fP.
247 Arbitrary text then terminates with ESC character,
248 or abnormally with interrupt.
251 Reading input for \fB: / ?\fP or \fB!\fP; terminate
252 with ESC or CR to execute, interrupt to cancel.
255 .h "Counts before vi commands"
258 line/column number z G |
260 replicate insert a i A I
261 repeat effect \fRmost rest\fP
267 de ... leaving punctuation
270 i\fItext\fP\fRESC\fP insert text \fIabc\fP
271 cw\fInew\fP\fRESC\fP change word to \fInew\fP
272 ea\fIs\fP\fRESC\fP pluralize word
273 xp transpose characters
276 .h "Interrupting, cancelling"
279 ESC end insert or incomplete cmd
280 ^? (delete or rubout) interrupts
281 ^L reprint screen if \fB^?\fR scrambles it
283 .h "File manipulation"
286 :w write back changes
289 :q! quit, discard changes
290 :e \fIname\fP edit file \fIname\fP
291 :e! reedit, discard changes
292 :e + \fIname\fP edit, starting at end
293 :e +\fIn\fR edit starting at line \fIn\fR
294 :e # edit alternate file
295 ^\(ua synonym for \fB:e #\fP
296 :w \fIname\fP write file \fIname\fP
297 :w! \fIname\fP overwrite file \fIname\fP
298 :sh run shell, then return
299 :!\fIcmd\fP run \fIcmd\fR, then return
300 :n edit next file in arglist
301 :n \fIargs\fP specify new arglist
302 :f show current file and line
303 ^G synonym for \fB:f\fP
304 :ta \fItag\fP to tag file entry \fItag\fP
305 ^] \fB:ta\fP, following word is \fItag\fP
307 .h "Positioning within file"
310 ^F forward screenfull
311 ^B backward screenfull
312 ^D scroll down half screen
313 ^U scroll up half screen
314 G goto line (end default)
315 /\fIpat\fR next line matching \fIpat\fR
316 ?\fIpat\fR prev line matching \fIpat\fR
317 n repeat last \fB/\fR or \fB?\fR
318 N reverse last \fB/\fR or \fB?\fR
319 /\fIpat\fP/+\fIn\fP n'th line after \fIpat\fR
320 ?\fIpat\fP?\-\fIn\fP n'th line before \fIpat\fR
321 ]] next section/function
322 [[ previous section/function
323 % find matching \fB( ) {\fP or \fB}\fP
325 .h "Adjusting the screen"
329 ^R retype, eliminate @ lines
330 z\fRCR\fP redraw, current at window top
333 /\fIpat\fP/z\- \fIpat\fP line at bottom
334 z\fIn\fP\|. use \fIn\fP line window
335 ^E scroll window down 1 line
336 ^Y scroll window up 1 line
339 .h "Marking and returning
342 \(ga\(ga previous context
343 \(aa\(aa ... at first non-white in line
344 m\fIx\fP mark position with letter \fIx\fP
345 \(ga\fIx\fP to mark \fIx\fP
346 \(aa\fIx\fP ... at first non-white in line
348 .h "Line positioning"
354 + next line, at first non-white
355 \- previous line, at first non-white
356 \fRCR\fP return, same as +
357 \(da \fRor\fP j next line, same column
358 \(ua \fRor\fP k previous line, same column
360 .h "Character positioning"
366 h \fRor\fP \(-> forward
367 l \fRor\fP \(<- backwards
368 ^H same as \fB\(<-\fP
369 \fRspace\fP same as \fB\(->\fP
370 f\fIx\fP find \fIx\fP forward
371 F\fIx\fP \fBf\fR backward
372 t\fIx\fP upto \fIx\fP forward
373 T\fIx\fP back upto \fIx\fP
374 ; repeat last \fBf F t\fP or \fBT\fP
376 | to specified column
377 % find matching \fB( { )\fP or \fB}\fR
379 .h "Words, sentences, paragraphs"
389 W blank delimited word
393 .h "Commands for \s-2LISP\s0"
396 ) Forward s-expression
397 } ... but don't stop at atoms
399 { ... but don't stop at atoms
402 .h "Corrections during insert"
405 ^H erase last character
407 \fRerase\fP your erase, same as \fB^H\fP
408 \fRkill\fP your kill, erase input this line
409 \e escapes \fB^H\fR, your erase and kill
410 \fRESC\fP ends insertion, back to command
411 ^? interrupt, terminates insert
412 ^D backtab over \fIautoindent\fP
413 \(ua^D kill \fIautoindent\fP, save for next
414 0^D ... but at margin next also
415 ^V quote non-printing character
417 .h "Insert and replace"
420 a append after cursor
422 A append at end of line
423 I insert before first non-blank
426 r\fIx\fP replace single char with \fIx\fP
429 .h "Operators (double to affect lines)"
436 ! filter through command
437 \&= indent for \s-2LISP\s0
438 y yank lines to buffer
440 .h "Miscellaneous operations"
443 C change rest of line
444 D delete rest of line
457 "\fIx\fPp put from buffer \fIx\fP
458 "\fIx\fPy yank to buffer \fIx\fP
459 "\fIx\fPd delete into buffer \fIx\fP
461 .h "Undo, redo, retrieve"
465 U restore current line
466 \fB.\fP repeat last change
467 "\fId\fP\|p retrieve \fId\fP'th last delete