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