1@comment Copyright (c) 1994 2@comment The Regents of the University of California. All rights reserved. 3@comment Copyright (c) 1994, 1995, 1996 4@comment Keith Bostic. All rights reserved. 5@comment 6@comment See the LICENSE file for redistribution information. 7@comment 8@comment Id: set.opt.texi,v 8.1 2001/08/18 20:43:48 skimo Exp (Berkeley) Date: 2001/08/18 20:43:48 9@comment 10@chapter Set Options 11 12There are a large number of options that may be set (or unset) to 13change the editor's behavior. 14This section describes the options, their abbreviations and their 15default values. 16 17In each entry below, the first part of the tag line is the full name 18of the option, followed by any equivalent abbreviations. 19(Regardless of the abbreviations, it is only necessary to use the 20minimum number of characters necessary to distinguish an abbreviation 21from all other commands for it to be accepted, in 22@EV{nex,nvi}. 23Historically, only the full name and the official abbreviations 24were accepted by 25@EV{ex,vi}. 26Using full names in your startup files and environmental variables will 27probably make them more portable.) 28The part in square brackets is the default value of the option. 29Most of the options are boolean, i.e. they are either on or off, 30and do not have an associated value. 31 32Options apply to both 33@CO{ex} 34and 35@CO{vi} 36modes, unless otherwise specified. 37 38With a few exceptions, 39all options are settable per screen, i.e. the 40@OP{tags} 41option can be set differently in each screen. 42The exceptions are the 43@OP{columns}, 44@OP{lines}, 45@OP{secure} 46and 47@OP{term} 48options. 49Changing these options modifies the respective information for all screens. 50 51For information on modifying the options or to display the options and 52their current values, see the 53@QQ{set} 54command in the section entitled 55@QB{Ex Commands} . 56@itemize @bullet 57@cindex altwerase 58@IP{altwerase [off]} 59 60@CO{Vi} 61only. 62Change how 63@CO{vi} 64does word erase during text input. 65When this option is set, text is broken up into three classes: 66alphabetic, numeric and underscore characters, other nonblank 67characters, and blank characters. 68Changing from one class to another marks the end of a word. 69In addition, the class of the first character erased is ignored 70(which is exactly what you want when erasing pathname components). 71@cindex autoindent 72@IP{autoindent, ai [off]} 73 74If this option is set, whenever you create a new line (using the 75@CO{vi} 76@CO{A}, 77@CO{a}, 78@CO{C}, 79@CO{c}, 80@CO{I}, 81@CO{i}, 82@CO{O}, 83@CO{o}, 84@CO{R}, 85@CO{r}, 86@CO{S}, 87and 88@CO{s} 89commands, or the 90@CO{ex} 91@CO{append}, 92@CO{change}, 93and 94@CO{insert} 95commands) the new line is automatically indented to align the cursor with 96the first nonblank character of the line from which you created it. 97Lines are indented using tab characters to the extent possible (based on 98the value of the 99@OP{tabstop} 100option, 101and if 102@OP{expandtab} 103is not set) and then using space characters as necessary. 104For commands inserting text into the middle of a line, any blank characters 105to the right of the cursor are discarded, and the first nonblank character 106to the right of the cursor is aligned as described above. 107@sp 1 108The indent characters are themselves somewhat special. 109If you do not enter more characters on the new line before moving to 110another line, or entering 111@LI{<escape>}, 112the indent character will be deleted and the line will be empty. 113For example, if you enter 114@LI{<carriage-return>}twice in succession, 115the line created by the first 116@LI{<carriage-return>}will not have any characters in it, 117regardless of the indentation of the previous or subsequent line. 118@sp 1 119Indent characters also require that you enter additional erase characters 120to delete them. 121For example, 122if you have an indented line, containing only blanks, the first 123@LI{<word-erase>}character you enter will erase up to end of the indent characters, 124and the second will erase back to the beginning of the line. 125(Historically, only the 126@LI{<control-D>}key would erase the indent characters. 127Both the 128@LI{<control-D>}key and the usual erase keys work in 129@CO{nvi}.) 130In addition, if the cursor is positioned at the end of the indent 131characters, the keys 132@QT{0<control-D>} 133will erase all of the indent characters for the current line, 134resetting the indentation level to 0. 135Similarly, the keys 136@QT{^<control-D>} 137will erase all of the indent characters for the current line, 138leaving the indentation level for future created lines unaffected. 139@sp 1 140Finally, if the 141@OP{autoindent} 142option is set, the 143@CO{S} 144and 145@CO{cc} 146commands change from the first nonblank of the line to the end of the 147line, instead of from the beginning of the line to the end of the line. 148@cindex autoprint 149@IP{autoprint, ap [off]} 150 151@CO{Ex} 152only. 153Cause the current line to be automatically displayed after the 154@CO{ex} 155commands 156@CO{<}, 157@CO{>}, 158@CO{copy}, 159@CO{delete}, 160@CO{join}, 161@CO{move}, 162@CO{put}, 163@CO{t}, 164@CO{Undo}, 165and 166@CO{undo}. 167This automatic display is suppressed during 168@CO{global} 169and 170@CO{v} 171commands, and for any command where optional flags are used to explicitly 172display the line. 173@cindex autowrite 174@IP{autowrite, aw [off]} 175 176If this option is set, the 177@CO{vi} 178@CO{!}, 179@CO{^^}, 180@CO{^]} 181and 182@CO{<control-Z>} 183commands, and the 184@CO{ex} 185@CO{edit}, 186@CO{next}, 187@CO{rewind}, 188@CO{stop}, 189@CO{suspend}, 190@CO{tag}, 191@CO{tagpop}, 192and 193@CO{tagtop} 194commands automatically write the current file back to the current file name 195if it has been modified since it was last written. 196If the write fails, the command fails and goes no further. 197@sp 1 198Appending the optional force flag character 199@QT{!} 200to the 201@CO{ex} 202commands 203@CO{next}, 204@CO{rewind}, 205@CO{stop}, 206@CO{suspend}, 207@CO{tag}, 208@CO{tagpop}, 209and 210@CO{tagtop} 211stops the automatic write from being attempted. 212@sp 1 213(Historically, the 214@CO{next} 215command ignored the optional force flag.) 216Note, the 217@CO{ex} 218commands 219@CO{edit}, 220@CO{quit}, 221@CO{shell}, 222and 223@CO{xit} 224are 225@emph{not} 226affected by the 227@OP{autowrite} 228option. 229@sp 1 230The 231@OP{autowrite} 232option is ignored if the file is considered read-only for any reason. 233@comment I cannot get a double quote to print between the square brackets 234@comment to save my life. The ONLY way I've been able to get this to work 235@comment is with the .tr command. 236@cindex backup 237@IP{backup [""]} 238 239If this option is set, it specifies a pathname used as a backup file, 240and, whenever a file is written, the file's current contents are copied 241to it. 242The pathname is 243@QT{#}, 244@QT{%} 245and 246@QT{!} 247expanded. 248@sp 1 249If the first character of the pathname is 250@QT{N}, 251a version number is appended to the pathname (and the 252@QT{N} 253character is then discarded). 254Version numbers are always incremented, and each backup file will have 255a version number one greater than the highest version number currently 256found in the directory. 257@sp 1 258Backup files must be regular files, owned by the real user ID of the 259user running the editor, and not accessible by any other user. 260@cindex beautify 261@IP{beautify, bf [off]} 262 263If this option is set, all control characters that are not currently being 264specially interpreted, other than 265@LI{<tab>}, 266@LI{<newline>}, 267and 268@LI{<form-feed>}, 269are 270discarded from commands read in by 271@CO{ex} 272from command files, and from input text entered to 273@CO{vi} 274(either into the file or to the colon command line). 275Text files read by 276@EV{ex,vi} 277are 278@emph{not} 279affected by the 280@OP{beautify} 281option. 282@cindex cdpath 283@IP{cdpath [environment variable CDPATH, or current directory]} 284 285This option is used to specify a colon separated list of directories 286which are used as path prefixes for any relative path names used as 287arguments for the 288@CO{cd} 289command. 290The value of this option defaults to the value of the environmental 291variable 292@LI{CDPATH}if it is set, otherwise to the current directory. 293For compatibility with the POSIX 1003.2 shell, the 294@CO{cd} 295command does 296@emph{not} 297check the current directory as a path prefix for relative path names 298unless it is explicitly specified. 299It may be so specified by entering an empty string or a 300@QT{.} 301character into the 302@LI{CDPATH}variable or the option value. 303@cindex cedit 304@IP{cedit [no default]} 305 306This option adds the ability to edit the colon command-line history. 307This option is set to a string. 308Whenever the first character of that string is entered on the colon 309command line, 310you will enter a normal editing window on the collected commands that 311you've entered on the 312@CO{vi} 313colon command-line. 314You may then modify and/or execute the commands. 315All normal text editing is available, 316except that you cannot use 317@CO{<control-W>} 318to switch to an alternate screen. 319Entering a 320@CO{<carriage-return>} 321will execute the current line of the screen window as an ex command in 322the context of the screen from which you created the colon command-line 323screen, 324and you will then return to that screen. 325@sp 1 326Because of 327@CO{vi}'s 328parsing rules, it can be difficult to set the colon command-line edit 329character to the 330@LI{<escape>}character. 331To set it to 332@LI{<escape>}, 333use 334@QT{set cedit=<literal-next><escape>}. 335@sp 1 336If the 337@OP{cedit} 338edit option is set to the same character as the 339@OP{filec} 340edit option, 341@CO{vi} 342will perform colon command-line editing if the character is entered as 343the first character of the line, 344otherwise, 345@CO{vi} 346will perform file name expansion. 347@cindex columns 348@IP{columns, co [80]} 349 350The number of columns in the screen. 351Setting this option causes 352@EV{ex,vi} 353to set (or reset) the environmental variable 354@LI{COLUMNS}. 355See the section entitled 356@QB{Sizing the Screen} 357more information. 358@cindex comment 359@IP{comment [off]} 360 361@CO{Vi} 362only. 363If the first non-empty line of the file begins with the string 364@QT{#}, 365@QT{/*} 366or 367@QT{//}, 368this option causes 369@CO{vi} 370to skip to the end of that shell, C or C++ comment (probably a 371terribly boring legal notice) before displaying the file. 372@cindex directory 373@IP{directory, dir [environment variable TMPDIR, or /tmp]} 374 375The directory where temporary files are created. 376The environmental variable 377@LI{TMPDIR}is used as the default value if it exists, otherwise 378@LI{/tmp}is used. 379@cindex edcompatible 380@IP{edcompatible, ed [off]} 381 382Remember the values of the 383@QQ{c} 384and 385@QQ{g} 386suffixes to the 387@CO{substitute} 388commands, instead of initializing them as unset for each new 389command. 390Specifying pattern and replacement strings to the 391@CO{substitute} 392command unsets the 393@QQ{c} 394and 395@QQ{g} 396suffixes as well. 397@cindex escapetime 398@IP{escapetime [1]} 399 400The 10th's of a second 401@EV{ex,vi} 402waits for a subsequent key to complete an 403@LI{<escape>}key mapping. 404@cindex errorbells 405@IP{errorbells, eb [off]} 406 407@CO{Ex} 408only. 409@CO{Ex} 410error messages are normally presented in inverse video. 411If that is not possible for the terminal, setting this option causes 412error messages to be announced by ringing the terminal bell. 413@cindex expandtab 414@IP{expandtab, et [off]} 415 416Prevent the use of 417@LI{<tab>} 418characters in leading whitespace when shifting text, autoindenting, 419indenting with 420@CO{<control-T>}, 421or outdenting with 422@CO{<control-D>}. 423@cindex exrc 424@IP{exrc, ex [off]} 425 426If this option is turned on in the EXINIT environment variables, 427or the system or $HOME startup files, 428the local startup files are read, 429unless they are the same as the system or $HOME startup files or 430fail to pass the standard permission checks. 431See the section entitled 432@QB{Startup Information} 433for more information. 434@cindex extended 435@IP{extended [off]} 436 437This option causes all regular expressions to be treated as POSIX 4381003.2 Extended Regular Expressions (which are similar to historic 439@XR{egrep,1} 440style expressions). 441@cindex filec 442@IP{filec [no default]} 443 444This option adds the ability to do shell expansion when entering input 445on the colon command line. 446This option is set to a string. 447Whenever the first character of that string is entered on the colon 448command line, 449the <blank> delimited string immediately before the cursor is expanded 450as if it were followed by a 451@LI{*}character, and file name expansion for the 452@CO{ex} 453edit command was done. 454If no match is found, the screen is flashed and text input resumed. 455If a single match results, that match replaces the expanded text. 456In addition, if the single match is for a directory, a 457@LI{/}character is appended and file completion is repeated. 458If more than a single match results, 459any unique prefix shared by the matches replaces the expanded text, 460the matches are displayed, 461and text input resumed. 462@sp 1 463Because of 464@CO{vi}'s 465parsing rules, it can be difficult to set the path completion character 466to two command values, 467@LI{<escape>}and 468@LI{<tab>}. 469To set it to 470@LI{<escape>}, 471use 472@QT{set filec=<literal-next><escape>}. 473To set it to 474@LI{<tab>}, 475use 476@QT{set filec=\e<tab>}. 477@sp 1 478If the 479@OP{cedit} 480edit option is set to the same character as the 481@OP{filec} 482edit option, 483@CO{vi} 484will perform colon command-line editing if the character is entered as 485the first character of the line, 486otherwise, 487@CO{vi} 488will perform file name expansion. 489@cindex flash 490@IP{flash [on]} 491 492This option causes the screen to flash instead of beeping the keyboard, 493on error, if the terminal has the capability. 494@cindex hardtabs 495@IP{hardtabs, ht [8]} 496 497This option defines the spacing between hardware tab settings, i.e. 498the tab expansion done by the operating system and/or the terminal 499itself. 500As 501@EV{nex,nvi} 502never writes 503@LI{<tab>}characters to the terminal, unlike historic versions of 504@EV{ex,vi}, 505this option does not currently have any affect. 506@cindex iclower 507@IP{iclower [off]} 508 509The 510@OP{iclower} 511edit option makes all Regular Expressions case-insensitive, 512as long as an upper-case letter does not appear in the search string. 513@cindex ignorecase 514@IP{ignorecase, ic [off]} 515 516This option causes regular expressions, both in 517@CO{ex} 518commands and in searches, 519to be evaluated in a case-insensitive manner. 520@cindex keytime 521@IP{keytime [6]} 522 523The 10th's of a second 524@EV{ex,vi} 525waits for a subsequent key to complete a key mapping. 526@cindex leftright 527@IP{leftright [off]} 528 529@CO{Vi} 530only. 531This option causes the screen to be scrolled left-right to view 532lines longer than the screen, instead of the traditional 533@CO{vi} 534screen interface which folds long lines at the right-hand margin 535of the terminal. 536@cindex lines 537@IP{lines, li [24]} 538 539@CO{Vi} 540only. 541The number of lines in the screen. 542Setting this option causes 543@EV{ex,vi} 544to set (or reset) the environmental variable 545@LI{LINES}. 546See the section entitled 547@QB{Sizing the Screen} 548for more information. 549@cindex lisp 550@IP{lisp [off]} 551 552@CO{Vi} 553only. 554This option changes the behavior of the 555@CO{vi} 556@CO{(}, 557@CO{)}, 558@strong{@{}, 559@strong{@}}, 560@CO{[[} 561and 562@CO{]]} 563commands to match the Lisp language. 564Also, the 565@OP{autoindent} 566option's behavior is changed to be appropriate for Lisp. 567@sp 1 568@emph{This option is not yet implemented.} 569@cindex list 570@IP{list [off]} 571 572This option causes lines to be displayed in an unambiguous fashion. 573Specifically, tabs are displayed as control characters, i.e. 574@QT{^I}, 575and the ends of lines are marked with a 576@QT{$} 577character. 578@cindex lock 579@IP{lock [on]} 580 581This option causes the editor to attempt to get an exclusive lock on 582any file being edited, read or written. 583Reading or writing a file that cannot be locked produces a warning 584message, but no other effect. 585Editing a file that cannot be locked results in a read only edit session, 586as if the 587@OP{readonly} 588edit option were set. 589@cindex magic 590@IP{magic [on]} 591 592This option is on by default. 593Turning the 594@OP{magic} 595option off causes all regular expression characters except for 596@QT{^} 597and 598@QT{$}, 599to be treated as ordinary characters. 600To re-enable characters individually, when the 601@OP{magic} 602option is off, 603precede them with a backslash 604@QT{\e} 605character. 606See the section entitled 607@QB{Regular Expressions and Replacement Strings} 608for more information. 609@cindex matchchars 610@IP{matchchars [[]@{@}()<>]} 611 612@CO{Vi} 613only. 614This option defines the character pairs used by the 615@CO{%} 616command. 617 618@cindex matchtime 619@IP{matchtime [7]} 620 621@CO{Vi} 622only. 623The 10th's of a second 624@CO{vi} 625pauses on the matching character when the 626@OP{showmatch} 627option is set. 628@cindex mesg 629@IP{mesg [on]} 630 631This option allows other users to contact you using the 632@XR{talk,1} 633and 634@XR{write,1} 635utilities, while you are editing. 636@EV{Ex,vi} 637does not turn message on, i.e. if messages were turned off when the 638editor was invoked, they will stay turned off. 639This option only permits you to disallow messages for the edit session. 640See the 641@XR{mesg,1} 642utility for more information. 643@cindex msgcat 644@IP{msgcat [./]} 645 646This option selects a message catalog to be used to display error and 647informational messages in a specified language. 648If the value of this option ends with a '/', it is treated as the name 649of a directory that contains a message catalog 650@QT{vi_XXXX}, 651where 652@QT{XXXX} 653is the value of the 654@LI{LANG}environmental variable, if it's set, or the value of the 655@LI{LC_MESSAGES}environmental variable if it's not. 656If neither of those environmental variables are set, 657or if the option doesn't end in a '/', 658the option is treated as the full path name of the message catalog to use. 659@sp 1 660If any messages are missing from the catalog, 661the backup text (English) is used instead. 662@sp 1 663See the distribution file 664@LI{catalog/README}for additional information on building and installing message catalogs. 665@cindex modelines 666@IP{modelines, modeline [off]} 667 668If the 669@OP{modelines} 670option is set, 671@EV{ex,vi} 672has historically scanned the first and last five lines of each file as 673it is read for editing, looking for any 674@CO{ex} 675commands that have been placed in those lines. 676After the startup information has been processed, and before the user 677starts editing the file, any commands embedded in the file are executed. 678@sp 1 679Commands were recognized by the letters 680@QQ{e} 681or 682@QQ{v} 683followed by 684@QQ{x} 685or 686@QQ{i}, 687at the beginning of a line or following a tab or space character, 688and followed by a 689@QQ{:}, 690an 691@CO{ex} 692command, and another 693@QQ{:}. 694@sp 1 695This option is a security problem of immense proportions, 696and should not be used under any circumstances. 697@sp 1 698@emph{This option will never be implemented.} 699@comment I cannot get a double quote to print between the square brackets 700@comment to save my life. The ONLY way I've been able to get this to work 701@comment is with the .tr command. 702@cindex noprint 703@IP{noprint [""]} 704 705Characters that are never handled as printable characters. 706By default, the C library function 707@XR{isprint,3} 708is used to determine if a character is printable or not. 709This edit option overrides that decision. 710@cindex number 711@IP{number, nu [off]} 712 713Precede each line displayed with its current line number. 714@cindex octal 715@IP{octal [off]} 716 717Display unknown characters as octal numbers 718@PQ{"\e###"}, 719instead of the default 720hexadecimal 721@PQ{"\ex##"}. 722@cindex open 723@IP{open [on]} 724 725@CO{Ex} 726only. 727If this option is not set, the 728@CO{open} 729and 730@CO{visual} 731commands are disallowed. 732@cindex optimize 733@IP{optimize, opt [on]} 734 735@CO{Vi} 736only. 737Throughput of text is expedited by setting the terminal not to do automatic 738carriage returns when printing more than one (logical) line of output, 739greatly speeding output on terminals without addressable cursors when text 740with leading white space is printed. 741@sp 1 742@emph{This option is not yet implemented.} 743@cindex paragraphs 744@IP{paragraphs, para [IPLPPPQPP LIpplpipbp]} 745 746@CO{Vi} 747only. 748Define additional paragraph boundaries for the 749@CO{@{} 750and 751@strong{@}} 752commands. 753The value of this option must be a character string consisting 754of zero or more character pairs. 755@sp 1 756In the text to be edited, the character string 757@LI{<newline>.<char-pair>}, 758(where 759@LI{<char-pair>}is one of the character pairs in the option's value) 760defines a paragraph boundary. 761For example, if the option were set to 762@LI{LaA<space>##}, 763then all of the following additional paragraph boundaries would be 764recognized: 765@sp 1 766@example 767<newline>.La 768<newline>.A<space> 769<newline>.## 770@end example 771@cindex path 772@IP{path []} 773 774The path option can be used to specify a <colon>-separated list of 775paths, similar to the 776@LI{PATH}environment variable in the shells. 777If this option is set, 778the name of the file to be edited is not an absolute pathname, 779the first component of the filename is not 780@QT{.} 781or 782@QT{..}, 783and the file to be edited doesn't exist in the current directory, 784the elements of the 785@OP{path} 786option are sequentially searched for a file of the specified name. 787If such a file is found, it is edited. 788@comment I cannot get a double quote to print between the square brackets 789@comment to save my life. The ONLY way I've been able to get this to work 790@comment is with the .tr command. 791@cindex print 792@IP{print [""]} 793 794Characters that are always handled as printable characters. 795By default, the C library function 796@XR{isprint,3} 797is used to determine if a character is printable or not. 798This edit option overrides that decision. 799@cindex prompt 800@IP{prompt [on]} 801 802@CO{Ex} 803only. 804This option causes 805@CO{ex} 806to prompt for command input with a 807@QT{:} 808character; when it is not set, no prompt is displayed. 809@cindex readonly 810@IP{readonly, ro [off]} 811 812This option causes a force flag to be required to attempt to write the file. 813Setting this option is equivalent to using the 814@strong{-R} 815command line option, 816or executing the 817@CO{vi} 818program using the name 819@CO{view}. 820@sp 1 821The 822@OP{readonly} 823edit option is not usually persistent, like other edit options. 824If the 825@strong{-R} 826command line option is set, 827@CO{vi} 828is executed as 829@CO{view}, 830or the 831@OP{readonly} 832edit option is explicitly set, 833all files edited in the screen will be marked readonly, 834and the force flag will be required to write them. 835However, if none of these conditions are true, 836or the 837@OP{readonly} 838edit option is explicitly unset, 839then the 840@OP{readonly} 841edit option will toggle based on the write permissions of the file currently 842being edited as of when it is loaded into the edit buffer. 843In other words, the 844@OP{readonly} 845edit option will be set if the current file lacks write permissions, 846and will not be set if the user has write permissions for the file. 847@cindex recdir 848@IP{recdir [/var/tmp/vi.recover]} 849 850The directory where recovery files are stored. 851@sp 1 852If you change the value of 853@OP{recdir}, 854be careful to choose a directory whose contents are not regularly 855deleted. 856Bad choices include directories in memory based filesystems, 857or 858@LI{/tmp}, 859on most systems, 860as their contents are removed when the machine is rebooted. 861@sp 1 862Public directories like 863@LI{/usr/tmp}and 864@LI{/var/tmp}are usually safe, although some sites periodically prune old files 865from them. 866There is no requirement that you use a public directory, 867e.g. a sub-directory of your home directory will work fine. 868@sp 1 869Finally, if you change the value of 870@OP{recdir}, 871you must modify the recovery script to operate in your chosen recovery 872area. 873@sp 1 874See the section entitled 875@QB{Recovery} 876for further information. 877@cindex redraw 878@IP{redraw, re [off]} 879 880@CO{Vi} 881only. 882The editor simulates (using great amounts of output), an intelligent 883terminal on a dumb terminal (e.g. during insertions in 884@CO{vi} 885the characters to the right of the cursor are refreshed as each input 886character is typed). 887@sp 1 888@emph{This option is not yet implemented.} 889@cindex remap 890@IP{remap [on]} 891 892If this option is set, 893it is possible to define macros in terms of other macros. 894Otherwise, each key is only remapped up to one time. 895For example, if 896@QT{A} 897is mapped to 898@QT{B}, 899and 900@QT{B} 901is mapped to 902@QT{C}, 903The keystroke 904@QT{A} 905will be mapped to 906@QT{C} 907if the 908@OP{remap} 909option is set, and to 910@QT{B} 911if it is not set. 912@cindex report 913@IP{report [5]} 914 915Set the threshold of the number of lines that need to be changed or 916yanked before a message will be displayed to the user. 917For everything but the yank command, the value is the largest value 918about which the editor is silent, i.e. by default, 6 lines must be 919deleted before the user is notified. 920However, if the number of lines yanked is greater than 921@emph{or equal to} 922the set value, it is reported to the user. 923@cindex ruler 924@IP{ruler [off]} 925 926@CO{Vi} 927only. 928Display a row/column ruler on the colon command line. 929@cindex scroll 930@IP{scroll, scr [(environment variable LINES - 1) / 2]} 931 932Set the number of lines scrolled by the 933@CO{ex} 934@CO{<control-D>} 935and 936@CO{<end-of-file>} 937commands. 938@sp 1 939Historically, the 940@CO{ex} 941@CO{z} 942command, when specified without a count, used two times the size of the 943scroll value; the POSIX 1003.2 standard specified the window size, which 944is a better choice. 945@cindex searchincr 946@IP{searchincr [off]} 947 948The 949@OP{searchincr} 950edit option makes the search commands 951@CO{/} 952and 953@CO{?} 954incremental, i.e. the screen is updated and the cursor moves to the matching 955text as the search pattern is entered. 956If the search pattern is not found, 957the screen is beeped and the cursor remains on the colon-command line. 958Erasing characters from the search pattern backs the cursor up to the 959previous matching text. 960@cindex sections 961@IP{sections, sect [NHSHH HUnhsh]} 962 963@CO{Vi} 964only. 965Define additional section boundaries for the 966@CO{[[} 967and 968@CO{]]} 969commands. 970The 971@OP{sections} 972option should be set to a character string consisting of zero or 973more character pairs. 974In the text to be edited, the character string 975@LI{<newline>.<char-pair>}, 976(where 977@LI{<char-pair>}is one of the character pairs in the option's value), 978defines a section boundary in the same manner that 979@OP{paragraphs} 980option boundaries are defined. 981@cindex secure 982@IP{secure [off]} 983 984The 985@OP{secure} 986edit option turns off all access to external programs. 987This means that the versions of the 988@CO{read} 989and 990@CO{write} 991commands that filter text through other programs, 992the 993@CO{vi} 994@CO{!} 995and 996@CO{<control-Z>} 997commands, 998the 999@CO{ex} 1000@CO{!}, 1001@CO{script}, 1002@CO{shell}, 1003@CO{stop} 1004and 1005@CO{suspend} 1006commands and file name expansion will not be permitted. 1007Once set, 1008the 1009@OP{secure} 1010edit option may not be unset. 1011@cindex shell 1012@IP{shell, sh [environment variable SHELL, or /bin/sh]} 1013 1014Select the shell used by the editor. 1015The specified path is the pathname of the shell invoked by the 1016@CO{vi} 1017@CO{!} 1018shell escape command and by the 1019@CO{ex} 1020@CO{shell} 1021command. 1022This program is also used to resolve any shell meta-characters in 1023@CO{ex} 1024commands. 1025@comment I cannot get a double quote to print between the square brackets 1026@comment to save my life. The ONLY way I've been able to get this to work 1027@comment is with the .tr command. 1028@cindex shellmeta 1029@comment @IP{shellmeta [~@{[*?@$`'"\e]} 1030@item @strong{shellmeta [~@{[*?$`'"\]} 1031 1032The set of characters that 1033@CO{ex} 1034checks for when doing file name expansion. 1035If any of the specified characters are found in the file name arguments 1036to the 1037@CO{ex} 1038commands, 1039the arguments are expanded using the program defined by the 1040@OP{shell} 1041option. 1042The default set of characters is a union of meta characters 1043from the Version 7 and the Berkeley C shell. 1044@cindex shiftwidth 1045@IP{shiftwidth, sw [8]} 1046 1047Set the autoindent and shift command indentation width. 1048This width is used by the 1049@OP{autoindent} 1050option and by the 1051@CO{<}, 1052@CO{>}, 1053and 1054@CO{shift} 1055commands. 1056@cindex showmatch 1057@IP{showmatch, sm [off]} 1058 1059@CO{Vi} 1060only. 1061This option causes 1062@CO{vi}, 1063when a 1064@comment QT 1065``@code{@}}'' 1066or 1067@QT{)} 1068is entered, to briefly move the cursor the matching 1069@comment QT 1070``@code{@{}'' 1071or 1072@QT{(}. 1073See the 1074@OP{matchtime} 1075option for more information. 1076@cindex showmode 1077@IP{showmode, smd [off]} 1078 1079@CO{Vi} 1080only. 1081This option causes 1082@CO{vi} 1083to display a string identifying the current editor mode on the colon 1084command line. 1085The string is preceded by an asterisk (``*'') if the file has been 1086modified since it was last completely written, 1087@cindex sidescroll 1088@IP{sidescroll [16]} 1089 1090@CO{Vi} 1091only. 1092Sets the number of columns that are shifted to the left or right, 1093when 1094@CO{vi} 1095is doing left-right scrolling and the left or right margin is 1096crossed. 1097See the 1098@OP{leftright} 1099option for more information. 1100@cindex slowopen 1101@IP{slowopen, slow [off]} 1102 1103This option affects the display algorithm used by 1104@CO{vi}, 1105holding off display updating during input of new text to improve 1106throughput when the terminal in use is slow and unintelligent. 1107@sp 1 1108@emph{This option is not yet implemented.} 1109@cindex sourceany 1110@IP{sourceany [off]} 1111 1112If this option is turned on, 1113@CO{vi} 1114historically read startup files that were owned by someone other than 1115the editor user. 1116See the section entitled 1117@QB{Startup Information} 1118for more information. 1119This option is a security problem of immense proportions, 1120and should not be used under any circumstances. 1121@sp 1 1122@emph{This option will never be implemented.} 1123@cindex tabstop 1124@IP{tabstop, ts [8]} 1125 1126This option sets tab widths for the editor display. 1127@cindex taglength 1128@IP{taglength, tl [0]} 1129 1130This option sets the maximum number of characters that are considered 1131significant in a tag name. 1132Setting the value to 0 makes all of the characters in the tag name 1133significant. 1134@cindex tags 1135@IP{tags, tag [tags /var/db/libc.tags /sys/kern/tags]} 1136 1137Sets the list of tags files, in search order, 1138which are used when the editor searches for a tag. 1139@cindex term 1140@IP{term, ttytype, tty [environment variable TERM]} 1141 1142Set the terminal type. 1143Setting this option causes 1144@EV{ex,vi} 1145to set (or reset) the environmental variable 1146@LI{TERM}. 1147@cindex terse 1148@IP{terse [off]} 1149 1150This option has historically made editor messages less verbose. 1151It has no effect in this implementation. 1152See the 1153@OP{verbose} 1154option for more information. 1155@cindex tildeop 1156@IP{tildeop [off]} 1157 1158Modify the 1159@CO{~} 1160command to take an associated motion. 1161@cindex timeout 1162@IP{timeout, to [on]} 1163 1164If this option is set, 1165@EV{ex,vi} 1166waits for a specific period for a subsequent key to complete a key 1167mapping (see the 1168@OP{keytime} 1169option). 1170If the option is not set, the editor waits until enough keys are 1171entered to resolve the ambiguity, regardless of how long it takes. 1172@cindex ttywerase 1173@IP{ttywerase [off]} 1174 1175@CO{Vi} 1176only. 1177This option changes how 1178@CO{vi} 1179does word erase during text input. 1180If this option is set, text is broken up into two classes, 1181blank characters and nonblank characters. 1182Changing from one class to another marks the end of a word. 1183@cindex verbose 1184@IP{verbose [off]} 1185 1186@CO{Vi} 1187only. 1188@CO{Vi} 1189historically bells the terminal for many obvious mistakes, e.g. trying 1190to move past the left-hand margin, or past the end of the file. 1191If this option is set, an error message is displayed for all errors. 1192@cindex w300 1193@IP{w300 [no default]} 1194 1195@CO{Vi} 1196only. 1197Set the window size if the baud rate is less than 1200 baud. 1198See the 1199@OP{window} 1200option for more information. 1201@cindex w1200 1202@IP{w1200 [no default]} 1203 1204@CO{Vi} 1205only. 1206Set the window size if the baud rate is equal to 1200 baud. 1207See the 1208@OP{window} 1209option for more information. 1210@cindex w9600 1211@IP{w9600 [no default]} 1212 1213@CO{Vi} 1214only. 1215Set the window size if the baud rate is greater than 1200 baud. 1216See the 1217@OP{window} 1218option for more information. 1219@cindex warn 1220@IP{warn [on]} 1221 1222@CO{Ex} 1223only. 1224This option causes a warning message to the terminal if the file has 1225been modified, since it was last written, before a 1226@CO{!} 1227command. 1228@cindex window 1229@IP{window, w, wi [environment variable LINES - 1]} 1230 1231This option determines the default number of lines in a screenful, 1232as displayed by the 1233@CO{z} 1234command. 1235It also determines the number of lines scrolled by the 1236@CO{vi} 1237commands 1238@CO{<control-B>} 1239and 1240@CO{<control-F>}, 1241and the default number of lines scrolled by the 1242@CO{vi} 1243commands 1244@CO{<control-D>} 1245and 1246@CO{<control-U>}. 1247The value of window can be unrelated to the real screen size, 1248although it starts out as the number of lines on the screen. 1249See the section entitled 1250@QB{Sizing the Screen} 1251for more information. 1252Setting the value of the 1253@OP{window} 1254option is the same as using the 1255@strong{-w} 1256command line option. 1257@sp 1 1258If the value of the 1259@OP{window} 1260option (as set by the 1261@OP{window}, 1262@OP{w300}, 1263@OP{w1200} 1264or 1265@OP{w9600} 1266options) is smaller than the actual size of the screen, 1267large screen movements will result in displaying only that smaller 1268number of lines on the screen. 1269(Further movements in that same area will result in the screen being 1270filled.) 1271This can provide a performance improvement when viewing different 1272places in one or more files over a slow link. 1273@sp 1 1274Resetting the window size does not reset the default number of lines 1275scrolled by the 1276@CO{<control-D>} 1277and 1278@CO{<control-U>} 1279commands. 1280@cindex windowname 1281@IP{windowname [off]} 1282 1283@CO{Vi} 1284changes the name of the editor's icon/window to the current file name 1285when it's possible and not destructive, i.e., 1286when the editor can restore it to its original value on exit or when 1287the icon/window will be discarded as the editor exits. 1288If the 1289@OP{windowname} 1290edit option is set, 1291@CO{vi} 1292will change the icon/window name even when it's destructive and the 1293icon/window name will remain after the editor exits. 1294(This is the case for 1295@XR{xterm,1}). 1296@cindex wraplen 1297@IP{wraplen, wl [0]} 1298 1299This option is identical to the 1300@OP{wrapmargin} 1301option, with the exception that it specifies the number of columns 1302from the 1303@emph{left} 1304margin before the line splits, not the right margin. 1305@sp 1 1306If both 1307@OP{wraplen} 1308and 1309@OP{wrapmargin} 1310are set, the 1311@OP{wrapmargin} 1312value is used. 1313@cindex wrapmargin 1314@IP{wrapmargin, wm [0]} 1315 1316@CO{Vi} 1317only. 1318If the value of the 1319@OP{wrapmargin} 1320option is non-zero, 1321@CO{vi} 1322will split lines so that they end at least that number of columns 1323before the right-hand margin of the screen. 1324(Note, the value of 1325@OP{wrapmargin} 1326is 1327@emph{not} 1328a text length. 1329In a screen that is 80 columns wide, the command 1330@QT{:set wrapmargin=8} 1331attempts to keep the lines less than or equal to 72 columns wide.) 1332@sp 1 1333Lines are split at the previous whitespace character closest to the 1334number. 1335Any trailing whitespace characters before that character are deleted. 1336If the line is split because of an inserted 1337@LI{<space>}or 1338@LI{<tab>}character, and you then enter another 1339@LI{<space>}character, it is discarded. 1340@sp 1 1341If wrapmargin is set to 0, 1342or if there is no blank character upon which to split the line, 1343the line is not broken. 1344@sp 1 1345If both 1346@OP{wraplen} 1347and 1348@OP{wrapmargin} 1349are set, the 1350@OP{wrapmargin} 1351value is used. 1352@cindex wrapscan 1353@IP{wrapscan, ws [on]} 1354 1355This option causes searches to wrap around the end or the beginning 1356of the file, and back to the starting point. 1357Otherwise, the end or beginning of the file terminates the search. 1358@cindex writeany 1359@IP{writeany, wa [off]} 1360 1361If this option is set, file-overwriting checks that would usually be 1362made before the 1363@CO{write} 1364and 1365@CO{xit} 1366commands, or before an automatic write (see the 1367@OP{autowrite} 1368option), are not made. 1369This allows a write to any file, provided the file permissions allow it. 1370@end itemize 1371