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.
6 @comment See the LICENSE file for redistribution information.
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
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
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
23 Historically, only the full name and the official abbreviations
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.
36 modes, unless otherwise specified.
38 With a few exceptions,
39 all options are settable per screen, i.e. the
41 option can be set differently in each screen.
42 The exceptions are the
49 Changing these options modifies the respective information for all screens.
51 For information on modifying the options or to display the options and
52 their current values, see the
54 command in the section entitled
64 does word erase during text input.
65 When this option is set, text is broken up into three classes:
66 alphabetic, numeric and underscore characters, other nonblank
67 characters, and blank characters.
68 Changing from one class to another marks the end of a word.
69 In addition, the class of the first character erased is ignored
70 (which is exactly what you want when erasing pathname components).
72 @IP{autoindent, ai [off]}
74 If this option is set, whenever you create a new line (using the
95 commands) the new line is automatically indented to align the cursor with
96 the first nonblank character of the line from which you created it.
97 Lines are indented using tab characters to the extent possible (based on
103 is not set) and then using space characters as necessary.
104 For commands inserting text into the middle of a line, any blank characters
105 to the right of the cursor are discarded, and the first nonblank character
106 to the right of the cursor is aligned as described above.
108 The indent characters are themselves somewhat special.
109 If you do not enter more characters on the new line before moving to
110 another line, or entering
112 the indent character will be deleted and the line will be empty.
113 For example, if you enter
114 @LI{<carriage-return>}twice in succession,
115 the line created by the first
116 @LI{<carriage-return>}will not have any characters in it,
117 regardless of the indentation of the previous or subsequent line.
119 Indent characters also require that you enter additional erase characters
122 if 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,
124 and 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.
128 @LI{<control-D>}key and the usual erase keys work in
130 In addition, if the cursor is positioned at the end of the indent
133 will erase all of the indent characters for the current line,
134 resetting the indentation level to 0.
137 will erase all of the indent characters for the current line,
138 leaving the indentation level for future created lines unaffected.
146 commands change from the first nonblank of the line to the end of the
147 line, instead of from the beginning of the line to the end of the line.
149 @IP{autoprint, ap [off]}
153 Cause the current line to be automatically displayed after the
167 This automatic display is suppressed during
171 commands, and for any command where optional flags are used to explicitly
174 @IP{autowrite, aw [off]}
176 If this option is set, the
194 commands automatically write the current file back to the current file name
195 if it has been modified since it was last written.
196 If the write fails, the command fails and goes no further.
198 Appending the optional force flag character
211 stops the automatic write from being attempted.
215 command ignored the optional force flag.)
232 option 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.
239 If this option is set, it specifies a pathname used as a backup file,
240 and, whenever a file is written, the file's current contents are copied
249 If the first character of the pathname is
251 a version number is appended to the pathname (and the
253 character is then discarded).
254 Version numbers are always incremented, and each backup file will have
255 a version number one greater than the highest version number currently
256 found in the directory.
258 Backup files must be regular files, owned by the real user ID of the
259 user running the editor, and not accessible by any other user.
261 @IP{beautify, bf [off]}
263 If this option is set, all control characters that are not currently being
264 specially interpreted, other than
270 discarded from commands read in by
272 from command files, and from input text entered to
274 (either into the file or to the colon command line).
283 @IP{cdpath [environment variable CDPATH, or current directory]}
285 This option is used to specify a colon separated list of directories
286 which are used as path prefixes for any relative path names used as
290 The value of this option defaults to the value of the environmental
292 @LI{CDPATH}if it is set, otherwise to the current directory.
293 For compatibility with the POSIX 1003.2 shell, the
297 check the current directory as a path prefix for relative path names
298 unless it is explicitly specified.
299 It may be so specified by entering an empty string or a
302 @LI{CDPATH}variable or the option value.
304 @IP{cedit [no default]}
306 This option adds the ability to edit the colon command-line history.
307 This option is set to a string.
308 Whenever the first character of that string is entered on the colon
310 you will enter a normal editing window on the collected commands that
311 you've entered on the
314 You may then modify and/or execute the commands.
315 All normal text editing is available,
316 except that you cannot use
318 to switch to an alternate screen.
320 @CO{<carriage-return>}
321 will execute the current line of the screen window as an ex command in
322 the context of the screen from which you created the colon command-line
324 and you will then return to that screen.
328 parsing rules, it can be difficult to set the colon command-line edit
330 @LI{<escape>}character.
334 @QT{set cedit=<literal-next><escape>}.
338 edit option is set to the same character as the
342 will perform colon command-line editing if the character is entered as
343 the first character of the line,
346 will perform file name expansion.
348 @IP{columns, co [80]}
350 The number of columns in the screen.
351 Setting this option causes
353 to set (or reset) the environmental variable
355 See the section entitled
356 @QB{Sizing the Screen}
363 If the first non-empty line of the file begins with the string
370 to skip to the end of that shell, C or C++ comment (probably a
371 terribly boring legal notice) before displaying the file.
373 @IP{directory, dir [environment variable TMPDIR, or /tmp]}
375 The directory where temporary files are created.
376 The environmental variable
377 @LI{TMPDIR}is used as the default value if it exists, otherwise
380 @IP{edcompatible, ed [off]}
382 Remember the values of the
388 commands, instead of initializing them as unset for each new
390 Specifying pattern and replacement strings to the
400 The 10th's of a second
402 waits for a subsequent key to complete an
403 @LI{<escape>}key mapping.
405 @IP{errorbells, eb [off]}
410 error messages are normally presented in inverse video.
411 If that is not possible for the terminal, setting this option causes
412 error messages to be announced by ringing the terminal bell.
414 @IP{expandtab, et [off]}
418 characters in leading whitespace when shifting text, autoindenting,
426 If this option is turned on in the EXINIT environment variables,
427 or the system or $HOME startup files,
428 the local startup files are read,
429 unless they are the same as the system or $HOME startup files or
430 fail to pass the standard permission checks.
431 See the section entitled
432 @QB{Startup Information}
433 for more information.
437 This option causes all regular expressions to be treated as POSIX
438 1003.2 Extended Regular Expressions (which are similar to historic
442 @IP{filec [no default]}
444 This option adds the ability to do shell expansion when entering input
445 on the colon command line.
446 This option is set to a string.
447 Whenever the first character of that string is entered on the colon
449 the <blank> delimited string immediately before the cursor is expanded
450 as if it were followed by a
451 @LI{*}character, and file name expansion for the
453 edit command was done.
454 If no match is found, the screen is flashed and text input resumed.
455 If a single match results, that match replaces the expanded text.
456 In addition, if the single match is for a directory, a
457 @LI{/}character is appended and file completion is repeated.
458 If more than a single match results,
459 any unique prefix shared by the matches replaces the expanded text,
460 the matches are displayed,
461 and text input resumed.
465 parsing rules, it can be difficult to set the path completion character
466 to two command values,
472 @QT{set filec=<literal-next><escape>}.
476 @QT{set filec=\e<tab>}.
480 edit option is set to the same character as the
484 will perform colon command-line editing if the character is entered as
485 the first character of the line,
488 will perform file name expansion.
492 This option causes the screen to flash instead of beeping the keyboard,
493 on error, if the terminal has the capability.
495 @IP{hardtabs, ht [8]}
497 This option defines the spacing between hardware tab settings, i.e.
498 the tab expansion done by the operating system and/or the terminal
503 @LI{<tab>}characters to the terminal, unlike historic versions of
505 this option does not currently have any affect.
511 edit option makes all Regular Expressions case-insensitive,
512 as long as an upper-case letter does not appear in the search string.
514 @IP{ignorecase, ic [off]}
516 This option causes regular expressions, both in
518 commands and in searches,
519 to be evaluated in a case-insensitive manner.
523 The 10th's of a second
525 waits for a subsequent key to complete a key mapping.
531 This option causes the screen to be scrolled left-right to view
532 lines longer than the screen, instead of the traditional
534 screen interface which folds long lines at the right-hand margin
541 The number of lines in the screen.
542 Setting this option causes
544 to set (or reset) the environmental variable
546 See the section entitled
547 @QB{Sizing the Screen}
548 for more information.
554 This option changes the behavior of the
563 commands to match the Lisp language.
566 option's behavior is changed to be appropriate for Lisp.
568 @emph{This option is not yet implemented.}
572 This option causes lines to be displayed in an unambiguous fashion.
573 Specifically, tabs are displayed as control characters, i.e.
575 and the ends of lines are marked with a
581 This option causes the editor to attempt to get an exclusive lock on
582 any file being edited, read or written.
583 Reading or writing a file that cannot be locked produces a warning
584 message, but no other effect.
585 Editing a file that cannot be locked results in a read only edit session,
588 edit option were set.
592 This option is on by default.
595 option off causes all regular expression characters except for
599 to be treated as ordinary characters.
600 To re-enable characters individually, when the
603 precede them with a backslash
606 See the section entitled
607 @QB{Regular Expressions and Replacement Strings}
608 for more information.
610 @IP{matchchars [[]@{@}()<>]}
614 This option defines the character pairs used by the
623 The 10th's of a second
625 pauses on the matching character when the
631 This option allows other users to contact you using the
635 utilities, while you are editing.
637 does not turn message on, i.e. if messages were turned off when the
638 editor was invoked, they will stay turned off.
639 This option only permits you to disallow messages for the edit session.
642 utility for more information.
646 This option selects a message catalog to be used to display error and
647 informational messages in a specified language.
648 If the value of this option ends with a '/', it is treated as the name
649 of a directory that contains a message catalog
654 @LI{LANG}environmental variable, if it's set, or the value of the
655 @LI{LC_MESSAGES}environmental variable if it's not.
656 If neither of those environmental variables are set,
657 or if the option doesn't end in a '/',
658 the option is treated as the full path name of the message catalog to use.
660 If any messages are missing from the catalog,
661 the backup text (English) is used instead.
663 See the distribution file
664 @LI{catalog/README}for additional information on building and installing message catalogs.
666 @IP{modelines, modeline [off]}
672 has historically scanned the first and last five lines of each file as
673 it is read for editing, looking for any
675 commands that have been placed in those lines.
676 After the startup information has been processed, and before the user
677 starts editing the file, any commands embedded in the file are executed.
679 Commands were recognized by the letters
687 at the beginning of a line or following a tab or space character,
695 This option is a security problem of immense proportions,
696 and should not be used under any circumstances.
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.
705 Characters that are never handled as printable characters.
706 By default, the C library function
708 is used to determine if a character is printable or not.
709 This edit option overrides that decision.
711 @IP{number, nu [off]}
713 Precede each line displayed with its current line number.
717 Display unknown characters as octal numbers
719 instead of the default
727 If this option is not set, the
731 commands are disallowed.
733 @IP{optimize, opt [on]}
737 Throughput of text is expedited by setting the terminal not to do automatic
738 carriage returns when printing more than one (logical) line of output,
739 greatly speeding output on terminals without addressable cursors when text
740 with leading white space is printed.
742 @emph{This option is not yet implemented.}
744 @IP{paragraphs, para [IPLPPPQPP LIpplpipbp]}
748 Define additional paragraph boundaries for the
753 The value of this option must be a character string consisting
754 of zero or more character pairs.
756 In the text to be edited, the character string
757 @LI{<newline>.<char-pair>},
759 @LI{<char-pair>}is one of the character pairs in the option's value)
760 defines a paragraph boundary.
761 For example, if the option were set to
763 then all of the following additional paragraph boundaries would be
774 The path option can be used to specify a <colon>-separated list of
775 paths, similar to the
776 @LI{PATH}environment variable in the shells.
777 If this option is set,
778 the name of the file to be edited is not an absolute pathname,
779 the first component of the filename is not
783 and the file to be edited doesn't exist in the current directory,
786 option are sequentially searched for a file of the specified name.
787 If 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.
794 Characters that are always handled as printable characters.
795 By default, the C library function
797 is used to determine if a character is printable or not.
798 This edit option overrides that decision.
806 to prompt for command input with a
808 character; when it is not set, no prompt is displayed.
810 @IP{readonly, ro [off]}
812 This option causes a force flag to be required to attempt to write the file.
813 Setting this option is equivalent to using the
818 program using the name
823 edit option is not usually persistent, like other edit options.
826 command line option is set,
832 edit option is explicitly set,
833 all files edited in the screen will be marked readonly,
834 and the force flag will be required to write them.
835 However, if none of these conditions are true,
838 edit option is explicitly unset,
841 edit option will toggle based on the write permissions of the file currently
842 being edited as of when it is loaded into the edit buffer.
845 edit option will be set if the current file lacks write permissions,
846 and will not be set if the user has write permissions for the file.
848 @IP{recdir [/var/tmp/vi.recover]}
850 The directory where recovery files are stored.
852 If you change the value of
854 be careful to choose a directory whose contents are not regularly
856 Bad choices include directories in memory based filesystems,
860 as their contents are removed when the machine is rebooted.
862 Public directories like
864 @LI{/var/tmp}are usually safe, although some sites periodically prune old files
866 There is no requirement that you use a public directory,
867 e.g. a sub-directory of your home directory will work fine.
869 Finally, if you change the value of
871 you must modify the recovery script to operate in your chosen recovery
874 See the section entitled
876 for further information.
878 @IP{redraw, re [off]}
882 The editor simulates (using great amounts of output), an intelligent
883 terminal on a dumb terminal (e.g. during insertions in
885 the characters to the right of the cursor are refreshed as each input
888 @emph{This option is not yet implemented.}
892 If this option is set,
893 it is possible to define macros in terms of other macros.
894 Otherwise, each key is only remapped up to one time.
909 option is set, and to
915 Set the threshold of the number of lines that need to be changed or
916 yanked before a message will be displayed to the user.
917 For everything but the yank command, the value is the largest value
918 about which the editor is silent, i.e. by default, 6 lines must be
919 deleted before the user is notified.
920 However, if the number of lines yanked is greater than
922 the set value, it is reported to the user.
928 Display a row/column ruler on the colon command line.
930 @IP{scroll, scr [(environment variable LINES - 1) / 2]}
932 Set the number of lines scrolled by the
942 command, when specified without a count, used two times the size of the
943 scroll value; the POSIX 1003.2 standard specified the window size, which
946 @IP{searchincr [off]}
950 edit option makes the search commands
954 incremental, i.e. the screen is updated and the cursor moves to the matching
955 text as the search pattern is entered.
956 If the search pattern is not found,
957 the screen is beeped and the cursor remains on the colon-command line.
958 Erasing characters from the search pattern backs the cursor up to the
959 previous matching text.
961 @IP{sections, sect [NHSHH HUnhsh]}
965 Define additional section boundaries for the
972 option should be set to a character string consisting of zero or
973 more character pairs.
974 In the text to be edited, the character string
975 @LI{<newline>.<char-pair>},
977 @LI{<char-pair>}is one of the character pairs in the option's value),
978 defines a section boundary in the same manner that
980 option boundaries are defined.
986 edit option turns off all access to external programs.
987 This means that the versions of the
991 commands that filter text through other programs,
1006 commands and file name expansion will not be permitted.
1010 edit option may not be unset.
1012 @IP{shell, sh [environment variable SHELL, or /bin/sh]}
1014 Select the shell used by the editor.
1015 The specified path is the pathname of the shell invoked by the
1018 shell escape command and by the
1022 This program is also used to resolve any shell meta-characters in
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.
1029 @comment @IP{shellmeta [~@{[*?@$`'"\e]}
1030 @item @strong{shellmeta [~@{[*?$`'"\]}
1032 The set of characters that
1034 checks for when doing file name expansion.
1035 If any of the specified characters are found in the file name arguments
1039 the arguments are expanded using the program defined by the
1042 The default set of characters is a union of meta characters
1043 from the Version 7 and the Berkeley C shell.
1045 @IP{shiftwidth, sw [8]}
1047 Set the autoindent and shift command indentation width.
1048 This width is used by the
1057 @IP{showmatch, sm [off]}
1068 is entered, to briefly move the cursor the matching
1075 option for more information.
1077 @IP{showmode, smd [off]}
1083 to display a string identifying the current editor mode on the colon
1085 The string is preceded by an asterisk (``*'') if the file has been
1086 modified since it was last completely written,
1088 @IP{sidescroll [16]}
1092 Sets the number of columns that are shifted to the left or right,
1095 is doing left-right scrolling and the left or right margin is
1099 option for more information.
1101 @IP{slowopen, slow [off]}
1103 This option affects the display algorithm used by
1105 holding off display updating during input of new text to improve
1106 throughput when the terminal in use is slow and unintelligent.
1108 @emph{This option is not yet implemented.}
1110 @IP{sourceany [off]}
1112 If this option is turned on,
1114 historically read startup files that were owned by someone other than
1116 See the section entitled
1117 @QB{Startup Information}
1118 for more information.
1119 This option is a security problem of immense proportions,
1120 and should not be used under any circumstances.
1122 @emph{This option will never be implemented.}
1124 @IP{tabstop, ts [8]}
1126 This option sets tab widths for the editor display.
1128 @IP{taglength, tl [0]}
1130 This option sets the maximum number of characters that are considered
1131 significant in a tag name.
1132 Setting the value to 0 makes all of the characters in the tag name
1135 @IP{tags, tag [tags /var/db/libc.tags /sys/kern/tags]}
1137 Sets the list of tags files, in search order,
1138 which are used when the editor searches for a tag.
1140 @IP{term, ttytype, tty [environment variable TERM]}
1142 Set the terminal type.
1143 Setting this option causes
1145 to set (or reset) the environmental variable
1150 This option has historically made editor messages less verbose.
1151 It has no effect in this implementation.
1154 option for more information.
1160 command to take an associated motion.
1162 @IP{timeout, to [on]}
1164 If this option is set,
1166 waits for a specific period for a subsequent key to complete a key
1170 If the option is not set, the editor waits until enough keys are
1171 entered to resolve the ambiguity, regardless of how long it takes.
1173 @IP{ttywerase [off]}
1177 This option changes how
1179 does word erase during text input.
1180 If this option is set, text is broken up into two classes,
1181 blank characters and nonblank characters.
1182 Changing from one class to another marks the end of a word.
1189 historically bells the terminal for many obvious mistakes, e.g. trying
1190 to move past the left-hand margin, or past the end of the file.
1191 If this option is set, an error message is displayed for all errors.
1193 @IP{w300 [no default]}
1197 Set the window size if the baud rate is less than 1200 baud.
1200 option for more information.
1202 @IP{w1200 [no default]}
1206 Set the window size if the baud rate is equal to 1200 baud.
1209 option for more information.
1211 @IP{w9600 [no default]}
1215 Set the window size if the baud rate is greater than 1200 baud.
1218 option for more information.
1224 This option causes a warning message to the terminal if the file has
1225 been modified, since it was last written, before a
1229 @IP{window, w, wi [environment variable LINES - 1]}
1231 This option determines the default number of lines in a screenful,
1235 It also determines the number of lines scrolled by the
1241 and the default number of lines scrolled by the
1247 The value of window can be unrelated to the real screen size,
1248 although it starts out as the number of lines on the screen.
1249 See the section entitled
1250 @QB{Sizing the Screen}
1251 for more information.
1252 Setting the value of the
1254 option is the same as using the
1256 command line option.
1260 option (as set by the
1266 options) is smaller than the actual size of the screen,
1267 large screen movements will result in displaying only that smaller
1268 number of lines on the screen.
1269 (Further movements in that same area will result in the screen being
1271 This can provide a performance improvement when viewing different
1272 places in one or more files over a slow link.
1274 Resetting the window size does not reset the default number of lines
1281 @IP{windowname [off]}
1284 changes the name of the editor's icon/window to the current file name
1285 when it's possible and not destructive, i.e.,
1286 when the editor can restore it to its original value on exit or when
1287 the icon/window will be discarded as the editor exits.
1292 will change the icon/window name even when it's destructive and the
1293 icon/window name will remain after the editor exits.
1294 (This is the case for
1297 @IP{wraplen, wl [0]}
1299 This option is identical to the
1301 option, with the exception that it specifies the number of columns
1304 margin before the line splits, not the right margin.
1314 @IP{wrapmargin, wm [0]}
1322 will split lines so that they end at least that number of columns
1323 before the right-hand margin of the screen.
1329 In a screen that is 80 columns wide, the command
1330 @QT{:set wrapmargin=8}
1331 attempts to keep the lines less than or equal to 72 columns wide.)
1333 Lines are split at the previous whitespace character closest to the
1335 Any trailing whitespace characters before that character are deleted.
1336 If the line is split because of an inserted
1338 @LI{<tab>}character, and you then enter another
1339 @LI{<space>}character, it is discarded.
1341 If wrapmargin is set to 0,
1342 or if there is no blank character upon which to split the line,
1343 the line is not broken.
1353 @IP{wrapscan, ws [on]}
1355 This option causes searches to wrap around the end or the beginning
1356 of the file, and back to the starting point.
1357 Otherwise, the end or beginning of the file terminates the search.
1359 @IP{writeany, wa [off]}
1361 If this option is set, file-overwriting checks that would usually be
1366 commands, or before an automatic write (see the
1368 option), are not made.
1369 This allows a write to any file, provided the file permissions allow it.