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