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