Print this page
10067 Miscellaneous man page typos
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: Volker A. Brandt <vab@bb-c.de>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1has/vi.1has
+++ new/usr/src/man/man1has/vi.1has
1 1 .\"
2 2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 3 .\" permission to reproduce portions of its copyrighted documentation.
4 4 .\" Original documentation from The Open Group can be obtained online at
5 5 .\" http://www.opengroup.org/bookstore/.
6 6 .\"
7 7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 8 .\" Group, have given us permission to reprint portions of their
9 9 .\" documentation.
10 10 .\"
11 11 .\" In the following statement, the phrase ``this text'' refers to portions
12 12 .\" of the system documentation.
13 13 .\"
14 14 .\" Portions of this text are reprinted and reproduced in electronic form
15 15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 16 .\" Standard for Information Technology -- Portable Operating System
17 17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 20 .\" between these versions and the original IEEE and The Open Group
21 21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 22 .\" document. The original Standard can be obtained online at
23 23 .\" http://www.opengroup.org/unix/online.html.
24 24 .\"
25 25 .\" This notice shall appear on any product containing this material.
26 26 .\"
27 27 .\" The contents of this file are subject to the terms of the
28 28 .\" Common Development and Distribution License (the "License").
29 29 .\" You may not use this file except in compliance with the License.
30 30 .\"
31 31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 32 .\" or http://www.opensolaris.org/os/licensing.
33 33 .\" See the License for the specific language governing permissions
34 34 .\" and limitations under the License.
35 35 .\"
36 36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 38 .\" If applicable, add the following below this CDDL HEADER, with the
39 39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 41 .\"
42 42 .\"
43 43 .\" Copyright 1989 AT&T
44 44 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
45 45 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
46 46 .\"
47 47 .TH VI 1HAS "May 16, 2007"
48 48 .SH NAME
49 49 vi, view, vedit \- screen-oriented (visual) display editor based on ex
50 50 .SH SYNOPSIS
51 51 .LP
52 52 .nf
53 53 \fB/usr/bin/vi\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]] [\fB-S\fR]
54 54 [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
55 55 [\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
56 56 .fi
57 57
58 58 .LP
59 59 .nf
60 60 \fB/usr/bin/view\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]] [\fB-S\fR]
61 61 [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
62 62 [\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
63 63 .fi
64 64
65 65 .LP
66 66 .nf
67 67 \fB/usr/bin/vedit\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]] [\fB-S\fR]
68 68 [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
69 69 [\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
70 70 .fi
71 71
72 72 .LP
73 73 .nf
74 74 \fB/usr/xpg4/bin/vi\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]]
75 75 [\fB-S\fR] [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
76 76 [\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
77 77 .fi
78 78
79 79 .LP
80 80 .nf
81 81 \fB/usr/xpg4/bin/view\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]]
82 82 [\fB-S\fR] [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
83 83 [\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
84 84 .fi
85 85
86 86 .LP
87 87 .nf
88 88 \fB/usr/xpg4/bin/vedit\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]]
89 89 [\fB-S\fR] [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
90 90 [\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
91 91 .fi
92 92
93 93 .LP
94 94 .nf
95 95 \fB/usr/xpg6/bin/vi\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]]
96 96 [\fB-S\fR] [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
97 97 [\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
98 98 .fi
99 99
100 100 .LP
101 101 .nf
102 102 \fB/usr/xpg6/bin/view\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]]
103 103 [\fB-S\fR] [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
104 104 [\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
↓ open down ↓ |
104 lines elided |
↑ open up ↑ |
105 105 .fi
106 106
107 107 .LP
108 108 .nf
109 109 \fB/usr/xpg6/bin/vedit\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfilename\fR]]
110 110 [\fB-S\fR] [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
111 111 [\fB+\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfilename\fR...
112 112 .fi
113 113
114 114 .SH DESCRIPTION
115 -.sp
116 115 .LP
117 116 The \fBvi\fR (visual) utility is a display-oriented text editor based on an
118 117 underlying line editor \fBex\fR. It is possible to use the command mode of
119 118 \fBex\fR from within \fBvi\fR and to use the command mode of \fBvi\fR from
120 119 within \fBex\fR. The visual commands are described on this manual page; how to
121 120 set options (like automatically numbering lines and automatically starting a
122 121 new output line when you type carriage return) and all \fBex\fR line editor
123 122 commands are described on the \fBex\fR(1) manual page.
124 123 .sp
125 124 .LP
126 125 When using \fBvi\fR, changes you make to the file are reflected in what you see
127 126 on your terminal screen. The position of the cursor on the screen indicates the
128 127 position within the file.
129 128 .sp
↓ open down ↓ |
4 lines elided |
↑ open up ↑ |
130 129 .LP
131 130 The \fBview\fR invocation is the same as \fBvi\fR except that the
132 131 \fBreadonly\fR flag is set.
133 132 .sp
134 133 .LP
135 134 The \fBvedit\fR invocation is intended for beginners. It is the same as
136 135 \fBvi\fR except that the \fBreport\fR flag is set to \fB1\fR, the
137 136 \fBshowmode\fR and \fBnovice\fR flags are set, and \fBmagic\fR is turned off.
138 137 These defaults make it easier to learn how to use \fBvi\fR.
139 138 .SH OPTIONS
140 -.sp
141 139 .LP
142 -The following options are supporrted:
140 +The following options are supported:
143 141 .SS "Invocation Options"
144 -.sp
145 142 .LP
146 143 The following invocation options are interpreted by \fBvi\fR (previously
147 144 documented options are discussed under NOTES):
148 145 .sp
149 146 .ne 2
150 147 .na
151 148 \fB\fB\(mi\fR | \fB-s\fR\fR
152 149 .ad
153 150 .RS 25n
154 151 Suppresses all interactive user feedback. This is useful when processing editor
155 152 scripts.
156 153 .RE
157 154
158 155 .sp
159 156 .ne 2
160 157 .na
161 158 \fB\fB-C\fR\fR
162 159 .ad
163 160 .RS 25n
164 161 Encryption option. Same as the \fB-x\fR option, except that \fBvi\fR simulates
165 162 the \fBC\fR command of \fBex\fR. The \fBC\fR command is like the \fBX\fR
166 163 command of \fBex\fR, except that all text read in is assumed to have been
167 164 encrypted.
168 165 .RE
169 166
170 167 .sp
171 168 .ne 2
172 169 .na
173 170 \fB\fB-l\fR\fR
174 171 .ad
175 172 .RS 25n
176 173 Sets up for editing \fBLISP\fR programs.
177 174 .RE
178 175
179 176 .sp
180 177 .ne 2
181 178 .na
182 179 \fB\fB-L\fR\fR
183 180 .ad
184 181 .RS 25n
185 182 Lists the name of all files saved as the result of an editor or system crash.
186 183 .RE
187 184
188 185 .sp
189 186 .ne 2
190 187 .na
191 188 \fB\fB-r\fR \fIfilename\fR\fR
192 189 .ad
193 190 .RS 25n
194 191 Edits \fIfilename\fR after an editor or system crash. (Recovers the version of
195 192 \fIfilename\fR that was in the buffer when the crash occurred.)
196 193 .RE
197 194
198 195 .sp
199 196 .ne 2
200 197 .na
201 198 \fB\fB-R\fR\fR
202 199 .ad
203 200 .RS 25n
204 201 \fBReadonly\fR mode. The \fBreadonly\fR flag is set, preventing accidental
205 202 overwriting of the file.
206 203 .RE
207 204
208 205 .sp
209 206 .ne 2
210 207 .na
211 208 \fB\fB-S\fR\fR
212 209 .ad
213 210 .RS 25n
214 211 This option is used in conjunction with the \fB-t\fR \fItag\fR option to tell
215 212 \fBvi\fR that the tags file can not be sorted and that, if the binary search
216 213 (which relies on a sorted tags file) for \fItag\fR fails to find it, the much
217 214 slower linear search should also be done. Since the linear search is slow,
218 215 users of large tags files should ensure that the tags files are sorted rather
219 216 than use this flag. Creation of tags files normally produces sorted tags files.
220 217 See \fBctags\fR(1) for more information on tags files.
221 218 .RE
222 219
223 220 .sp
224 221 .ne 2
225 222 .na
226 223 \fB\fB-t\fR \fItag\fR\fR
227 224 .ad
228 225 .RS 25n
229 226 Edits the file containing \fItag\fR and position the editor at its definition.
230 227 It is an error to specify more than one \fB-t\fR option.
231 228 .RE
232 229
233 230 .sp
234 231 .ne 2
235 232 .na
236 233 \fB\fB-v\fR\fR
237 234 .ad
238 235 .RS 25n
239 236 Starts up in display editing state, using \fBvi\fR. You can achieve the same
240 237 effect by typing the \fBvi\fR command itself.
241 238 .RE
242 239
243 240 .sp
244 241 .ne 2
245 242 .na
246 243 \fB\fB-V\fR\fR
247 244 .ad
248 245 .RS 25n
249 246 Verbose. When \fBex\fR commands are read by means of standard input, the input
250 247 is echoed to standard error. This can be useful when processing \fBex\fR
251 248 commands within shell scripts.
252 249 .RE
253 250
254 251 .sp
255 252 .ne 2
256 253 .na
257 254 \fB\fB-w\fR\fIn\fR\fR
258 255 .ad
259 256 .RS 25n
260 257 Sets the default window size to \fIn\fR. This is useful when using the editor
261 258 over a slow speed line.
262 259 .RE
263 260
264 261 .sp
265 262 .ne 2
266 263 .na
267 264 \fB\fB-x\fR\fR
268 265 .ad
269 266 .RS 25n
270 267 Encryption option. When used, \fBvi\fR simulates the \fBX\fR command of
271 268 \fBex\fR and prompts the user for a key. This key is used to encrypt and
272 269 decrypt text using the algorithm of the \fBcrypt\fR command. The \fBX\fR
273 270 command makes an educated guess to determine whether text read in is encrypted
274 271 or not. The temporary buffer file is encrypted also, using a transformed
275 272 version of the key typed in for the \fB-x\fR option. If an empty encryption
276 273 key is entered (that is, if the return key is pressed right after the prompt),
277 274 the file is not encrypted. This is a good way to decrypt a file erroneously
278 275 encrypted with a mistyped encryption key, such as a backspace or undo key.
279 276 .RE
280 277
281 278 .sp
↓ open down ↓ |
127 lines elided |
↑ open up ↑ |
282 279 .ne 2
283 280 .na
284 281 \fB\fB-\fR\fIcommand\fR | \fB-c\fR \fIcommand\fR\fR
285 282 .ad
286 283 .RS 25n
287 284 Begins editing by executing the specified editor \fIcommand\fR (usually a
288 285 search or positioning command).
289 286 .RE
290 287
291 288 .SS "/usr/xpg4/bin/vi and /usr/xpg6/bin/vi"
292 -.sp
293 289 .LP
294 290 If both the \fB-t\fR \fItag\fR and the \fB-c\fR \fIcommand\fR options are
295 -given, the \fB-t\fR \fItag\fR optionis processed first. That is, the file
291 +given, the \fB-t\fR \fItag\fR option is processed first. That is, the file
296 292 containing \fItag\fR is selected by \fB-t\fR and then the command is executed.
297 293 .SH OPERANDS
298 -.sp
299 294 .LP
300 295 The following operands are supported:
301 296 .sp
302 297 .ne 2
303 298 .na
304 299 \fB\fIfilename\fR\fR
305 300 .ad
306 301 .RS 12n
307 302 A file to be edited.
308 303 .RE
309 304
310 305 .SH COMMAND SUMMARY
311 -.sp
312 306 .LP
313 307 The \fBvi\fR command modes are summarized in this section.
314 308 .SS "vi Modes"
315 -.sp
316 309 .ne 2
317 310 .na
318 311 \fBCommand\fR
319 312 .ad
320 313 .RS 13n
321 314 Normal and initial mode. Other modes return to command mode upon completion.
322 315 \fIESC\fR (escape) is used to cancel a partial command.
323 316 .RE
324 317
325 318 .sp
326 319 .ne 2
327 320 .na
328 321 \fBInput\fR
329 322 .ad
330 323 .RS 13n
331 324 Entered by setting any of the following options:
332 325 .sp
333 326 .in +2
334 327 .nf
335 328 a A i I o O c C s S R
336 329 .fi
337 330 .in -2
338 331 .sp
339 332
340 333 Arbitrary text can then be entered. Input mode is normally terminated with the
341 334 \fIESC\fR character, or, abnormally, with an interrupt.
342 335 .RE
343 336
344 337 .sp
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
345 338 .ne 2
346 339 .na
347 340 \fBLast line\fR
348 341 .ad
349 342 .RS 13n
350 343 Reading input for \fB: / ?\fR or \fB!\fR. Terminate by typing a carriage
351 344 return. An interrupt cancels termination.
352 345 .RE
353 346
354 347 .SS "Sample Commands"
355 -.sp
356 348 .LP
357 349 In the descriptions, \fICR\fR stands for carriage return and \fIESC\fR stands
358 350 for the escape key.
359 351 .sp
360 352 .ne 2
361 353 .na
362 354 \fB\(<-, \(->\fR
363 355 .ad
364 356 .br
365 357 .na
366 358 \fBdown-arrow\fR
367 359 .ad
368 360 .br
369 361 .na
370 362 \fBup-arrow\fR
371 363 .ad
372 364 .RS 14n
373 365 arrow keys move the cursor
374 366 .RE
375 367
376 368 .sp
377 369 .ne 2
378 370 .na
379 371 \fBh j k l\fR
380 372 .ad
381 373 .RS 14n
382 374 same as arrow keys
383 375 .RE
384 376
385 377 .sp
386 378 .ne 2
387 379 .na
388 380 \fBi\fItext\fR\fIESC\fR\fR
389 381 .ad
390 382 .RS 14n
391 383 insert \fItext\fR
392 384 .RE
393 385
394 386 .sp
395 387 .ne 2
396 388 .na
397 389 \fBcw\fInew\fR\fIESC\fR\fR
398 390 .ad
399 391 .RS 14n
400 392 change word to \fInew\fR
401 393 .RE
402 394
403 395 .sp
404 396 .ne 2
405 397 .na
406 398 \fBea\fIs\fR\fIESC\fR\fR
407 399 .ad
408 400 .RS 14n
409 401 pluralize word (end of word; append \fBs\fR; escape from input state)
410 402 .RE
411 403
412 404 .sp
413 405 .ne 2
414 406 .na
415 407 \fBx\fR
416 408 .ad
417 409 .RS 14n
418 410 delete a character
419 411 .RE
420 412
421 413 .sp
422 414 .ne 2
423 415 .na
424 416 \fBdw\fR
425 417 .ad
426 418 .RS 14n
427 419 delete a word
428 420 .RE
429 421
430 422 .sp
431 423 .ne 2
432 424 .na
433 425 \fBdd\fR
434 426 .ad
435 427 .RS 14n
436 428 delete a line
437 429 .RE
438 430
439 431 .sp
440 432 .ne 2
441 433 .na
442 434 \fB3dd\fR
443 435 .ad
444 436 .RS 14n
445 437 delete 3 lines
446 438 .RE
447 439
448 440 .sp
449 441 .ne 2
450 442 .na
451 443 \fBu\fR
452 444 .ad
453 445 .RS 14n
454 446 undo previous change
455 447 .RE
456 448
457 449 .sp
458 450 .ne 2
459 451 .na
460 452 \fBZZ\fR
461 453 .ad
462 454 .RS 14n
463 455 exit \fBvi\fR, saving changes
464 456 .RE
465 457
466 458 .sp
467 459 .ne 2
468 460 .na
469 461 \fB:q!\fICR\fR\fR
470 462 .ad
471 463 .RS 14n
472 464 quit, discarding changes
473 465 .RE
474 466
475 467 .sp
476 468 .ne 2
477 469 .na
478 470 \fB/\fItext\fR\fICR\fR\fR
479 471 .ad
480 472 .RS 14n
481 473 search for \fItext\fR
482 474 .RE
483 475
484 476 .sp
485 477 .ne 2
486 478 .na
487 479 \fB^U ^D\fR
488 480 .ad
489 481 .RS 14n
490 482 scroll up or down
491 483 .RE
492 484
↓ open down ↓ |
127 lines elided |
↑ open up ↑ |
493 485 .sp
494 486 .ne 2
495 487 .na
496 488 \fB:\fIcmd\fR\fICR\fR\fR
497 489 .ad
498 490 .RS 14n
499 491 any \fBex\fR or \fBed\fR command
500 492 .RE
501 493
502 494 .SS "Counts Before vi Commands"
503 -.sp
504 495 .LP
505 496 Numbers can be typed as a prefix to some commands. They are interpreted in one
506 497 of these ways:
507 498 .sp
508 499 .ne 2
509 500 .na
510 501 \fBline/column number\fR
511 502 .ad
512 503 .RS 22n
513 504 z G |
514 505 .RE
515 506
516 507 .sp
517 508 .ne 2
518 509 .na
519 510 \fBscroll amount\fR
520 511 .ad
521 512 .RS 22n
522 513 ^D ^U
523 514 .RE
524 515
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
525 516 .sp
526 517 .ne 2
527 518 .na
528 519 \fBrepeat effect\fR
529 520 .ad
530 521 .RS 22n
531 522 most of the rest
532 523 .RE
533 524
534 525 .SS "Interrupting, Canceling"
535 -.sp
536 526 .ne 2
537 527 .na
538 528 \fB\fIESC\fR\fR
539 529 .ad
540 530 .RS 7n
541 531 end insert or incomplete command
542 532 .RE
543 533
544 534 .sp
545 535 .ne 2
546 536 .na
547 537 \fB\fIDEL\fR\fR
548 538 .ad
549 539 .RS 7n
550 540 (delete or rubout) interrupts
551 541 .RE
552 542
553 543 .SS "File Manipulation"
554 -.sp
555 544 .ne 2
556 545 .na
557 546 \fBZZ\fR
558 547 .ad
559 548 .RS 15n
560 549 if file modified, write and exit; otherwise, exit
561 550 .RE
562 551
563 552 .sp
564 553 .ne 2
565 554 .na
566 555 \fB:w\fICR\fR\fR
567 556 .ad
568 557 .RS 15n
569 558 write back changes
570 559 .RE
571 560
572 561 .sp
573 562 .ne 2
574 563 .na
575 564 \fB:w!\fICR\fR\fR
576 565 .ad
577 566 .RS 15n
578 567 forced write, if permission originally not valid
579 568 .RE
580 569
581 570 .sp
582 571 .ne 2
583 572 .na
584 573 \fB:q\fICR\fR\fR
585 574 .ad
586 575 .RS 15n
587 576 quit
588 577 .RE
589 578
590 579 .sp
591 580 .ne 2
592 581 .na
593 582 \fB:q!\fICR\fR\fR
594 583 .ad
595 584 .RS 15n
596 585 quit, discard changes
597 586 .RE
598 587
599 588 .sp
600 589 .ne 2
601 590 .na
602 591 \fB:e \fIname\fR\fICR\fR\fR
603 592 .ad
604 593 .RS 15n
605 594 edit file \fIname\fR
606 595 .RE
607 596
608 597 .sp
609 598 .ne 2
610 599 .na
611 600 \fB:e!\fICR\fR\fR
612 601 .ad
613 602 .RS 15n
614 603 reedit, discard changes
615 604 .RE
616 605
617 606 .sp
618 607 .ne 2
619 608 .na
620 609 \fB:e + \fIname\fR\fICR\fR\fR
621 610 .ad
622 611 .RS 15n
623 612 edit, starting at end
624 613 .RE
625 614
626 615 .sp
627 616 .ne 2
628 617 .na
629 618 \fB:e +\fIn\fR\fICR\fR\fR
630 619 .ad
631 620 .RS 15n
632 621 edit, starting at line \fIn\fR
633 622 .RE
634 623
635 624 .sp
636 625 .ne 2
637 626 .na
638 627 \fB:e #\fICR\fR\fR
639 628 .ad
640 629 .RS 15n
641 630 edit alternate file
642 631 .RE
643 632
644 633 .sp
645 634 .ne 2
646 635 .na
647 636 \fB:e! #\fICR\fR\fR
648 637 .ad
649 638 .RS 15n
650 639 edit alternate file, discard changes
651 640 .RE
652 641
653 642 .sp
654 643 .ne 2
655 644 .na
656 645 \fB:w \fIname\fR\fICR\fR\fR
657 646 .ad
658 647 .RS 15n
659 648 write file \fIname\fR
660 649 .RE
661 650
662 651 .sp
663 652 .ne 2
664 653 .na
665 654 \fB:w! \fIname\fR\fICR\fR\fR
666 655 .ad
667 656 .RS 15n
668 657 overwrite file \fIname\fR
669 658 .RE
670 659
671 660 .sp
672 661 .ne 2
673 662 .na
674 663 \fB:sh\fICR\fR\fR
675 664 .ad
676 665 .RS 15n
677 666 run shell, then return
678 667 .RE
679 668
680 669 .sp
681 670 .ne 2
682 671 .na
683 672 \fB:!\fIcmd\fR\fICR\fR\fR
684 673 .ad
685 674 .RS 15n
686 675 run \fIcmd\fR, then return
687 676 .RE
688 677
689 678 .sp
690 679 .ne 2
691 680 .na
692 681 \fB:n\fICR\fR\fR
693 682 .ad
694 683 .RS 15n
695 684 edit next file in arglist
696 685 .RE
697 686
698 687 .sp
699 688 .ne 2
700 689 .na
701 690 \fB:n \fIargs\fR\fICR\fR\fR
702 691 .ad
703 692 .RS 15n
704 693 specify new arglist
705 694 .RE
706 695
707 696 .sp
708 697 .ne 2
709 698 .na
710 699 \fB^G\fR
711 700 .ad
712 701 .RS 15n
713 702 show current file and line
714 703 .RE
715 704
716 705 .sp
717 706 .ne 2
718 707 .na
719 708 \fB:ta \fItag\fR\fICR\fR\fR
720 709 .ad
↓ open down ↓ |
156 lines elided |
↑ open up ↑ |
721 710 .RS 15n
722 711 position cursor to \fItag\fR
723 712 .RE
724 713
725 714 .sp
726 715 .LP
727 716 In general, any \fBex\fR or \fBed\fR command (such as \fIsubstitute\fR or
728 717 \fIglobal\fR) can be typed, preceded by a colon and followed by a carriage
729 718 return.
730 719 .SS "Positioning Within a File"
731 -.sp
732 720 .ne 2
733 721 .na
734 722 \fBF\fR
735 723 .ad
736 724 .RS 14n
737 725 forward screen
738 726 .RE
739 727
740 728 .sp
741 729 .ne 2
742 730 .na
743 731 \fB^B\fR
744 732 .ad
745 733 .RS 14n
746 734 backward screen
747 735 .RE
748 736
749 737 .sp
750 738 .ne 2
751 739 .na
752 740 \fB^D\fR
753 741 .ad
754 742 .RS 14n
755 743 scroll down half screen
756 744 .RE
757 745
758 746 .sp
759 747 .ne 2
760 748 .na
761 749 \fB^U\fR
762 750 .ad
763 751 .RS 14n
764 752 scroll up half screen
765 753 .RE
766 754
767 755 .sp
768 756 .ne 2
769 757 .na
770 758 \fB\fIn\fRG\fR
771 759 .ad
772 760 .RS 14n
773 761 go to the beginning of the specified line (end default), where \fIn\fR is a
774 762 line number
775 763 .RE
776 764
777 765 .sp
778 766 .ne 2
779 767 .na
780 768 \fB/\fIpat\fR\fR
781 769 .ad
782 770 .RS 14n
783 771 next line matching \fIpat\fR
784 772 .RE
785 773
786 774 .sp
787 775 .ne 2
788 776 .na
789 777 \fB?\fIpat\fR\fR
790 778 .ad
791 779 .RS 14n
792 780 previous line matching \fIpat\fR
793 781 .RE
794 782
795 783 .sp
796 784 .ne 2
797 785 .na
798 786 \fBn\fR
799 787 .ad
800 788 .RS 14n
801 789 repeat last \fB/\fR or \fB?\fR command
802 790 .RE
803 791
804 792 .sp
805 793 .ne 2
806 794 .na
807 795 \fBN\fR
808 796 .ad
809 797 .RS 14n
810 798 reverse last \fB/\fR or \fB?\fR command
811 799 .RE
812 800
813 801 .sp
814 802 .ne 2
815 803 .na
816 804 \fB/\fIpat\fR/+\fIn\fR\fR
817 805 .ad
818 806 .RS 14n
819 807 \fIn\fRth line after \fIpat\fR
820 808 .RE
821 809
822 810 .sp
823 811 .ne 2
824 812 .na
825 813 \fB?\fIpat\fR?\(mi\fIn\fR\fR
826 814 .ad
827 815 .RS 14n
828 816 \fIn\fRth line before \fIpat\fR
829 817 .RE
830 818
831 819 .sp
832 820 .ne 2
833 821 .na
834 822 \fB]]\fR
835 823 .ad
836 824 .RS 14n
837 825 next section/function
838 826 .RE
839 827
840 828 .sp
841 829 .ne 2
842 830 .na
843 831 \fB[[\fR
844 832 .ad
845 833 .RS 14n
846 834 previous section/function
847 835 .RE
848 836
849 837 .sp
850 838 .ne 2
851 839 .na
852 840 \fB(\fR
853 841 .ad
854 842 .RS 14n
855 843 beginning of sentence
856 844 .RE
857 845
858 846 .sp
859 847 .ne 2
860 848 .na
861 849 \fB)\fR
862 850 .ad
863 851 .RS 14n
864 852 end of sentence
865 853 .RE
866 854
867 855 .sp
868 856 .ne 2
869 857 .na
870 858 \fB{\fR
871 859 .ad
872 860 .RS 14n
873 861 beginning of paragraph
874 862 .RE
875 863
876 864 .sp
877 865 .ne 2
878 866 .na
879 867 \fB}\fR
880 868 .ad
881 869 .RS 14n
882 870 end of paragraph
883 871 .RE
884 872
↓ open down ↓ |
143 lines elided |
↑ open up ↑ |
885 873 .sp
886 874 .ne 2
887 875 .na
888 876 \fB%\fR
889 877 .ad
890 878 .RS 14n
891 879 find matching \fB( )\fR or \fB{ }\fR
892 880 .RE
893 881
894 882 .SS "Adjusting the Screen"
895 -.sp
896 883 .ne 2
897 884 .na
898 885 \fB^L\fR
899 886 .ad
900 887 .RS 16n
901 888 clear and redraw window
902 889 .RE
903 890
904 891 .sp
905 892 .ne 2
906 893 .na
907 894 \fB^R\fR
908 895 .ad
909 896 .RS 16n
910 897 clear and redraw window if \fB^L\fR is \(-> key
911 898 .RE
912 899
913 900 .sp
914 901 .ne 2
915 902 .na
916 903 \fBz\fICR\fR\fR
917 904 .ad
918 905 .RS 16n
919 906 redraw screen with current line at top of window
920 907 .RE
921 908
922 909 .sp
923 910 .ne 2
924 911 .na
925 912 \fBz\(mi\fICR\fR\fR
926 913 .ad
927 914 .RS 16n
928 915 redraw screen with current line at bottom of window
929 916 .RE
930 917
931 918 .sp
932 919 .ne 2
933 920 .na
934 921 \fBz.\fICR\fR\fR
935 922 .ad
936 923 .RS 16n
937 924 redraw screen with current line at center of window
938 925 .RE
939 926
940 927 .sp
941 928 .ne 2
942 929 .na
943 930 \fB/\fIpat\fR/z\(mi\fICR\fR\fR
944 931 .ad
945 932 .RS 16n
946 933 move \fIpat\fR line to bottom of window
947 934 .RE
948 935
949 936 .sp
950 937 .ne 2
951 938 .na
952 939 \fBz\fIn\fR.\fICR\fR\fR
953 940 .ad
954 941 .RS 16n
955 942 use \fIn\fR\(miline window
956 943 .RE
957 944
958 945 .sp
959 946 .ne 2
960 947 .na
961 948 \fB^E\fR
962 949 .ad
963 950 .RS 16n
964 951 scroll window down one line
965 952 .RE
966 953
↓ open down ↓ |
61 lines elided |
↑ open up ↑ |
967 954 .sp
968 955 .ne 2
969 956 .na
970 957 \fB^Y\fR
971 958 .ad
972 959 .RS 16n
973 960 scroll window up one line
974 961 .RE
975 962
976 963 .SS "Marking and Returning"
977 -.sp
978 964 .ne 2
979 965 .na
980 966 \fB\(ga\(ga\fR
981 967 .ad
982 968 .RS 12n
983 969 move cursor to previous context
984 970 .RE
985 971
986 972 .sp
987 973 .ne 2
988 974 .na
989 975 \fBa\'a\'\fR
990 976 .ad
991 977 .RS 12n
992 978 move cursor to first non-white space in line
993 979 .RE
994 980
995 981 .sp
996 982 .ne 2
997 983 .na
998 984 \fBm\fIx\fR\fR
999 985 .ad
1000 986 .RS 12n
1001 987 mark current position with the \fBASCII\fR lower-case letter \fIx\fR
1002 988 .RE
1003 989
1004 990 .sp
1005 991 .ne 2
1006 992 .na
1007 993 \fB\(ga\fIx\fR\fR
1008 994 .ad
1009 995 .RS 12n
1010 996 move cursor to mark \fIx\fR
1011 997 .RE
1012 998
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
1013 999 .sp
1014 1000 .ne 2
1015 1001 .na
1016 1002 \fBa\'\fIx\fR\fR
1017 1003 .ad
1018 1004 .RS 12n
1019 1005 move cursor to first non-white space in line marked by \fIx\fR
1020 1006 .RE
1021 1007
1022 1008 .SS "Line Positioning"
1023 -.sp
1024 1009 .ne 2
1025 1010 .na
1026 1011 \fBH\fR
1027 1012 .ad
1028 1013 .RS 14n
1029 1014 top line on screen
1030 1015 .RE
1031 1016
1032 1017 .sp
1033 1018 .ne 2
1034 1019 .na
1035 1020 \fBL\fR
1036 1021 .ad
1037 1022 .RS 14n
1038 1023 last line on screen
1039 1024 .RE
1040 1025
1041 1026 .sp
1042 1027 .ne 2
1043 1028 .na
1044 1029 \fBM\fR
1045 1030 .ad
1046 1031 .RS 14n
1047 1032 middle line on screen
1048 1033 .RE
1049 1034
1050 1035 .sp
1051 1036 .ne 2
1052 1037 .na
1053 1038 \fB+\fR
1054 1039 .ad
1055 1040 .RS 14n
1056 1041 next line, at first non-white space character
1057 1042 .RE
1058 1043
1059 1044 .sp
1060 1045 .ne 2
1061 1046 .na
1062 1047 \fB\(mi\fR
1063 1048 .ad
1064 1049 .RS 14n
1065 1050 previous line, at first non-white space character
1066 1051 .RE
1067 1052
1068 1053 .sp
1069 1054 .ne 2
1070 1055 .na
1071 1056 \fB\fICR\fR\fR
1072 1057 .ad
1073 1058 .RS 14n
1074 1059 return, same as \fB+\fR
1075 1060 .RE
1076 1061
1077 1062 .sp
1078 1063 .ne 2
1079 1064 .na
1080 1065 \fB\fBdown-arrow\fR\fR
1081 1066 .ad
1082 1067 .br
1083 1068 .na
1084 1069 \fBor \fBj\fR\fR
1085 1070 .ad
1086 1071 .RS 14n
1087 1072 next line, same column
1088 1073 .RE
1089 1074
1090 1075 .sp
1091 1076 .ne 2
1092 1077 .na
1093 1078 \fB\fBup-arrow\fR\fR
↓ open down ↓ |
60 lines elided |
↑ open up ↑ |
1094 1079 .ad
1095 1080 .br
1096 1081 .na
1097 1082 \fBor \fBk\fR\fR
1098 1083 .ad
1099 1084 .RS 14n
1100 1085 previous line, same column
1101 1086 .RE
1102 1087
1103 1088 .SS "Character Positioning"
1104 -.sp
1105 1089 .ne 2
1106 1090 .na
1107 1091 \fB^\fR
1108 1092 .ad
1109 1093 .RS 13n
1110 1094 first non-white space character
1111 1095 .RE
1112 1096
1113 1097 .sp
1114 1098 .ne 2
1115 1099 .na
1116 1100 \fB0\fR
1117 1101 .ad
1118 1102 .RS 13n
1119 1103 beginning of line
1120 1104 .RE
1121 1105
1122 1106 .sp
1123 1107 .ne 2
1124 1108 .na
1125 1109 \fB$\fR
1126 1110 .ad
1127 1111 .RS 13n
1128 1112 end of line
1129 1113 .RE
1130 1114
1131 1115 .sp
1132 1116 .ne 2
1133 1117 .na
1134 1118 \fB\fBl\fR or \fB\(->\fR\fR
1135 1119 .ad
1136 1120 .RS 13n
1137 1121 forward
1138 1122 .RE
1139 1123
1140 1124 .sp
1141 1125 .ne 2
1142 1126 .na
1143 1127 \fB\fBh\fR or \fB\(<-\fR\fR
1144 1128 .ad
1145 1129 .RS 13n
1146 1130 backward
1147 1131 .RE
1148 1132
1149 1133 .sp
1150 1134 .ne 2
1151 1135 .na
1152 1136 \fB^H\fR
1153 1137 .ad
1154 1138 .RS 13n
1155 1139 same as \fB\(<-\fR (backspace)
1156 1140 .RE
1157 1141
1158 1142 .sp
1159 1143 .ne 2
1160 1144 .na
1161 1145 \fBspace\fR
1162 1146 .ad
1163 1147 .RS 13n
1164 1148 same as \fB\(->\fR (space bar)
1165 1149 .RE
1166 1150
1167 1151 .sp
1168 1152 .ne 2
1169 1153 .na
1170 1154 \fBf\fIx\fR\fR
1171 1155 .ad
1172 1156 .RS 13n
1173 1157 find next \fIx\fR
1174 1158 .RE
1175 1159
1176 1160 .sp
1177 1161 .ne 2
1178 1162 .na
1179 1163 \fBF\fIx\fR\fR
1180 1164 .ad
1181 1165 .RS 13n
1182 1166 find previous \fIx\fR
1183 1167 .RE
1184 1168
1185 1169 .sp
1186 1170 .ne 2
1187 1171 .na
1188 1172 \fBt\fIx\fR\fR
1189 1173 .ad
1190 1174 .RS 13n
1191 1175 move to character following the next \fIx\fR
1192 1176 .RE
1193 1177
1194 1178 .sp
1195 1179 .ne 2
1196 1180 .na
1197 1181 \fBT\fIx\fR\fR
1198 1182 .ad
1199 1183 .RS 13n
1200 1184 move to character following the previous \fIx\fR
1201 1185 .RE
1202 1186
1203 1187 .sp
1204 1188 .ne 2
1205 1189 .na
1206 1190 \fB;\fR
1207 1191 .ad
1208 1192 .RS 13n
1209 1193 repeat last \fBf\fR, \fBF\fR, \fBt\fR, or \fBT\fR
1210 1194 .RE
1211 1195
1212 1196 .sp
1213 1197 .ne 2
1214 1198 .na
1215 1199 \fB,\fR
1216 1200 .ad
1217 1201 .RS 13n
1218 1202 repeat inverse of last \fBf\fR, \fBF\fR, \fBt\fR, or \fBT\fR
1219 1203 .RE
1220 1204
1221 1205 .sp
1222 1206 .ne 2
1223 1207 .na
1224 1208 \fB\fIn\fR|\fR
1225 1209 .ad
1226 1210 .RS 13n
1227 1211 move to column \fIn\fR
1228 1212 .RE
1229 1213
↓ open down ↓ |
115 lines elided |
↑ open up ↑ |
1230 1214 .sp
1231 1215 .ne 2
1232 1216 .na
1233 1217 \fB%\fR
1234 1218 .ad
1235 1219 .RS 13n
1236 1220 find matching \fB( )\fR or \fB{ }\fR
1237 1221 .RE
1238 1222
1239 1223 .SS "Words, Sentences, Paragraphs"
1240 -.sp
1241 1224 .ne 2
1242 1225 .na
1243 1226 \fBw\fR
1244 1227 .ad
1245 1228 .RS 5n
1246 1229 forward a word
1247 1230 .RE
1248 1231
1249 1232 .sp
1250 1233 .ne 2
1251 1234 .na
1252 1235 \fBb\fR
1253 1236 .ad
1254 1237 .RS 5n
1255 1238 back a word
1256 1239 .RE
1257 1240
1258 1241 .sp
1259 1242 .ne 2
1260 1243 .na
1261 1244 \fBe\fR
1262 1245 .ad
1263 1246 .RS 5n
1264 1247 end of word
1265 1248 .RE
1266 1249
1267 1250 .sp
1268 1251 .ne 2
1269 1252 .na
1270 1253 \fB)\fR
1271 1254 .ad
1272 1255 .RS 5n
1273 1256 to next sentence
1274 1257 .RE
1275 1258
1276 1259 .sp
1277 1260 .ne 2
1278 1261 .na
1279 1262 \fB}\fR
1280 1263 .ad
1281 1264 .RS 5n
1282 1265 to next paragraph
1283 1266 .RE
1284 1267
1285 1268 .sp
1286 1269 .ne 2
1287 1270 .na
1288 1271 \fB(\fR
1289 1272 .ad
1290 1273 .RS 5n
1291 1274 back a sentence
1292 1275 .RE
1293 1276
1294 1277 .sp
1295 1278 .ne 2
1296 1279 .na
1297 1280 \fB{\fR
1298 1281 .ad
1299 1282 .RS 5n
1300 1283 back a paragraph
1301 1284 .RE
1302 1285
1303 1286 .sp
1304 1287 .ne 2
1305 1288 .na
1306 1289 \fBW\fR
1307 1290 .ad
1308 1291 .RS 5n
1309 1292 forward a blank-delimited word
1310 1293 .RE
1311 1294
1312 1295 .sp
1313 1296 .ne 2
1314 1297 .na
1315 1298 \fBB\fR
1316 1299 .ad
1317 1300 .RS 5n
1318 1301 back a blank-delimited word
1319 1302 .RE
1320 1303
↓ open down ↓ |
70 lines elided |
↑ open up ↑ |
1321 1304 .sp
1322 1305 .ne 2
1323 1306 .na
1324 1307 \fBE\fR
1325 1308 .ad
1326 1309 .RS 5n
1327 1310 end of a blank-delimited word
1328 1311 .RE
1329 1312
1330 1313 .SS "Corrections During Insert"
1331 -.sp
1332 1314 .ne 2
1333 1315 .na
1334 1316 \fB^H\fR
1335 1317 .ad
1336 1318 .RS 16n
1337 1319 erase last character (backspace)
1338 1320 .RE
1339 1321
1340 1322 .sp
1341 1323 .ne 2
1342 1324 .na
1343 1325 \fB^W\fR
1344 1326 .ad
1345 1327 .RS 16n
1346 1328 erase last word
1347 1329 .RE
1348 1330
1349 1331 .sp
1350 1332 .ne 2
1351 1333 .na
1352 1334 \fBerase\fR
1353 1335 .ad
1354 1336 .RS 16n
1355 1337 your erase character, same as \fB^H\fR (backspace)
1356 1338 .RE
1357 1339
1358 1340 .sp
1359 1341 .ne 2
1360 1342 .na
1361 1343 \fBkill\fR
1362 1344 .ad
1363 1345 .RS 16n
1364 1346 your kill character, erase this line of input
1365 1347 .RE
1366 1348
1367 1349 .sp
1368 1350 .ne 2
1369 1351 .na
1370 1352 \fB\e\fR
1371 1353 .ad
1372 1354 .RS 16n
1373 1355 quotes your erase and kill characters
1374 1356 .RE
1375 1357
1376 1358 .sp
1377 1359 .ne 2
1378 1360 .na
1379 1361 \fB\fIESC\fR\fR
1380 1362 .ad
1381 1363 .RS 16n
1382 1364 ends insertion, back to command mode
1383 1365 .RE
1384 1366
1385 1367 .sp
1386 1368 .ne 2
1387 1369 .na
1388 1370 \fBControl\(miC\fR
1389 1371 .ad
1390 1372 .RS 16n
1391 1373 interrupt, suspends insert mode
1392 1374 .RE
1393 1375
1394 1376 .sp
1395 1377 .ne 2
1396 1378 .na
1397 1379 \fB^D\fR
1398 1380 .ad
1399 1381 .RS 16n
1400 1382 backtab one character; reset left margin of \fIautoindent\fR
1401 1383 .RE
1402 1384
1403 1385 .sp
1404 1386 .ne 2
1405 1387 .na
1406 1388 \fB^^D\fR
1407 1389 .ad
1408 1390 .RS 16n
1409 1391 caret (\fB^\fR) followed by control-d (\fB^D\fR); backtab to beginning of line;
1410 1392 do not reset left margin of \fIautoindent\fR
1411 1393 .RE
1412 1394
1413 1395 .sp
1414 1396 .ne 2
1415 1397 .na
1416 1398 \fB0^D\fR
1417 1399 .ad
1418 1400 .RS 16n
1419 1401 backtab to beginning of line; reset left margin of \fIautoindent\fR
1420 1402 .RE
1421 1403
↓ open down ↓ |
80 lines elided |
↑ open up ↑ |
1422 1404 .sp
1423 1405 .ne 2
1424 1406 .na
1425 1407 \fB^V\fR
1426 1408 .ad
1427 1409 .RS 16n
1428 1410 quote non-printable character
1429 1411 .RE
1430 1412
1431 1413 .SS "Insert and Replace"
1432 -.sp
1433 1414 .ne 2
1434 1415 .na
1435 1416 \fBa\fR
1436 1417 .ad
1437 1418 .RS 12n
1438 1419 append after cursor
1439 1420 .RE
1440 1421
1441 1422 .sp
1442 1423 .ne 2
1443 1424 .na
1444 1425 \fBA\fR
1445 1426 .ad
1446 1427 .RS 12n
1447 1428 append at end of line
1448 1429 .RE
1449 1430
1450 1431 .sp
1451 1432 .ne 2
1452 1433 .na
1453 1434 \fBi\fR
1454 1435 .ad
1455 1436 .RS 12n
1456 1437 insert before cursor
1457 1438 .RE
1458 1439
1459 1440 .sp
1460 1441 .ne 2
1461 1442 .na
1462 1443 \fBI\fR
1463 1444 .ad
1464 1445 .RS 12n
1465 1446 insert before first non-blank
1466 1447 .RE
1467 1448
1468 1449 .sp
1469 1450 .ne 2
1470 1451 .na
1471 1452 \fBo\fR
1472 1453 .ad
1473 1454 .RS 12n
1474 1455 open line below
1475 1456 .RE
1476 1457
1477 1458 .sp
1478 1459 .ne 2
1479 1460 .na
1480 1461 \fBO\fR
1481 1462 .ad
1482 1463 .RS 12n
1483 1464 open line above
1484 1465 .RE
1485 1466
1486 1467 .sp
1487 1468 .ne 2
1488 1469 .na
1489 1470 \fBr\fIx\fR\fR
1490 1471 .ad
1491 1472 .RS 12n
1492 1473 replace single character with \fIx\fR
1493 1474 .RE
1494 1475
↓ open down ↓ |
52 lines elided |
↑ open up ↑ |
1495 1476 .sp
1496 1477 .ne 2
1497 1478 .na
1498 1479 \fBR\fItext\fR\fIESC\fR\fR
1499 1480 .ad
1500 1481 .RS 12n
1501 1482 replace characters
1502 1483 .RE
1503 1484
1504 1485 .SS "Operators"
1505 -.sp
1506 1486 .LP
1507 1487 Operators are followed by a cursor motion and affect all text that would have
1508 1488 been moved over. For example, since \fBw\fR moves over a word, \fBdw\fR deletes
1509 1489 the word that would be moved over. Double the operator, for example \fBdd\fR,
1510 1490 to affect whole lines.
1511 1491 .sp
1512 1492 .ne 2
1513 1493 .na
1514 1494 \fBd\fR
1515 1495 .ad
1516 1496 .RS 5n
1517 1497 delete
1518 1498 .RE
1519 1499
1520 1500 .sp
1521 1501 .ne 2
1522 1502 .na
1523 1503 \fBc\fR
1524 1504 .ad
1525 1505 .RS 5n
1526 1506 change
1527 1507 .RE
1528 1508
1529 1509 .sp
1530 1510 .ne 2
1531 1511 .na
1532 1512 \fBy\fR
1533 1513 .ad
1534 1514 .RS 5n
1535 1515 yank lines to buffer
1536 1516 .RE
1537 1517
1538 1518 .sp
1539 1519 .ne 2
1540 1520 .na
1541 1521 \fB<\fR
1542 1522 .ad
1543 1523 .RS 5n
1544 1524 left shift
1545 1525 .RE
1546 1526
1547 1527 .sp
1548 1528 .ne 2
1549 1529 .na
1550 1530 \fB>\fR
1551 1531 .ad
1552 1532 .RS 5n
1553 1533 right shift
1554 1534 .RE
1555 1535
↓ open down ↓ |
40 lines elided |
↑ open up ↑ |
1556 1536 .sp
1557 1537 .ne 2
1558 1538 .na
1559 1539 \fB!\fR
1560 1540 .ad
1561 1541 .RS 5n
1562 1542 filter through command
1563 1543 .RE
1564 1544
1565 1545 .SS "Miscellaneous Operations"
1566 -.sp
1567 1546 .ne 2
1568 1547 .na
1569 1548 \fBC\fR
1570 1549 .ad
1571 1550 .RS 5n
1572 1551 change rest of line (\fBc$\fR)
1573 1552 .RE
1574 1553
1575 1554 .sp
1576 1555 .ne 2
1577 1556 .na
1578 1557 \fBD\fR
1579 1558 .ad
1580 1559 .RS 5n
1581 1560 delete rest of line (\fBd$\fR)
1582 1561 .RE
1583 1562
1584 1563 .sp
1585 1564 .ne 2
1586 1565 .na
1587 1566 \fBs\fR
1588 1567 .ad
1589 1568 .RS 5n
1590 1569 substitute characters (\fBcl\fR)
1591 1570 .RE
1592 1571
1593 1572 .sp
1594 1573 .ne 2
1595 1574 .na
1596 1575 \fBS\fR
1597 1576 .ad
1598 1577 .RS 5n
1599 1578 substitute lines (\fBcc\fR)
1600 1579 .RE
1601 1580
1602 1581 .sp
1603 1582 .ne 2
1604 1583 .na
1605 1584 \fBJ\fR
1606 1585 .ad
1607 1586 .RS 5n
1608 1587 join lines
1609 1588 .RE
1610 1589
1611 1590 .sp
1612 1591 .ne 2
1613 1592 .na
1614 1593 \fBx\fR
1615 1594 .ad
1616 1595 .RS 5n
1617 1596 delete characters (\fBdl\fR)
1618 1597 .RE
1619 1598
1620 1599 .sp
1621 1600 .ne 2
1622 1601 .na
1623 1602 \fBX\fR
1624 1603 .ad
1625 1604 .RS 5n
1626 1605 delete characters before cursor \fBdh\fR)
1627 1606 .RE
1628 1607
↓ open down ↓ |
52 lines elided |
↑ open up ↑ |
1629 1608 .sp
1630 1609 .ne 2
1631 1610 .na
1632 1611 \fBY\fR
1633 1612 .ad
1634 1613 .RS 5n
1635 1614 yank lines (\fByy\fR)
1636 1615 .RE
1637 1616
1638 1617 .SS "Yank and Put"
1639 -.sp
1640 1618 .LP
1641 1619 Put inserts the text most recently deleted or yanked; however, if a buffer is
1642 1620 named (using the \fBASCII\fR lower-case letters \fBa\fR - \fBz\fR), the text in
1643 1621 that buffer is put instead.
1644 1622 .sp
1645 1623 .ne 2
1646 1624 .na
1647 1625 \fB3yy\fR
1648 1626 .ad
1649 1627 .RS 7n
1650 1628 yank 3 lines
1651 1629 .RE
1652 1630
1653 1631 .sp
1654 1632 .ne 2
1655 1633 .na
1656 1634 \fB3yl\fR
1657 1635 .ad
1658 1636 .RS 7n
1659 1637 yank 3 characters
1660 1638 .RE
1661 1639
1662 1640 .sp
1663 1641 .ne 2
1664 1642 .na
1665 1643 \fBp\fR
1666 1644 .ad
1667 1645 .RS 7n
1668 1646 put back text after cursor
1669 1647 .RE
1670 1648
1671 1649 .sp
1672 1650 .ne 2
1673 1651 .na
1674 1652 \fBP\fR
1675 1653 .ad
1676 1654 .RS 7n
1677 1655 put back text before cursor
1678 1656 .RE
1679 1657
1680 1658 .sp
1681 1659 .ne 2
1682 1660 .na
1683 1661 \fB\fI"x\fRp\fR
1684 1662 .ad
1685 1663 .RS 7n
1686 1664 put from buffer \fIx\fR
1687 1665 .RE
1688 1666
1689 1667 .sp
1690 1668 .ne 2
1691 1669 .na
1692 1670 \fB"\fIx\fRy\fR
1693 1671 .ad
1694 1672 .RS 7n
1695 1673 yank to buffer \fIx\fR
1696 1674 .RE
1697 1675
↓ open down ↓ |
48 lines elided |
↑ open up ↑ |
1698 1676 .sp
1699 1677 .ne 2
1700 1678 .na
1701 1679 \fB"\fIx\fRd\fR
1702 1680 .ad
1703 1681 .RS 7n
1704 1682 delete into buffer \fIx\fR
1705 1683 .RE
1706 1684
1707 1685 .SS "Undo, Redo, Retrieve"
1708 -.sp
1709 1686 .ne 2
1710 1687 .na
1711 1688 \fBu\fR
1712 1689 .ad
1713 1690 .RS 7n
1714 1691 undo last change
1715 1692 .RE
1716 1693
1717 1694 .sp
1718 1695 .ne 2
1719 1696 .na
1720 1697 \fBU\fR
1721 1698 .ad
1722 1699 .RS 7n
1723 1700 restore current line
1724 1701 .RE
1725 1702
1726 1703 .sp
1727 1704 .ne 2
1728 1705 .na
1729 1706 \fB\&.\fR
1730 1707 .ad
1731 1708 .RS 7n
1732 1709 repeat last change
1733 1710 .RE
1734 1711
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
1735 1712 .sp
1736 1713 .ne 2
1737 1714 .na
1738 1715 \fB"\fId\fRp\fR
1739 1716 .ad
1740 1717 .RS 7n
1741 1718 retrieve \fId\fR'th last delete
1742 1719 .RE
1743 1720
1744 1721 .SH USAGE
1745 -.sp
1746 1722 .LP
1747 1723 See \fBlargefile\fR(5) for the description of the behavior of \fBvi\fR and
1748 1724 \fBview\fR when encountering files greater than or equal to 2 Gbyte ( 2^31
1749 1725 bytes).
1750 1726 .SH ENVIRONMENT VARIABLES
1751 -.sp
1752 1727 .LP
1753 1728 See \fBenviron\fR(5) for descriptions of the following environment variables
1754 1729 that affect the execution of \fBvi\fR: \fBLANG\fR, \fBLC_ALL\fR,
1755 1730 \fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_TIME\fR, \fBLC_MESSAGES\fR,
1756 1731 \fBNLSPATH\fR, \fBPATH\fR, \fBSHELL\fR, and \fBTERM\fR.
1757 1732 .sp
1758 1733 .ne 2
1759 1734 .na
1760 1735 \fB\fBCOLUMNS\fR\fR
1761 1736 .ad
1762 1737 .RS 11n
1763 1738 Override the system-selected horizontal screen size.
1764 1739 .RE
1765 1740
1766 1741 .sp
1767 1742 .ne 2
1768 1743 .na
1769 1744 \fB\fBEXINIT\fR\fR
1770 1745 .ad
1771 1746 .RS 11n
1772 1747 Determine a list of \fBex\fR commands that are executed on editor start-up,
1773 1748 before reading the first file. The list can contain multiple commands by
1774 1749 separating them using a vertical-line (\fB|\fR) character.
1775 1750 .RE
1776 1751
1777 1752 .sp
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
1778 1753 .ne 2
1779 1754 .na
1780 1755 \fB\fBLINES\fR\fR
1781 1756 .ad
1782 1757 .RS 11n
1783 1758 Override the system-selected vertical screen size, used as the number of lines
1784 1759 in a screenful and the vertical screen size in visual mode.
1785 1760 .RE
1786 1761
1787 1762 .SH FILES
1788 -.sp
1789 1763 .ne 2
1790 1764 .na
1791 1765 \fB\fB/var/tmp\fR\fR
1792 1766 .ad
1793 1767 .sp .6
1794 1768 .RS 4n
1795 1769 default directory where temporary work files are placed; it can be changed
1796 1770 using the \fBdirectory\fR option (see the \fBex\fR(1) command)
1797 1771 .RE
1798 1772
1799 1773 .sp
1800 1774 .ne 2
1801 1775 .na
1802 1776 \fB\fB/usr/share/lib/terminfo/?/*\fR\fR
1803 1777 .ad
1804 1778 .sp .6
1805 1779 .RS 4n
1806 1780 compiled terminal description database
1807 1781 .RE
1808 1782
1809 1783 .sp
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
1810 1784 .ne 2
1811 1785 .na
1812 1786 \fB\fB/usr/lib/.COREterm/?/*\fR\fR
1813 1787 .ad
1814 1788 .sp .6
1815 1789 .RS 4n
1816 1790 subset of compiled terminal description database
1817 1791 .RE
1818 1792
1819 1793 .SH ATTRIBUTES
1820 -.sp
1821 1794 .LP
1822 1795 See \fBattributes\fR(5) for descriptions of the following attributes:
1823 1796 .SS "/usr/bin/vi, /usr/bin/view, /usr/bin/vedit"
1824 -.sp
1825 -
1826 -.sp
1827 1797 .TS
1828 1798 box;
1829 1799 c | c
1830 1800 l | l .
1831 1801 ATTRIBUTE TYPE ATTRIBUTE VALUE
1832 1802 _
1833 1803 CSI Not enabled
1834 1804 .TE
1835 1805
1836 1806 .SS "/usr/xpg4/bin/vi, /usr/xpg4/bin/view, /usr/xpg4/bin/vedit"
1837 -.sp
1838 -
1839 -.sp
1840 1807 .TS
1841 1808 box;
1842 1809 c | c
1843 1810 l | l .
1844 1811 ATTRIBUTE TYPE ATTRIBUTE VALUE
1845 1812 _
1846 1813 CSI Enabled
1847 1814 _
1848 1815 Interface Stability Standard
1849 1816 .TE
1850 1817
1851 1818 .SS "/usr/xpg6/bin/vi, /usr/xpg6/bin/view, /usr/xpg6/bin/vedit"
1852 -.sp
1853 -
1854 -.sp
1855 1819 .TS
1856 1820 box;
1857 1821 c | c
1858 1822 l | l .
1859 1823 ATTRIBUTE TYPE ATTRIBUTE VALUE
1860 1824 _
1861 1825 CSI Enabled
1862 1826 _
1863 1827 Interface Stability Standard
1864 1828 .TE
1865 1829
1866 1830 .SH SEE ALSO
1867 -.sp
1868 1831 .LP
1869 1832 \fBIntro\fR(1), \fBctags\fR(1), \fBed\fR(1), \fBedit\fR(1), \fBex\fR(1),
1870 1833 \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)
1871 1834 .sp
1872 1835 .LP
1873 1836 \fISolaris Advanced User\&'s Guide\fR
1874 1837 .SH AUTHOR
1875 -.sp
1876 1838 .LP
1877 1839 \fBvi\fR and \fBex\fR were developed by The University of California, Berkeley
1878 1840 California, Computer Science Division, Department of Electrical Engineering and
1879 1841 Computer Science.
1880 1842 .SH NOTES
1881 -.sp
1882 1843 .LP
1883 1844 Two options, although they continue to be supported, have been replaced in the
1884 1845 documentation by options that follow the Command Syntax Standard (see
1885 1846 \fBIntro\fR(1)). An \fB-r\fR option that is not followed with an
1886 1847 option-argument has been replaced by \fB-L\fR and \fB+\fR\fBcommand\fR has been
1887 1848 replaced by \fB-c\fR \fBcommand\fR.
1888 1849 .sp
1889 1850 .LP
1890 1851 The message \fBfile too large to recover with\fR \fB-r\fR \fBoption\fR, which
1891 1852 is seen when a file is loaded, indicates that the file can be edited and saved
1892 1853 successfully, but if the editing session is lost, recovery of the file with the
1893 1854 \fB-r\fR option is not possible.
1894 1855 .sp
1895 1856 .LP
1896 1857 The editing environment defaults to certain configuration options. When an
1897 1858 editing session is initiated, \fBvi\fR attempts to read the \fBEXINIT\fR
1898 1859 environment variable. If it exists, the editor uses the values defined in
1899 1860 \fBEXINIT\fR; otherwise the values set in \fB$HOME/.exrc\fR are used. If
1900 1861 \fB$HOME/.exrc\fR does not exist, the default values are used.
1901 1862 .sp
1902 1863 .LP
1903 1864 To use a copy of \fB\&.exrc\fR located in the current directory other than
1904 1865 \fB$HOME\fR, set the \fIexrc\fR option in \fBEXINIT\fR or \fB$HOME/.exrc\fR.
1905 1866 Options set in \fBEXINIT\fR can be turned off in a local \fB\&.exrc\fR only if
1906 1867 \fIexrc\fR is set in \fBEXINIT\fR or \fB$HOME/.exrc\fR. In order to be used,
1907 1868 \fI\&.exrc\fR in \fB$HOME\fR or the current directory must fulfill these
1908 1869 conditions:
1909 1870 .RS +4
1910 1871 .TP
1911 1872 .ie t \(bu
1912 1873 .el o
1913 1874 It must exist.
1914 1875 .RE
1915 1876 .RS +4
1916 1877 .TP
1917 1878 .ie t \(bu
1918 1879 .el o
1919 1880 It must be owned by the same userid as the real userid of the process, or the
1920 1881 process has appropriate privileges.
1921 1882 .RE
1922 1883 .RS +4
1923 1884 .TP
1924 1885 .ie t \(bu
1925 1886 .el o
1926 1887 It is not writable by anyone other than the owner.
1927 1888 .RE
1928 1889 .sp
1929 1890 .LP
1930 1891 Tampering with entries in \fB/usr/share/lib/terminfo/?/*\fR or
1931 1892 \fB/usr/share/lib/terminfo/?/*\fR (for example, changing or removing an entry)
1932 1893 can affect programs such as \fBvi\fR that expect the entry to be present and
1933 1894 correct. In particular, removing the "dumb" terminal can cause unexpected
1934 1895 problems.
1935 1896 .sp
1936 1897 .LP
1937 1898 Software tabs using \fB^T\fR work only immediately after the \fIautoindent\fR.
1938 1899 .sp
1939 1900 .LP
1940 1901 Left and right shifts on intelligent terminals do not make use of insert and
1941 1902 delete character operations in the terminal.
1942 1903 .sp
1943 1904 .LP
1944 1905 Loading an alternate \fBmalloc()\fR library using the environment variable
1945 1906 \fBLD_PRELOAD\fR can cause problems for \fB/usr/bin/vi\fR.
1946 1907 .sp
1947 1908 .LP
1948 1909 The \fBvi\fR utility currently has the following limitations:
1949 1910 .RS +4
1950 1911 .TP
1951 1912 1.
1952 1913 Lines, including the trailing NEWLINE character, can contain no more than
1953 1914 4096 bytes.
1954 1915 .sp
1955 1916 If a longer line is found, \fBLine too long\fR is displayed in the status line.
1956 1917 .RE
1957 1918 .RS +4
1958 1919 .TP
1959 1920 2.
1960 1921 The editor's temporary work file can be no larger than 128Mb.
1961 1922 .sp
1962 1923 If a larger temporary file is needed, \fBTmp file too large\fR is displayed in
1963 1924 the status line.
1964 1925 .RE
↓ open down ↓ |
73 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX