Release 6
[unix-history] / usr / src / usr.bin / ex / vi.1
CommitLineData
d59640d6 1.\" Copyright (c) 1980, 1991 Regents of the University of California.
2791ff57 2.\" All rights reserved.
25df5839 3.\"
d59640d6 4.\" %sccs.include.redist.roff%
2791ff57 5.\"
a8a72574 6.\" @(#)vi.1 6.4 (Berkeley) %G%
25df5839 7.\"
d59640d6
CL
8.Dd
9.Dt VI 1
10.Os BSD 3
11.Sh NAME
a8a72574 12.Nm \&vi
d59640d6
CL
13.Nd screen oriented (visual) display editor based on ex
14.Sh SYNOPSIS
a8a72574 15.Nm \&vi
d59640d6
CL
16.Op Fl R
17.Op Fl l
18.Op Fl r
19.Op Fl t Ar tag
20.Op Fl w Ar n
21.Op Cm \&+ Ns Ar command
22.Ar name ...
23.Sh DESCRIPTION
a8a72574 24.Nm \&Vi
25df5839 25(visual) is a display oriented text editor based on
a8a72574 26.Xr \&ex 1 .
d59640d6 27.Xr \&Ex
25df5839 28and
a8a72574 29.Nm \&vi
25df5839
KM
30run the same code; it is possible to get to
31the command mode of
a8a72574 32.Xr \&ex
25df5839 33from within
a8a72574 34.Nm \&vi
25df5839 35and vice-versa.
d59640d6
CL
36.Pp
37Available options:
38.Bl -tag -width xcommandx
39.It Fl R
40Read only. Changes to the file may not be written out.
41.It Fl l
42Sets options for editing
43.Tn LISP
44source (options
45.Ic showmatch
46and
47.Ic lisp ) .
48.It Fl r
49In the event of an editor or system crash, the
50.Fl r
51option will retrieve the last saved version of the
52specified file, or if no file is specified,
53a list of saved files is printed.
54.It Fl t Ar tag
55If tags are used (see
56.Xr ctags 1 )
57the editor is postioned at
58.Ar tag .
59.It Fl w Ns Ar n
60The default window size is set to
61.Ar n .
62.It Cm \&+ Ns Ar command
63Enter the file with
64.Ar command.
65Useful for
66positioning on a string or line number.
67.El
68.Pp
25df5839 69The
d59640d6 70.%T "Vi Quick Reference"
25df5839 71card and the
d59640d6 72.%T "Introduction to Display Editing with Vi"
25df5839 73provide full details on using
a8a72574 74.Nm \&vi .
d59640d6
CL
75.Sh ENVIRONMENT
76The
77.Nm
78command uses the following environment variables.
79.Bl -tag -width Fl
80.It Ev EXINIT
81User specified startup values for
a8a72574 82.Xr \&ex
d59640d6 83and
a8a72574 84.Nm \&vi .
d59640d6
CL
85Usually specified in the file
86.Pa ~/.exrc
87.It Ev HOME
88Default directory to search for
89the file
90.Pa ~/.exrc
91.It Ev SHELL
92Shell used for
93.Em escaped
94commands (with the
a8a72574 95.Xr \&ex
d59640d6
CL
96.Ic \&:!
97command).
98.It Ev TERM
99Terminal type used to lookup terminal capabilities from the
100file
101.Pa /usr/share/misc/termcap .
102.It Ev TERMCAP
103If set, specifies an alternate termcap file.
104.El
105.Sh FILES
106.Bl -tag -width /usr/libexec/ex?.?preserve -compact
107.It Pa /usr/libexec/ex?.?strings
108error messages
109.It Pa /usr/libexec/ex?.?recover
110recover command
111.It Pa /usr/libexec/ex?.?preserve
112preserve command
113.It Pa /usr/share/misc/termcap
114describes capabilities of terminals
115.It Pa ~/.exrc
116editor startup file
a8a72574 117.It Pa /tmp/Ex Ns Em nnnnn
d59640d6 118editor temporary
a8a72574 119.It Pa /tmp/Rx Ns Em nnnnn
d59640d6
CL
120named buffer temporary
121.It Pa /var/preserve
122preservation directory
123.El
124.Sh SEE ALSO
125.Xr awk 1 ,
a8a72574 126.Xr \&ed 1 ,
d59640d6
CL
127.Xr grep 1 ,
128.Xr sed 1 ,
129.Xr grep 1 ,
a8a72574 130.Xr \&vi 1 ,
d59640d6
CL
131.Xr termcap 5 ,
132.Xr environ 7
133.Rs
134.%T "Vi Quick Reference Card"
135.Re
136.Rs
137.%T "An Introduction to Display Editing with Vi"
138.Re
139.Sh BUGS
140Software tabs using
141.Sy \&^T
142work only immediately after the
143.Ic autoindent .
144.Pp
25df5839
KM
145Left and right shifts on intelligent terminals don't make use of
146insert and delete character operations in the terminal.
d59640d6 147.Pp
25df5839 148The
d59640d6 149.Ic wrapmargin
25df5839
KM
150option can be fooled since it looks at output columns when blanks are typed.
151If a long word passes through the margin and onto the next line without a
152break, then the line won't be broken.
d59640d6 153.Pp
25df5839
KM
154Insert/delete within a line can be slow if tabs are present on intelligent
155terminals, since the terminals need help in doing this correctly.
d59640d6 156.Pp
25df5839 157Saving text on deletes in the named buffers is somewhat inefficient.
d59640d6 158.Pp
25df5839 159The
d59640d6
CL
160.Ic source
161command does not work when executed as
162.Ic :source ;
163there is no way to use the
164.Ic :append ,
165.Ic :change ,
166and
167.Ic :insert
168commands, since it is not possible to give
169more than one line of input to a
170.Ic \&:
171escape. To use these
172on a
173.Ic :global
174you must
175.Ic Q
176to
a8a72574 177.Xr \&ex
d59640d6 178command mode,
25df5839 179execute them, and then reenter the screen editor with
a8a72574 180.Nm \&vi
25df5839 181or
d59640d6
CL
182.Ic open .
183.Sh HISTORY
184The
a8a72574 185.Nm \&vi
d59640d6
CL
186command appeared in
187.Bx 3.0 .