.\" Copyright (c) 1980 The Regents of the University of California.
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" @(#)vi.summary 6.3 (Berkeley) 4/17/91
% ex \fIname\fP edit \fIname\fP, start at end
% ex +\fIn\fP \fIname\fP ... at line \fIn\fP
% ex \-t \fItag\fP start at \fItag\fP
% ex \-r list saved files
% ex \-r \fIname\fP recover file \fIname\fP
% ex \fIname\fP ... edit first; rest via \fB:n\fP
% ex \-R \fIname\fP read only mode
: q! exit, discarding changes
Normal and initial state. Input prompted for by \fB:\fP.
Your kill character cancels partial command.
Entered by \fBa\fP \fBi\fP and \fBc\fP.
Arbitrary text then terminates with line having only \fB.\fP
character on it or abnormally with interrupt.
Entered by \fBopen\fP or \fBvi\fP, terminates with \fBQ\fP
lw(.45i) lw(.08i)b lw(.45i) lw(.08i)b lw(.45i) lw(.08i)b.
abbrev ab next n unabbrev una
append a number nu undo u
change c preserve pre version ve
copy co print p visual vi
global g recover rec \fIwindow\fP z
insert i rewind rew \fIescape\fP !
join j set se \fIlshift\fP <
list l shell sh \fIprint next\fP \fRCR\fP
map source so \fIresubst\fP &
mark ma stop st \fIrshift\fP >
move m substitute s \fIscroll\fP ^D
.h "Ex command addresses"
lw(.3i)b lw(0.8i) lw(.3i)b lw(0.8i).
\fIn\fP line \fIn\fP /\fIpat\fP next with \fIpat\fP
\&. current ?\fIpat\fP previous with \fIpat\fP
$ last \fIx\fP-\fIn\fP \fIn\fP before \fIx\fP
+ next \fIx\fP,\fIy\fP \fIx\fP through \fIy\fP
\- previous \(aa\fIx\fP marked with \fIx\fP
+\fIn\fP \fIn\fP forward \(aa\(aa previous context
.h "Specifying terminal type"
% setenv TERM \fItype\fP \fIcsh\fP and all version 6
$ TERM=\fItype\fP; export TERM \fIsh\fP in Version 7
lw(.4i) lw(.4i) lw(.4i) lw(.4i) lw(.4i).
37 act5 dm2500 h1500 t1061
4014 adm3 dm3025 h1510 vt52
.h "Initializing options"
EXINIT place \fBset\fP's here in environment var.
set \fIx\fP enable option
set no\fIx\fP disable option
set \fIx\fP=\fIval\fP give value \fIval\fP
set \fIx\fP? show value of option \fIx\fP
lw(.9i)b lw(.3i) lw(1.0i).
autoindent ai supply indent
autowrite aw write before changing files
ignorecase ic in scanning
lisp \fB( ) { }\fP are s-exp's
list print ^I for tab, $ at end
magic \fB. [ *\fP special in patterns
paragraphs para macro names which start ...
redraw simulate smart terminal
scroll command mode lines
sections sect macro names ...
shiftwidth sw for \fB< >\fP, and input \fB^D\fP
showmatch sm to \fB)\fP and \fB}\fP as typed
slowopen slow choke updates during insert
wrapscan ws around end of buffer?
wrapmargin wm automatic line splitting
.h "Scanning pattern formation"
[\fIstr\fP] any char in \fIstr\fP
[\(ua\fIstr\fP] ... not in \fIstr\fP
[\fIx\-y\fP] ... between \fIx\fP and \fIy\fP
* any number of preceding
% vi \fIname\fP edit \fIname\fP at top
% vi +\fIn\fP \fIname\fP ... at line \fIn\fP
% vi + \fIname\fP ... at end
% vi \-r list saved files
% vi \-r \fIname\fP recover file \fIname\fP
% vi \fIname\fP ... edit first; rest via \fB:n\fP
% vi \-t \fItag\fP start at \fItag\fP
% vi +/\fIpat\fP \fIname\fP search for \fIpat\fP
% view \fIname\fP read only mode
ZZ exit from vi, saving changes
^Z stop vi for later resumption
Error messages, echoing input to \fB: / ?\fP and \fB!\fR,
feedback about i/o and large changes.
@ lines On screen only, not in file.
~ lines Lines past end of file.
^\fIx\fP Control characters, ^? is delete.
tabs Expand to spaces, cursor at last.
Normal and initial state. Others return here.
ESC (escape) cancels partial command.
Entered by \fBa i A I o O c C s S\fP \fBR\fP.
Arbitrary text then terminates with ESC character,
or abnormally with interrupt.
Reading input for \fB: / ?\fP or \fB!\fP; terminate
with ESC or CR to execute, interrupt to cancel.
.h "Counts before vi commands"
repeat effect \fRmost rest\fP
de ... leaving punctuation
i\fItext\fP\fRESC\fP insert text \fIabc\fP
cw\fInew\fP\fRESC\fP change word to \fInew\fP
ea\fIs\fP\fRESC\fP pluralize word
.h "Interrupting, cancelling"
ESC end insert or incomplete cmd
^? (delete or rubout) interrupts
^L reprint screen if \fB^?\fR scrambles it
:q! quit, discard changes
:e \fIname\fP edit file \fIname\fP
:e! reedit, discard changes
:e + \fIname\fP edit, starting at end
:e +\fIn\fR edit starting at line \fIn\fR
^\(ua synonym for \fB:e #\fP
:w \fIname\fP write file \fIname\fP
:w! \fIname\fP overwrite file \fIname\fP
:sh run shell, then return
:!\fIcmd\fP run \fIcmd\fR, then return
:n edit next file in arglist
:n \fIargs\fP specify new arglist
:f show current file and line
:ta \fItag\fP to tag file entry \fItag\fP
^] \fB:ta\fP, following word is \fItag\fP
.h "Positioning within file"
^D scroll down half screen
G goto line (end default)
/\fIpat\fR next line matching \fIpat\fR
?\fIpat\fR prev line matching \fIpat\fR
n repeat last \fB/\fR or \fB?\fR
N reverse last \fB/\fR or \fB?\fR
/\fIpat\fP/+\fIn\fP n'th line after \fIpat\fR
?\fIpat\fP?\-\fIn\fP n'th line before \fIpat\fR
[[ previous section/function
% find matching \fB( ) {\fP or \fB}\fP
.h "Adjusting the screen"
^R retype, eliminate @ lines
z\fRCR\fP redraw, current at window top
/\fIpat\fP/z\- \fIpat\fP line at bottom
z\fIn\fP\|. use \fIn\fP line window
^E scroll window down 1 line
^Y scroll window up 1 line
.h "Marking and returning
\(ga\(ga previous context
\(aa\(aa ... at first non-white in line
m\fIx\fP mark position with letter \fIx\fP
\(ga\fIx\fP to mark \fIx\fP
\(aa\fIx\fP ... at first non-white in line
+ next line, at first non-white
\- previous line, at first non-white
\fRCR\fP return, same as +
\(da \fRor\fP j next line, same column
\(ua \fRor\fP k previous line, same column
.h "Character positioning"
l \fRor\fP \(<- backwards
\fRspace\fP same as \fB\(->\fP
f\fIx\fP find \fIx\fP forward
F\fIx\fP \fBf\fR backward
t\fIx\fP upto \fIx\fP forward
T\fIx\fP back upto \fIx\fP
; repeat last \fBf F t\fP or \fBT\fP
% find matching \fB( { )\fP or \fB}\fR
.h "Words, sentences, paragraphs"
.h "Commands for \s-2LISP\s0"
} ... but don't stop at atoms
{ ... but don't stop at atoms
.h "Corrections during insert"
\fRerase\fP your erase, same as \fB^H\fP
\fRkill\fP your kill, erase input this line
\e escapes \fB^H\fR, your erase and kill
\fRESC\fP ends insertion, back to command
^? interrupt, terminates insert
^D backtab over \fIautoindent\fP
\(ua^D kill \fIautoindent\fP, save for next
0^D ... but at margin next also
^V quote non-printing character
I insert before first non-blank
r\fIx\fP replace single char with \fIx\fP
.h "Operators (double to affect lines)"
\&\= indent for \s-2LISP\s0
.h "Miscellaneous operations"
"\fIx\fPp put from buffer \fIx\fP
"\fIx\fPy yank to buffer \fIx\fP
"\fIx\fPd delete into buffer \fIx\fP
.h "Undo, redo, retrieve"
\fB.\fP repeat last change
"\fId\fP\|p retrieve \fId\fP'th last delete