2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)set.opt.roff 8.5 (Berkeley) 3/22/94
34 There are a large number of options that may be set (or unset) to
35 change the editor's behavior.
36 This section describes the options, their abbreviations and their
39 In each entry below, the first part of the tag line is the full name
40 of the option, followed by any equivalent abbreviations.
42 (Regardless of the abbreviations, it is only necessary to use the
43 minimum number of characters necessary to distinguish an abbreviation
44 from all other commands for it to be accepted, in
46 Historically, only the full name and the official abbreviations
49 Using full names in your startup files and environmental variables will
50 probably make them more portable.)
52 The part in square brackets is the default value of the option.
53 Most of the options are boolean, i.e. they are either on or off,
54 and do not have an associated value.
60 modes, unless otherwise specified.
63 For information on modifying the options or to display the options and
64 their current values, see the
66 command in the Ex Commands section.
68 .Bl -tag -width "XXXX" -compact
69 .It Li "altwerase [off]"
73 Select an alternate word erase algorithm.
78 does word erase during text input.
79 When this option is set, text is broken up into three classes:
80 alphabetic, numeric and underscore characters, other non-blank
81 characters, and blank characters.
82 Changing from one class to another marks the end of a word.
83 In addition, the class of the first character erased is ignored
84 (which is exactly what you want when erasing pathname components).
86 .It Li "autoindent, ai [off]"
88 Automatically indent new lines.
91 If this option is set, whenever you create a new line (using the
112 commands) the new line is automatically indented to align the cursor with
113 the first non-blank character of the line from which you created it.
114 Lines are indented using tab characters to the extent possible (based on
117 option) and then using space characters as necessary.
118 For commands inserting text into the middle of a line, any blank characters
119 to the right of the cursor are discarded, and the first non-blank character
120 to the right of the cursor is aligned as described above.
122 The indent characters are themselves somewhat special.
123 If you do not enter more characters on the new line before moving moving to
124 another line, or entering <escape>, the indent character will be deleted and
125 the line will be empty.
126 For example, if you enter <carriage-return> twice in succession, the line
127 created by the first <carriage-return> will not have any characters in it,
128 regardless of the indentation of the previous or subsequent line.
130 Indent characters also require that you enter additional erase characters
132 For example, if you have an indented line, containing only blanks, the first
133 <word-erase> character you enter will erase up to end of the indent characters,
134 and the second will erase back to the beginning of the line.
135 (Historically, only the
137 key would erase the indent characters.
140 key and the usual erase keys work in
142 In addition, if the cursor is positioned at the end of the indent
145 will erase all of the indent characters for the current line,
146 resetting the indentation level to 0.
149 (i.e. a carat followed by a <control-D>) will erase all of the indent
150 characters for the current line, leaving the indentation level for
151 future created lines unaffected.
159 commands change from the first non-blank of the line to the end of the
160 line, instead of from the beginning of the line to the end of the line.
162 .It Li "autoprint, ap [off]"
166 Display the current line automatically.
172 Cause the current line to be automatically displayed after the
186 This automatic display is suppressed during
190 commands, and for any command where optional flags are used to explicitly
193 .It Li "autowrite, aw [off]"
195 Write modified files automatically when changing files.
198 If this option is set, the
216 commands automatically write the current file back to the current file name
217 if it has been modified since it was last written.
218 If the write fails, the command fails and goes no further.
220 Appending the optional force flag
233 stops the automatic write from being attempted.
237 command ignored the optional force flag.)
252 .It Li "beautify, bf [off]"
254 Discard control characters.
257 If this option is set, all control characters that are not currently being
258 specially interpreted, other than <tab>, <newline>, and <form-feed>, are
259 discarded from commands read in by
261 from command files, and from input text entered to
263 (either into the file or to the colon command line).
272 .It Li "cdpath [environment variable CDPATH, or ``.'']"
274 The directory paths used as path prefixes for the
279 This option is used to specify a colon separated list of directories
280 which are used as path prefixes for any relative path names used as
284 The value of this option defaults to the value of the environmental
287 if it is set, otherwise to the current directory.
288 For compatibility with the POSIX 1003.2 shell, the
292 check the current directory as a path prefix for relative path names
293 unless it is explicitly specified.
294 It may be so specified by entering an empty string or a
298 variable or the option value.
300 .It Li "columns, co [80]"
302 Set the number of columns in the screen.
305 The number of columns in the screen.
306 Setting this option causes
308 to set (or reset) the environmental variable
310 See the SCREEN SIZING section for more information.
312 .It Li "comment [off]"
316 Skip leading comments in files.
319 If the first non-empty line of the file begins with the string
323 to skip to the end of that C comment (probably a terribly boring
324 legal notice) before displaying the file.
326 .It Li "directory, dir [environment variable TMPDIR, or /tmp]"
328 The directory where temporary files are created.
331 The directory where temporary files are created.
332 The environmental variable
334 is used as the default value if it exists, otherwise
338 .It Li "edcompatible, ed [off]"
340 Modify the behavior of certain suffices for the
346 This option causes the presence or absence of
352 commands to be remembered,
353 and to be toggled by repeating the suffices.
356 makes the substitution be as in the
358 command, instead of like the
363 .Em "This option is not yet implemented."
364 .It Li "errorbells, eb [off]"
368 Precede error messages with a bell.
373 error messages to be preceded by a bell.
376 .Em "This option is not yet implemented."
377 .It Li "exrc, ex [off]"
379 Never read startup files in the local directory.
382 If this option is turned off in the system or $HOME startup files,
383 the local startup files are never read (unless they are the same
384 as the system or $HOME startup files).
385 Turning it on has no effect, i.e. the normal checks for local startup
386 files are performed, regardless.
387 See the STARTUP INFORMATION section for more information.
389 .It Li "extended [off]"
391 Regular expressions are extended (i.e.
396 This option causes all regular expressions to be treated as POSIX
397 1003.2 extended regular expressions (which are similar to historic
403 Flash the screen instead of beeping the keyboard on error.
406 This option causes the screen to flash instead of beeping the keyboard,
407 on error, if the terminal has the capability.
409 .It Li "hardtabs, ht [8]"
411 Set the spacing between hardware tab settings.
414 This option defines the spacing between hardware tab settings, i.e.
415 the tab expansion done by the operating system and/or the terminal
419 never writes tabs to the terminal, unlike historic versions of
421 this option does not currently have any affect.
423 .It Li "ignorecase, ic [off]"
425 Ignore case differences in regular expressions.
428 This option causes regular expressions, both in
430 commands and in searches,
431 to be evaluated in a case-insensitive manner.
434 The 10th's of a second
436 waits for a subsequent key to complete a key mapping.
437 .It Li "leftright [off]"
441 Do left-right scrolling.
444 This option causes the screen to be scrolled left-right to view
445 lines longer than the screen, instead of the traditional
447 screen interface which folds long lines at the right-hand margin
450 .It Li "lines, li [24]"
454 Set the number of lines in the screen.
457 The number of lines in the screen.
458 Setting this option causes
460 to set (or reset) the environmental variable
462 See the Screen Sizing section for more information.
468 Modify various search commands and options to work with Lisp.
471 This option changes the behavior of the
480 commands to match the Lisp language.
483 option's behavior is changed to be appropriate for Lisp.
486 .Em "This option is not yet implemented."
489 Display lines in an unambiguous fashion.
492 This option causes lines to be displayed in an unambiguous fashion.
493 Specifically, tabs are displayed as control characters, i.e.
495 and the ends of lines are marked with a
501 Treat certain characters specially in regular expressions.
504 This option is on by default.
507 option off causes all regular expression characters except for
511 to be treated as ordinary characters.
512 To re-enable characters individually, when the
517 See the REGULAR EXPRESSIONS AND REPLACEMENT STRINGS section for
520 .It Li "matchtime [7]"
523 The 10th's of a second
525 pauses on the matching character when the
530 Permit messages from other users.
533 This option allows other users to contact you using the
537 utilities, while you are editing.
539 does not turn message on, i.e. if messages were turned off when the
540 editor was invoked, they will stay turned off.
541 This option only permits you to disallow messages for the edit session.
544 utility for more information.
546 .It Li "modelines, modeline [off]"
548 Read the first and last few lines of each file for
557 has historically scanned the first and last five lines of each file as
558 it is read for editing, looking for any
560 commands that have been placed in those lines.
561 After the startup information has been processed, and before the user
562 starts editing the file, any commands embedded in the file are executed.
563 Commands are recognized by the letters
571 at the beginning of a line or following a tab or space character,
578 This option is a security problem of immense proportions,
579 and should not be used under any circumstances.
582 .Em "This option will never be implemented."
583 .It Li "number, nu [off]"
584 Precede each line displayed with its current line number.
588 If this option is not set, the
592 commands are disallowed.
593 .It Li "optimize, opt [on]"
597 Optimize text throughput to dumb terminals.
600 Throughput of text is expedited by setting the terminal to no do automatic
601 carriage returns when printing more than one (logical) line of output,
602 greatly speeding output on terminals without addressable cursors when text
603 with leading white space is printed.
606 .Em "This option is not yet implemented."
607 .It Li "paragraphs, para [IPLPPPQPP LIpplpipbp]"
610 Define additional paragraph boundaries for the
616 The value of this option must be a character string consisting
617 of zero or more character pairs.
619 In the text to be edited, the character string <newline>.<char-pair>,
620 (where <char-pair> is one of the character pairs in the option's value)
621 defines a paragraph boundary.
622 For example, if the option were set to
624 then all of the following additional paragraph boundaries would be
626 .Bd -literal -offset indent -compact
636 Display a command prompt.
641 to prompt for command input with a
643 character; when it's not set, no prompt is displayed.
645 .It Li "readonly, ro [off]"
647 Mark the file as read-only.
650 This option causes a force flag to be required to attempt to write
651 the file back to the original file name.
652 Setting this option is equivalent to using the
654 command line option, or editing a file which lacks write permission.
656 .It Li "recdir [/var/tmp/vi.recover]"
657 The directory where recovery files are stored.
658 .It Li "redraw, re [off]"
662 Simulate an intelligent terminal on a dumb one.
665 The editor simulates (using great amounts of output), an intelligent
666 terminal on a dumb terminal (e.g. during insertions in visual mode
667 the characters to the right of the cursor are refreshed as each input
671 .Em "This option is not yet implemented."
674 Remap keys until resolved.
677 If this option is set,
678 it's possible to define macros in terms of other macros.
679 Otherwise, each key is only remapped up to one time.
698 .It Li "remapmax [on]"
700 Limit the number of times a key may be remapped.
703 If this option is set, a key may only be remapped 50 times.
704 If it is not set, a key may be remapped an infinite number of times,
705 and the editor can be placed into infinite loops.
709 Set the number of lines about which the editor reports changes.
712 Set the threshold of the number of lines that need to be changed
713 before a message will be displayed to the user.
714 The value is the largest value about which the editor is silent,
715 i.e. by default, 6 lines must change before the user is notified.
720 Display a row/column ruler on the colon command line.
721 .It Li "scroll, scr [window / 2]"
723 Set the number of lines scrolled.
726 Set the number of lines scrolled by the
736 command, when specified without a count, used two times the size of the
737 scroll value; the POSIX 1003.2 standard specified the window size, which
740 .It Li "sections, sect [NHSHH HUnhsh]"
743 Define additional section boundaries for the
751 option should be set to a character string consisting of zero or
752 more character pairs.
753 In the text to be edited, the character string <newline>.<char-pair>,
754 (where <char-pair> is one of the character pairs in the option's value),
755 defines a section boundary in the same manner that
757 option boundaries are defined.
759 .It Li "shell, sh [environment variable SHELL, or /bin/sh]"
760 Select the shell used by the editor.
762 The specified path is the pathname of the shell invoked by the
765 shell escape command and by the
769 This program is also used to resolve any shell meta-characters in
773 .It Li "shiftwidth, sw [8]"
774 Set the autoindent and shift command indentation width.
776 This width is used by the
785 .It Li "showdirty [off]"
788 Display an asterisk on the colon command line if the file has been modified.
789 .It Li "showmatch, sm [off]"
810 is entered, to briefly move the cursor the matching
816 option for more information.
818 .It Li "showmode [off]"
822 Display the current editor mode (command or input).
827 to display the strings
831 on the colon command line, based on the current mode of the editor.
833 .It Li "sidescroll [16]"
837 Set the amount a left-right scroll will shift.
840 Sets the number of columns that are shifted to the left or right,
843 is doing left-right scrolling and the left or right margin is
847 option for more information.
849 .It Li "slowopen, slow [off]"
851 Delay display updating during text input.
854 This option affects the display algorithm used by
856 holding off display updating during input of new text to improve
857 throughput when the terminal in use is slow and unintelligent.
860 .Em "This option is not yet implemented."
861 .It Li "sourceany [off]"
863 Read startup files not owned by the current user.
866 If this option is turned on,
868 historically read startup files that were owned by someone other than
870 See the STARTUP INFORMATION section for more information.
871 This option is a security problem of immense proportions,
872 and should not be used under any circumstances.
875 .Em "This option will never be implemented."
876 .It Li "tabstop, ts [8]"
877 This option sets tab widths for the editor display.
878 .It Li "taglength, tl [0]"
880 Set the number of significant characters in tag names.
883 This option sets the maximum number of characters that are considered
884 significant in a tag name.
885 Setting the value to 0 makes all of the characters in the tag name
888 .It Li "tags, tag [tags /var/db/libc.tags /sys/kern/tags]"
890 Set the list of tags files.
893 Sets the list of tags files, in search order,
894 which are used when the editor searches for a tag.
896 .It Li "term, ttytype, tty [environment variable TERM]"
897 Set the terminal type.
899 Setting this option causes
901 to set (or reset) the environmental variable
905 This option has historically made editor messages less verbose.
906 It has no effect in this implementation.
910 option for more information.
912 .It Li "timeout, to [on]"
914 Time out on keys which may be mapped.
917 If this option is set,
919 waits for a specific period for a subsequent key to complete a key
923 If the option is not set, the editor waits until enough keys are
924 entered to resolve the ambiguity, regardless of how long it takes.
926 .It Li "ttywerase [off]"
930 Select an alternate erase algorithm.
933 This option changes how
935 does word erase during text input.
936 If this option is set, text is broken up into two classes,
937 blank characters and non-blank characters.
938 Changing from one class to another marks the end of a word.
940 .It Li "verbose [off]"
944 Display an error message for every error.
948 historically bells the terminal for many obvious mistakes, e.g. trying
949 to move past the left-hand margin, or past the end of the file.
950 If this option is set, an error message is displayed for all errors.
952 .It Li "w300 [no default]"
955 Set the window size if the baud rate is less than 1200 baud.
959 option for more information.
961 .It Li "w1200 [no default]"
964 Set the window size if the baud rate is equal to 1200 baud.
968 option for more information.
970 .It Li "w9600 [no default]"
973 Set the window size if the baud rate is greater than 1200 baud.
977 option for more information.
982 This option causes a warning message to the terminal if the file has
983 been modified, since it was last written, before a
986 .It Li "window, w, wi [environment variable LINES]"
988 Set the window size for the screen.
991 This option determines the default number of lines in a screenful,
995 It also determines the number of lines scrolled by the
1001 The value of window can be unrelated to the real screen size,
1002 although it starts out as the number of lines on the screen (see
1003 the SCREEN SIZING section).
1004 Setting the value of the
1006 option is the same as using the
1008 command line option.
1018 options) is smaller than the actual size of the screen, large screen
1019 movements will result in displaying only that smaller number of lines
1021 (Further movements in that same area will result in the screen being
1023 This can provide a performance improvement when viewing different
1024 places in one or more files over a slow link.
1026 .It Li "wrapmargin, wm [0]"
1030 Break lines automatically when they reach the right-hand margin.
1033 If the value of wrapmargin is non-zero,
1035 will break lines, that are more than that number of characters long,
1036 into two lines at the blank character closest to the value.
1038 or if there is no blank character upon which to break the line,
1039 the line will not be broken.
1041 .It Li "wrapscan, ws [on]"
1043 Set searches to wrap around the end or beginning of the file.
1046 This option causes searches to wrap around the end or the beginning
1047 of the file, and back to the starting point.
1048 Otherwise, the end or beginning of the file terminates the search.
1050 .It Li "writeany, wa [off]"
1052 Turn off file-overwriting checks.
1055 If this option is set, file-overwriting checks that would usually be
1060 commands, or before an automatic write (see the
1062 option), are not made.
1063 This allows a write to any file, provided the file permissions allow it.