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