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