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
100 option) and then using space characters as necessary.
101 For commands inserting text into the middle of a line, any blank characters
102 to the right of the cursor are discarded, and the first nonblank character
103 to the right of the cursor is aligned as described above.
105 The indent characters are themselves somewhat special.
106 If you do not enter more characters on the new line before moving to
107 another line, or entering
109 the indent character will be deleted and the line will be empty.
110 For example, if you enter
111 @LI{<carriage-return>}twice in succession,
112 the line created by the first
113 @LI{<carriage-return>}will not have any characters in it,
114 regardless of the indentation of the previous or subsequent line.
116 Indent characters also require that you enter additional erase characters
119 if you have an indented line, containing only blanks, the first
120 @LI{<word-erase>}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>}key would erase the indent characters.
125 @LI{<control-D>}key and the usual erase keys work in
127 In addition, if the cursor is positioned at the end of the indent
130 will erase all of the indent characters for the current line,
131 resetting the indentation level to 0.
134 will erase all of the indent characters for the current line,
135 leaving the indentation level for future created lines unaffected.
143 commands change from the first nonblank of the line to the end of the
144 line, instead of from the beginning of the line to the end of the line.
146 @IP{autoprint, ap [off]}
150 Cause the current line to be automatically displayed after the
164 This automatic display is suppressed during
168 commands, and for any command where optional flags are used to explicitly
171 @IP{autowrite, aw [off]}
173 If this option is set, the
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.
195 Appending the optional force flag character
208 stops the automatic write from being attempted.
212 command ignored the optional force flag.)
229 option is ignored if the file is considered read-only for any reason.
230 @comment I cannot get a double quote to print between the square brackets
231 @comment to save my life. The ONLY way I've been able to get this to work
232 @comment is with the .tr command.
236 If this option is set, it specifies a pathname used as a backup file,
237 and, whenever a file is written, the file's current contents are copied
246 If the first character of the pathname is
248 a version number is appended to the pathname (and the
250 character is then discarded).
251 Version numbers are always incremented, and each backup file will have
252 a version number one greater than the highest version number currently
253 found in the directory.
255 Backup files must be regular files, owned by the real user ID of the
256 user running the editor, and not accessible by any other user.
258 @IP{beautify, bf [off]}
260 If this option is set, all control characters that are not currently being
261 specially interpreted, other than
267 discarded from commands read in by
269 from command files, and from input text entered to
271 (either into the file or to the colon command line).
280 @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
287 The value of this option defaults to the value of the environmental
289 @LI{CDPATH}if it is set, otherwise to the current directory.
290 For compatibility with the POSIX 1003.2 shell, the
294 check the current directory as a path prefix for relative path names
295 unless it is explicitly specified.
296 It may be so specified by entering an empty string or a
299 @LI{CDPATH}variable or the option value.
301 @IP{cedit [no default]}
303 This option adds the ability to edit the colon command-line history.
304 This option is set to a string.
305 Whenever the first character of that string is entered on the colon
307 you will enter a normal editing window on the collected commands that
308 you've entered on the
311 You may then modify and/or execute the commands.
312 All normal text editing is available,
313 except that you cannot use
315 to switch to an alternate screen.
317 @CO{<carriage-return>}
318 will execute the current line of the screen window as an ex command in
319 the context of the screen from which you created the colon command-line
321 and you will then return to that screen.
325 parsing rules, it can be difficult to set the colon command-line edit
327 @LI{<escape>}character.
331 @QT{set cedit=<literal-next><escape>}.
335 edit option is set to the same character as the
339 will perform colon command-line editing if the character is entered as
340 the first character of the line,
343 will perform file name expansion.
345 @IP{columns, co [80]}
347 The number of columns in the screen.
348 Setting this option causes
350 to set (or reset) the environmental variable
352 See the section entitled
353 @QB{Sizing the Screen}
360 If the first non-empty line of the file begins with the string
367 to skip to the end of that shell, C or C++ comment (probably a
368 terribly boring legal notice) before displaying the file.
370 @IP{directory, dir [environment variable TMPDIR, or /tmp]}
372 The directory where temporary files are created.
373 The environmental variable
374 @LI{TMPDIR}is used as the default value if it exists, otherwise
377 @IP{edcompatible, ed [off]}
379 Remember the values of the
385 commands, instead of initializing them as unset for each new
387 Specifying pattern and replacement strings to the
397 The 10th's of a second
399 waits for a subsequent key to complete an
400 @LI{<escape>}key mapping.
402 @IP{errorbells, eb [off]}
407 error messages are normally presented in inverse video.
408 If that is not possible for the terminal, setting this option causes
409 error messages to be announced by ringing the terminal bell.
413 If this option is turned on in the EXINIT environment variables,
414 or the system or $HOME startup files,
415 the local startup files are read,
416 unless they are the same as the system or $HOME startup files or
417 fail to pass the standard permission checks.
418 See the section entitled
419 @QB{Startup Information}
420 for more information.
424 This option causes all regular expressions to be treated as POSIX
425 1003.2 Extended Regular Expressions (which are similar to historic
429 @IP{filec [no default]}
431 This option adds the ability to do shell expansion when entering input
432 on the colon command line.
433 This option is set to a string.
434 Whenever the first character of that string is entered on the colon
436 the <blank> delimited string immediately before the cursor is expanded
437 as if it were followed by a
438 @LI{*}character, and file name expansion for the
440 edit command was done.
441 If no match is found, the screen is flashed and text input resumed.
442 If a single match results, that match replaces the expanded text.
443 In addition, if the single match is for a directory, a
444 @LI{/}character is appended and file completion is repeated.
445 If more than a single match results,
446 any unique prefix shared by the matches replaces the expanded text,
447 the matches are displayed,
448 and text input resumed.
452 parsing rules, it can be difficult to set the path completion character
453 to two command values,
459 @QT{set filec=<literal-next><escape>}.
463 @QT{set filec=\e<tab>}.
467 edit option is set to the same character as the
471 will perform colon command-line editing if the character is entered as
472 the first character of the line,
475 will perform file name expansion.
479 This option causes the screen to flash instead of beeping the keyboard,
480 on error, if the terminal has the capability.
482 @IP{hardtabs, ht [8]}
484 This option defines the spacing between hardware tab settings, i.e.
485 the tab expansion done by the operating system and/or the terminal
490 @LI{<tab>}characters to the terminal, unlike historic versions of
492 this option does not currently have any affect.
498 edit option makes all Regular Expressions case-insensitive,
499 as long as an upper-case letter does not appear in the search string.
501 @IP{ignorecase, ic [off]}
503 This option causes regular expressions, both in
505 commands and in searches,
506 to be evaluated in a case-insensitive manner.
510 The 10th's of a second
512 waits for a subsequent key to complete a key mapping.
518 This option causes the screen to be scrolled left-right to view
519 lines longer than the screen, instead of the traditional
521 screen interface which folds long lines at the right-hand margin
528 The number of lines in the screen.
529 Setting this option causes
531 to set (or reset) the environmental variable
533 See the section entitled
534 @QB{Sizing the Screen}
535 for more information.
541 This option changes the behavior of the
550 commands to match the Lisp language.
553 option's behavior is changed to be appropriate for Lisp.
555 @emph{This option is not yet implemented.}
559 This option causes lines to be displayed in an unambiguous fashion.
560 Specifically, tabs are displayed as control characters, i.e.
562 and the ends of lines are marked with a
568 This option causes the editor to attempt to get an exclusive lock on
569 any file being edited, read or written.
570 Reading or writing a file that cannot be locked produces a warning
571 message, but no other effect.
572 Editing a file that cannot be locked results in a read only edit session,
575 edit option were set.
579 This option is on by default.
582 option off causes all regular expression characters except for
586 to be treated as ordinary characters.
587 To re-enable characters individually, when the
590 precede them with a backslash
593 See the section entitled
594 @QB{Regular Expressions and Replacement Strings}
595 for more information.
601 The 10th's of a second
603 pauses on the matching character when the
609 This option allows other users to contact you using the
613 utilities, while you are editing.
615 does not turn message on, i.e. if messages were turned off when the
616 editor was invoked, they will stay turned off.
617 This option only permits you to disallow messages for the edit session.
620 utility for more information.
624 This option selects a message catalog to be used to display error and
625 informational messages in a specified language.
626 If the value of this option ends with a '/', it is treated as the name
627 of a directory that contains a message catalog
632 @LI{LANG}environmental variable, if it's set, or the value of the
633 @LI{LC_MESSAGES}environmental variable if it's not.
634 If neither of those environmental variables are set,
635 or if the option doesn't end in a '/',
636 the option is treated as the full path name of the message catalog to use.
638 If any messages are missing from the catalog,
639 the backup text (English) is used instead.
641 See the distribution file
642 @LI{catalog/README}for additional information on building and installing message catalogs.
644 @IP{modelines, modeline [off]}
650 has historically scanned the first and last five lines of each file as
651 it is read for editing, looking for any
653 commands that have been placed in those lines.
654 After the startup information has been processed, and before the user
655 starts editing the file, any commands embedded in the file are executed.
657 Commands were recognized by the letters
665 at the beginning of a line or following a tab or space character,
673 This option is a security problem of immense proportions,
674 and should not be used under any circumstances.
676 @emph{This option will never be implemented.}
677 @comment I cannot get a double quote to print between the square brackets
678 @comment to save my life. The ONLY way I've been able to get this to work
679 @comment is with the .tr command.
683 Characters that are never handled as printable characters.
684 By default, the C library function
686 is used to determine if a character is printable or not.
687 This edit option overrides that decision.
689 @IP{number, nu [off]}
691 Precede each line displayed with its current line number.
695 Display unknown characters as octal numbers
697 instead of the default
705 If this option is not set, the
709 commands are disallowed.
711 @IP{optimize, opt [on]}
715 Throughput of text is expedited by setting the terminal not to do automatic
716 carriage returns when printing more than one (logical) line of output,
717 greatly speeding output on terminals without addressable cursors when text
718 with leading white space is printed.
720 @emph{This option is not yet implemented.}
722 @IP{paragraphs, para [IPLPPPQPP LIpplpipbp]}
726 Define additional paragraph boundaries for the
731 The value of this option must be a character string consisting
732 of zero or more character pairs.
734 In the text to be edited, the character string
735 @LI{<newline>.<char-pair>},
737 @LI{<char-pair>}is one of the character pairs in the option's value)
738 defines a paragraph boundary.
739 For example, if the option were set to
741 then all of the following additional paragraph boundaries would be
752 The path option can be used to specify a <colon>-separated list of
753 paths, similar to the
754 @LI{PATH}environment variable in the shells.
755 If this option is set,
756 the name of the file to be edited is not an absolute pathname,
757 the first component of the filename is not
761 and the file to be edited doesn't exist in the current directory,
764 option are sequentially searched for a file of the specified name.
765 If such a file is found, it is edited.
766 @comment I cannot get a double quote to print between the square brackets
767 @comment to save my life. The ONLY way I've been able to get this to work
768 @comment is with the .tr command.
772 Characters that are always handled as printable characters.
773 By default, the C library function
775 is used to determine if a character is printable or not.
776 This edit option overrides that decision.
784 to prompt for command input with a
786 character; when it is not set, no prompt is displayed.
788 @IP{readonly, ro [off]}
790 This option causes a force flag to be required to attempt to write the file.
791 Setting this option is equivalent to using the
796 program using the name
801 edit option is not usually persistent, like other edit options.
804 command line option is set,
810 edit option is explicitly set,
811 all files edited in the screen will be marked readonly,
812 and the force flag will be required to write them.
813 However, if none of these conditions are true,
816 edit option is explicitly unset,
819 edit option will toggle based on the write permissions of the file currently
820 being edited as of when it is loaded into the edit buffer.
823 edit option will be set if the current file lacks write permissions,
824 and will not be set if the user has write permissions for the file.
826 @IP{recdir [/var/tmp/vi.recover]}
828 The directory where recovery files are stored.
830 If you change the value of
832 be careful to choose a directory whose contents are not regularly
834 Bad choices include directories in memory based filesystems,
838 as their contents are removed when the machine is rebooted.
840 Public directories like
842 @LI{/var/tmp}are usually safe, although some sites periodically prune old files
844 There is no requirement that you use a public directory,
845 e.g. a sub-directory of your home directory will work fine.
847 Finally, if you change the value of
849 you must modify the recovery script to operate in your chosen recovery
852 See the section entitled
854 for further information.
856 @IP{redraw, re [off]}
860 The editor simulates (using great amounts of output), an intelligent
861 terminal on a dumb terminal (e.g. during insertions in
863 the characters to the right of the cursor are refreshed as each input
866 @emph{This option is not yet implemented.}
870 If this option is set,
871 it is possible to define macros in terms of other macros.
872 Otherwise, each key is only remapped up to one time.
887 option is set, and to
893 Set the threshold of the number of lines that need to be changed or
894 yanked before a message will be displayed to the user.
895 For everything but the yank command, the value is the largest value
896 about which the editor is silent, i.e. by default, 6 lines must be
897 deleted before the user is notified.
898 However, if the number of lines yanked is greater than
900 the set value, it is reported to the user.
906 Display a row/column ruler on the colon command line.
908 @IP{scroll, scr [(environment variable LINES - 1) / 2]}
910 Set the number of lines scrolled by the
920 command, when specified without a count, used two times the size of the
921 scroll value; the POSIX 1003.2 standard specified the window size, which
924 @IP{searchincr [off]}
928 edit option makes the search commands
932 incremental, i.e. the screen is updated and the cursor moves to the matching
933 text as the search pattern is entered.
934 If the search pattern is not found,
935 the screen is beeped and the cursor remains on the colon-command line.
936 Erasing characters from the search pattern backs the cursor up to the
937 previous matching text.
939 @IP{sections, sect [NHSHH HUnhsh]}
943 Define additional section boundaries for the
950 option should be set to a character string consisting of zero or
951 more character pairs.
952 In the text to be edited, the character string
953 @LI{<newline>.<char-pair>},
955 @LI{<char-pair>}is one of the character pairs in the option's value),
956 defines a section boundary in the same manner that
958 option boundaries are defined.
964 edit option turns off all access to external programs.
965 This means that the versions of the
969 commands that filter text through other programs,
984 commands and file name expansion will not be permitted.
988 edit option may not be unset.
990 @IP{shell, sh [environment variable SHELL, or /bin/sh]}
992 Select the shell used by the editor.
993 The specified path is the pathname of the shell invoked by the
996 shell escape command and by the
1000 This program is also used to resolve any shell meta-characters in
1003 @comment I cannot get a double quote to print between the square brackets
1004 @comment to save my life. The ONLY way I've been able to get this to work
1005 @comment is with the .tr command.
1007 @comment @IP{shellmeta [~@{[*?@$`'"\e]}
1008 @item @strong{shellmeta [~@{[*?$`'"\]}
1010 The set of characters that
1012 checks for when doing file name expansion.
1013 If any of the specified characters are found in the file name arguments
1017 the arguments are expanded using the program defined by the
1020 The default set of characters is a union of meta characters
1021 from the Version 7 and the Berkeley C shell.
1023 @IP{shiftwidth, sw [8]}
1025 Set the autoindent and shift command indentation width.
1026 This width is used by the
1035 @IP{showmatch, sm [off]}
1046 is entered, to briefly move the cursor the matching
1053 option for more information.
1055 @IP{showmode, smd [off]}
1061 to display a string identifying the current editor mode on the colon
1063 The string is preceded by an asterisk (``*'') if the file has been
1064 modified since it was last completely written,
1066 @IP{sidescroll [16]}
1070 Sets the number of columns that are shifted to the left or right,
1073 is doing left-right scrolling and the left or right margin is
1077 option for more information.
1079 @IP{slowopen, slow [off]}
1081 This option affects the display algorithm used by
1083 holding off display updating during input of new text to improve
1084 throughput when the terminal in use is slow and unintelligent.
1086 @emph{This option is not yet implemented.}
1088 @IP{sourceany [off]}
1090 If this option is turned on,
1092 historically read startup files that were owned by someone other than
1094 See the section entitled
1095 @QB{Startup Information}
1096 for more information.
1097 This option is a security problem of immense proportions,
1098 and should not be used under any circumstances.
1100 @emph{This option will never be implemented.}
1102 @IP{tabstop, ts [8]}
1104 This option sets tab widths for the editor display.
1106 @IP{taglength, tl [0]}
1108 This option sets the maximum number of characters that are considered
1109 significant in a tag name.
1110 Setting the value to 0 makes all of the characters in the tag name
1113 @IP{tags, tag [tags /var/db/libc.tags /sys/kern/tags]}
1115 Sets the list of tags files, in search order,
1116 which are used when the editor searches for a tag.
1118 @IP{term, ttytype, tty [environment variable TERM]}
1120 Set the terminal type.
1121 Setting this option causes
1123 to set (or reset) the environmental variable
1128 This option has historically made editor messages less verbose.
1129 It has no effect in this implementation.
1132 option for more information.
1138 command to take an associated motion.
1140 @IP{timeout, to [on]}
1142 If this option is set,
1144 waits for a specific period for a subsequent key to complete a key
1148 If the option is not set, the editor waits until enough keys are
1149 entered to resolve the ambiguity, regardless of how long it takes.
1151 @IP{ttywerase [off]}
1155 This option changes how
1157 does word erase during text input.
1158 If this option is set, text is broken up into two classes,
1159 blank characters and nonblank characters.
1160 Changing from one class to another marks the end of a word.
1167 historically bells the terminal for many obvious mistakes, e.g. trying
1168 to move past the left-hand margin, or past the end of the file.
1169 If this option is set, an error message is displayed for all errors.
1171 @IP{w300 [no default]}
1175 Set the window size if the baud rate is less than 1200 baud.
1178 option for more information.
1180 @IP{w1200 [no default]}
1184 Set the window size if the baud rate is equal to 1200 baud.
1187 option for more information.
1189 @IP{w9600 [no default]}
1193 Set the window size if the baud rate is greater than 1200 baud.
1196 option for more information.
1202 This option causes a warning message to the terminal if the file has
1203 been modified, since it was last written, before a
1207 @IP{window, w, wi [environment variable LINES - 1]}
1209 This option determines the default number of lines in a screenful,
1213 It also determines the number of lines scrolled by the
1219 and the default number of lines scrolled by the
1225 The value of window can be unrelated to the real screen size,
1226 although it starts out as the number of lines on the screen.
1227 See the section entitled
1228 @QB{Sizing the Screen}
1229 for more information.
1230 Setting the value of the
1232 option is the same as using the
1234 command line option.
1238 option (as set by the
1244 options) is smaller than the actual size of the screen,
1245 large screen movements will result in displaying only that smaller
1246 number of lines on the screen.
1247 (Further movements in that same area will result in the screen being
1249 This can provide a performance improvement when viewing different
1250 places in one or more files over a slow link.
1252 Resetting the window size does not reset the default number of lines
1259 @IP{windowname [off]}
1262 changes the name of the editor's icon/window to the current file name
1263 when it's possible and not destructive, i.e.,
1264 when the editor can restore it to its original value on exit or when
1265 the icon/window will be discarded as the editor exits.
1270 will change the icon/window name even when it's destructive and the
1271 icon/window name will remain after the editor exits.
1272 (This is the case for
1275 @IP{wraplen, wl [0]}
1277 This option is identical to the
1279 option, with the exception that it specifies the number of columns
1282 margin before the line splits, not the right margin.
1292 @IP{wrapmargin, wm [0]}
1300 will split lines so that they end at least that number of columns
1301 before the right-hand margin of the screen.
1307 In a screen that is 80 columns wide, the command
1308 @QT{:set wrapmargin=8}
1309 attempts to keep the lines less than or equal to 72 columns wide.)
1311 Lines are split at the previous whitespace character closest to the
1313 Any trailing whitespace characters before that character are deleted.
1314 If the line is split because of an inserted
1316 @LI{<tab>}character, and you then enter another
1317 @LI{<space>}character, it is discarded.
1319 If wrapmargin is set to 0,
1320 or if there is no blank character upon which to split the line,
1321 the line is not broken.
1331 @IP{wrapscan, ws [on]}
1333 This option causes searches to wrap around the end or the beginning
1334 of the file, and back to the starting point.
1335 Otherwise, the end or beginning of the file terminates the search.
1337 @IP{writeany, wa [off]}
1339 If this option is set, file-overwriting checks that would usually be
1344 commands, or before an automatic write (see the
1346 option), are not made.
1347 This allows a write to any file, provided the file permissions allow it.