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