BSD 4_4_Lite2 release
[unix-history] / usr / src / usr.bin / ex / vi.1
index 9e5baa2..e35b429 100644 (file)
-.\" Copyright (c) 1980 The Regents of the University of California.
-.\" All rights reserved.
+.\" Copyright (c) 1980, 1991, 1993
+.\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\"
-.\" %sccs.include.proprietary.roff%
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 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.
 .\"
 .\"
-.\"    @(#)vi.1        6.2 (Berkeley) %G%
+.\" 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
+.\" SUCH DAMAGE.
 .\"
 .\"
-.TH VI 1 ""
-.UC
-.SH NAME
-vi \- screen oriented (visual) display editor based on ex
-.SH SYNOPSIS
-.B vi
-[
-.B \-t
-tag
-] [
-.B \-r
-] [
-\fB+\fR\fIcommand\fR
-] [
-.B \-l
-] [
-\fB\-w\fIn\fR
-]
-name ...
-.SH DESCRIPTION
-.I Vi
+.\"     @(#)vi.1       8.2 (Berkeley) 12/30/93
+.\"
+.Dd December 30, 1993
+.Dt VI 1
+.Os BSD 3
+.Sh NAME
+.Nm \&vi , view
+.Nd screen oriented (visual) display editor based on ex
+.Sh SYNOPSIS
+.Nm \&vi
+.Op Fl R
+.Op Fl l
+.Op Fl r
+.Op Fl t Ar tag
+.Op Fl w Ar n
+.Op Cm \&+ Ns Ar command
+.Ar name ...
+.Sh DESCRIPTION
+.Nm \&Vi
 (visual) is a display oriented text editor based on
 (visual) is a display oriented text editor based on
-.IR ex (1).
-.Ex
+.Xr \&ex 1 .
+.Xr \&Ex
 and
 and
-.vi
+.Nm \&vi
 run the same code; it is possible to get to
 the command mode of
 run the same code; it is possible to get to
 the command mode of
-.ex
+.Xr \&ex
 from within
 from within
-.vi
+.Nm \&vi
 and vice-versa.
 and vice-versa.
-.PP
+.Pp
+.Nm View
+is the same as
+.Dq "vi -R" ,
+e.g. run in read-only mode.
+.Pp
+Available options:
+.Bl -tag -width xcommandx
+.It Fl R
+Read only. Changes to the file may not be written out.
+.It Fl l
+Sets options for editing
+.Tn LISP
+source (options
+.Ic showmatch
+and
+.Ic lisp ) .
+.It Fl r
+In the event of an editor or system crash, the
+.Fl r
+option will retrieve the last saved version of the
+specified file, or if no file is specified,
+a list of saved files is printed.
+.It Fl t Ar tag
+If tags are used (see
+.Xr ctags 1 )
+the editor is positioned at
+.Ar tag .
+.It Fl w Ns Ar n
+The default window size is set to
+.Ar n .
+.It Cm \&+ Ns Ar command
+Enter the file with
+.Ar command.
+Useful for
+positioning on a string or line number.
+.El
+.Pp
 The
 The
-.I "Vi Quick Reference"
+.%T "Vi Quick Reference"
 card and the
 card and the
-.I "Introduction to Display Editing with Vi"
+.%T "Introduction to Display Editing with Vi"
 provide full details on using
 provide full details on using
-.I vi.
-.SH FILES
-See
-.IR ex (1).
-.SH SEE ALSO
-ex (1), edit (1), ``Vi Quick Reference'' card,
-``An Introduction to Display Editing with Vi''.
-.SH AUTHOR
-William Joy
-.br
-Mark Horton added macros to \fIvisual\fR mode and is maintaining version 3
-.SH BUGS
-Software tabs using \fB^T\fR work only immediately after the
-.I autoindent.
-.PP
+.Nm \&vi .
+.Sh ENVIRONMENT
+The
+.Nm
+command uses the following environment variables.
+.Bl -tag -width Fl
+.It Ev EXINIT
+User specified startup values for
+.Xr \&ex
+and
+.Nm \&vi .
+Usually specified in the file
+.Pa ~/.exrc
+.It Ev HOME
+Default directory to search for
+the file
+.Pa ~/.exrc
+.It Ev SHELL
+Shell used for
+.Em escaped
+commands (with the
+.Xr \&ex
+.Ic \&:!
+command).
+.It Ev TERM
+Terminal type used to lookup terminal capabilities from the
+file
+.Pa /usr/share/misc/termcap .
+.It Ev TERMCAP
+If set, specifies an alternate termcap file.
+.El
+.Sh FILES
+.Bl -tag -width /usr/libexec/ex?.?preserve -compact
+.It Pa  /usr/libexec/ex?.?strings
+error messages
+.It Pa  /usr/libexec/ex?.?recover
+recover command
+.It Pa  /usr/libexec/ex?.?preserve
+preserve command
+.It Pa  /usr/share/misc/termcap
+describes capabilities of terminals
+.It Pa  ~/.exrc
+editor startup file
+.It Pa /tmp/Ex Ns Em nnnnn
+editor temporary
+.It Pa /tmp/Rx Ns Em nnnnn
+named buffer temporary
+.It Pa /var/preserve
+preservation directory
+.El
+.Sh SEE ALSO
+.Xr awk 1 ,
+.Xr \&ed 1 ,
+.Xr grep 1 ,
+.Xr sed 1 ,
+.Xr grep 1 ,
+.Xr \&vi 1 ,
+.Xr termcap 5 ,
+.Xr environ 7
+.Rs
+.%T "Vi Quick Reference Card"
+.Re
+.Rs
+.%T "An Introduction to Display Editing with Vi"
+.Re
+.Sh BUGS
+Software tabs using
+.Sy \&^T
+work only immediately after the
+.Ic autoindent .
+.Pp
 Left and right shifts on intelligent terminals don't make use of
 insert and delete character operations in the terminal.
 Left and right shifts on intelligent terminals don't make use of
 insert and delete character operations in the terminal.
-.PP
+.Pp
 The
 The
-.I wrapmargin
+.Ic wrapmargin
 option can be fooled since it looks at output columns when blanks are typed.
 If a long word passes through the margin and onto the next line without a 
 break, then the line won't be broken.
 option can be fooled since it looks at output columns when blanks are typed.
 If a long word passes through the margin and onto the next line without a 
 break, then the line won't be broken.
-.PP
+.Pp
 Insert/delete within a line can be slow if tabs are present on intelligent
 terminals, since the terminals need help in doing this correctly.
 Insert/delete within a line can be slow if tabs are present on intelligent
 terminals, since the terminals need help in doing this correctly.
-.PP
+.Pp
 Saving text on deletes in the named buffers is somewhat inefficient.
 Saving text on deletes in the named buffers is somewhat inefficient.
-.PP
+.Pp
 The
 The
-.I source
-command does not work when executed as \fB:source\fR;
-there is no way to use the \fB:append\fR, \fB:change\fR,
-and \fB:insert\fR commands, since it is not possible to give
-more than one line of input to a \fB:\fR escape.  To use these
-on a \fB:global\fR you must \fBQ\fR to \fIex\fR command mode,
+.Ic source
+command does not work when executed as
+.Ic :source ;
+there is no way to use the
+.Ic :append ,
+.Ic :change ,
+and
+.Ic :insert
+commands, since it is not possible to give
+more than one line of input to a
+.Ic \&:
+escape.  To use these
+on a
+.Ic :global
+you must
+.Ic Q
+to
+.Xr \&ex
+command mode,
 execute them, and then reenter the screen editor with
 execute them, and then reenter the screen editor with
-.vi
+.Nm \&vi
 or
 or
-.I open.
+.Ic open .
+.Sh HISTORY
+The
+.Nm \&vi
+command appeared in
+.Bx 3.0 .