1 @comment Copyright (c) 1994
2 @c $NetBSD: set.opt.texi,v 1.3 2008/10/02 15:39:43 christos Exp $
3 @comment The Regents of the University of California. All rights reserved.
4 @comment Copyright (c) 1994, 1995, 1996
5 @comment Keith Bostic. All rights reserved.
7 @comment See the LICENSE file for redistribution information.
9 @comment Id: set.opt.texi,v 8.1 2001/08/18 20:43:48 skimo Exp (Berkeley) Date: 2001/08/18 20:43:48
13 There are a large number of options that may be set (or unset) to
14 change the editor's behavior.
15 This section describes the options, their abbreviations and their
18 In each entry below, the first part of the tag line is the full name
19 of the option, followed by any equivalent abbreviations.
20 (Regardless of the abbreviations, it is only necessary to use the
21 minimum number of characters necessary to distinguish an abbreviation
22 from all other commands for it to be accepted, in
24 Historically, only the full name and the official abbreviations
27 Using full names in your startup files and environmental variables will
28 probably make them more portable.)
29 The part in square brackets is the default value of the option.
30 Most of the options are boolean, i.e. they are either on or off,
31 and do not have an associated value.
37 modes, unless otherwise specified.
39 With a few exceptions,
40 all options are settable per screen, i.e. the
42 option can be set differently in each screen.
43 The exceptions are the
50 Changing these options modifies the respective information for all screens.
52 For information on modifying the options or to display the options and
53 their current values, see the
55 command in the section entitled
65 does word erase during text input.
66 When this option is set, text is broken up into three classes:
67 alphabetic, numeric and underscore characters, other nonblank
68 characters, and blank characters.
69 Changing from one class to another marks the end of a word.
70 In addition, the class of the first character erased is ignored
71 (which is exactly what you want when erasing pathname components).
73 @IP{autoindent, ai [off]}
75 If this option is set, whenever you create a new line (using the
96 commands) the new line is automatically indented to align the cursor with
97 the first nonblank character of the line from which you created it.
98 Lines are indented using tab characters to the extent possible (based on
104 is not set) and then using space characters as necessary.
105 For commands inserting text into the middle of a line, any blank characters
106 to the right of the cursor are discarded, and the first nonblank character
107 to the right of the cursor is aligned as described above.
109 The indent characters are themselves somewhat special.
110 If you do not enter more characters on the new line before moving to
111 another line, or entering
113 the indent character will be deleted and the line will be empty.
114 For example, if you enter
115 @LI{<carriage-return>}twice in succession,
116 the line created by the first
117 @LI{<carriage-return>}will not have any characters in it,
118 regardless of the indentation of the previous or subsequent line.
120 Indent characters also require that you enter additional erase characters
123 if you have an indented line, containing only blanks, the first
124 @LI{<word-erase>}character you enter will erase up to end of the indent characters,
125 and the second will erase back to the beginning of the line.
126 (Historically, only the
127 @LI{<control-D>}key would erase the indent characters.
129 @LI{<control-D>}key and the usual erase keys work in
131 In addition, if the cursor is positioned at the end of the indent
134 will erase all of the indent characters for the current line,
135 resetting the indentation level to 0.
138 will erase all of the indent characters for the current line,
139 leaving the indentation level for future created lines unaffected.
147 commands change from the first nonblank of the line to the end of the
148 line, instead of from the beginning of the line to the end of the line.
150 @IP{autoprint, ap [off]}
154 Cause the current line to be automatically displayed after the
168 This automatic display is suppressed during
172 commands, and for any command where optional flags are used to explicitly
175 @IP{autowrite, aw [off]}
177 If this option is set, the
195 commands automatically write the current file back to the current file name
196 if it has been modified since it was last written.
197 If the write fails, the command fails and goes no further.
199 Appending the optional force flag character
212 stops the automatic write from being attempted.
216 command ignored the optional force flag.)
233 option is ignored if the file is considered read-only for any reason.
234 @comment I cannot get a double quote to print between the square brackets
235 @comment to save my life. The ONLY way I've been able to get this to work
236 @comment is with the .tr command.
240 If this option is set, it specifies a pathname used as a backup file,
241 and, whenever a file is written, the file's current contents are copied
250 If the first character of the pathname is
252 a version number is appended to the pathname (and the
254 character is then discarded).
255 Version numbers are always incremented, and each backup file will have
256 a version number one greater than the highest version number currently
257 found in the directory.
259 Backup files must be regular files, owned by the real user ID of the
260 user running the editor, and not accessible by any other user.
262 @IP{beautify, bf [off]}
264 If this option is set, all control characters that are not currently being
265 specially interpreted, other than
271 discarded from commands read in by
273 from command files, and from input text entered to
275 (either into the file or to the colon command line).
284 @IP{cdpath [environment variable CDPATH, or current directory]}
286 This option is used to specify a colon separated list of directories
287 which are used as path prefixes for any relative path names used as
291 The value of this option defaults to the value of the environmental
293 @LI{CDPATH}if it is set, otherwise to the current directory.
294 For compatibility with the POSIX 1003.2 shell, the
298 check the current directory as a path prefix for relative path names
299 unless it is explicitly specified.
300 It may be so specified by entering an empty string or a
303 @LI{CDPATH}variable or the option value.
305 @IP{cedit [no default]}
307 This option adds the ability to edit the colon command-line history.
308 This option is set to a string.
309 Whenever the first character of that string is entered on the colon
311 you will enter a normal editing window on the collected commands that
312 you've entered on the
315 You may then modify and/or execute the commands.
316 All normal text editing is available,
317 except that you cannot use
319 to switch to an alternate screen.
321 @CO{<carriage-return>}
322 will execute the current line of the screen window as an ex command in
323 the context of the screen from which you created the colon command-line
325 and you will then return to that screen.
329 parsing rules, it can be difficult to set the colon command-line edit
331 @LI{<escape>}character.
335 @QT{set cedit=<literal-next><escape>}.
339 edit option is set to the same character as the
343 will perform colon command-line editing if the character is entered as
344 the first character of the line,
347 will perform file name expansion.
349 @IP{columns, co [80]}
351 The number of columns in the screen.
352 Setting this option causes
354 to set (or reset) the environmental variable
356 See the section entitled
357 @QB{Sizing the Screen}
364 If the first non-empty line of the file begins with the string
371 to skip to the end of that shell, C or C++ comment (probably a
372 terribly boring legal notice) before displaying the file.
374 @IP{directory, dir [environment variable TMPDIR, or /tmp]}
376 The directory where temporary files are created.
377 The environmental variable
378 @LI{TMPDIR}is used as the default value if it exists, otherwise
381 @IP{edcompatible, ed [off]}
383 Remember the values of the
389 commands, instead of initializing them as unset for each new
391 Specifying pattern and replacement strings to the
401 The 10th's of a second
403 waits for a subsequent key to complete an
404 @LI{<escape>}key mapping.
406 @IP{errorbells, eb [off]}
411 error messages are normally presented in inverse video.
412 If that is not possible for the terminal, setting this option causes
413 error messages to be announced by ringing the terminal bell.
415 @IP{expandtab, et [off]}
419 characters in leading whitespace when shifting text, autoindenting,
427 If this option is turned on in the EXINIT environment variables,
428 or the system or $HOME startup files,
429 the local startup files are read,
430 unless they are the same as the system or $HOME startup files or
431 fail to pass the standard permission checks.
432 See the section entitled
433 @QB{Startup Information}
434 for more information.
438 This option causes all regular expressions to be treated as POSIX
439 1003.2 Extended Regular Expressions (which are similar to historic
443 @IP{filec [no default]}
445 This option adds the ability to do shell expansion when entering input
446 on the colon command line.
447 This option is set to a string.
448 Whenever the first character of that string is entered on the colon
450 the <blank> delimited string immediately before the cursor is expanded
451 as if it were followed by a
452 @LI{*}character, and file name expansion for the
454 edit command was done.
455 If no match is found, the screen is flashed and text input resumed.
456 If a single match results, that match replaces the expanded text.
457 In addition, if the single match is for a directory, a
458 @LI{/}character is appended and file completion is repeated.
459 If more than a single match results,
460 any unique prefix shared by the matches replaces the expanded text,
461 the matches are displayed,
462 and text input resumed.
466 parsing rules, it can be difficult to set the path completion character
467 to two command values,
473 @QT{set filec=<literal-next><escape>}.
477 @QT{set filec=\e<tab>}.
481 edit option is set to the same character as the
485 will perform colon command-line editing if the character is entered as
486 the first character of the line,
489 will perform file name expansion.
493 This option causes the screen to flash instead of beeping the keyboard,
494 on error, if the terminal has the capability.
496 @IP{hardtabs, ht [8]}
498 This option defines the spacing between hardware tab settings, i.e.
499 the tab expansion done by the operating system and/or the terminal
504 @LI{<tab>}characters to the terminal, unlike historic versions of
506 this option does not currently have any affect.
512 edit option makes all Regular Expressions case-insensitive,
513 as long as an upper-case letter does not appear in the search string.
515 @IP{ignorecase, ic [off]}
517 This option causes regular expressions, both in
519 commands and in searches,
520 to be evaluated in a case-insensitive manner.
524 The 10th's of a second
526 waits for a subsequent key to complete a key mapping.
532 This option causes the screen to be scrolled left-right to view
533 lines longer than the screen, instead of the traditional
535 screen interface which folds long lines at the right-hand margin
542 The number of lines in the screen.
543 Setting this option causes
545 to set (or reset) the environmental variable
547 See the section entitled
548 @QB{Sizing the Screen}
549 for more information.
555 This option changes the behavior of the
564 commands to match the Lisp language.
567 option's behavior is changed to be appropriate for Lisp.
569 @emph{This option is not yet implemented.}
573 This option causes lines to be displayed in an unambiguous fashion.
574 Specifically, tabs are displayed as control characters, i.e.
576 and the ends of lines are marked with a
582 This option causes the editor to attempt to get an exclusive lock on
583 any file being edited, read or written.
584 Reading or writing a file that cannot be locked produces a warning
585 message, but no other effect.
586 Editing a file that cannot be locked results in a read only edit session,
589 edit option were set.
593 This option is on by default.
596 option off causes all regular expression characters except for
600 to be treated as ordinary characters.
601 To re-enable characters individually, when the
604 precede them with a backslash
607 See the section entitled
608 @QB{Regular Expressions and Replacement Strings}
609 for more information.
611 @IP{matchchars [[]@{@}()<>]}
615 This option defines the character pairs used by the
624 The 10th's of a second
626 pauses on the matching character when the
632 This option allows other users to contact you using the
636 utilities, while you are editing.
638 does not turn message on, i.e. if messages were turned off when the
639 editor was invoked, they will stay turned off.
640 This option only permits you to disallow messages for the edit session.
643 utility for more information.
647 This option selects a message catalog to be used to display error and
648 informational messages in a specified language.
649 If the value of this option ends with a '/', it is treated as the name
650 of a directory that contains a message catalog
655 @LI{LANG}environmental variable, if it's set, or the value of the
656 @LI{LC_MESSAGES}environmental variable if it's not.
657 If neither of those environmental variables are set,
658 or if the option doesn't end in a '/',
659 the option is treated as the full path name of the message catalog to use.
661 If any messages are missing from the catalog,
662 the backup text (English) is used instead.
664 See the distribution file
665 @LI{catalog/README}for additional information on building and installing message catalogs.
667 @IP{modelines, modeline [off]}
673 has historically scanned the first and last five lines of each file as
674 it is read for editing, looking for any
676 commands that have been placed in those lines.
677 After the startup information has been processed, and before the user
678 starts editing the file, any commands embedded in the file are executed.
680 Commands were recognized by the letters
688 at the beginning of a line or following a tab or space character,
696 This option is a security problem of immense proportions,
697 and should not be used under any circumstances.
699 @emph{This option will never be implemented.}
700 @comment I cannot get a double quote to print between the square brackets
701 @comment to save my life. The ONLY way I've been able to get this to work
702 @comment is with the .tr command.
706 Characters that are never handled as printable characters.
707 By default, the C library function
709 is used to determine if a character is printable or not.
710 This edit option overrides that decision.
712 @IP{number, nu [off]}
714 Precede each line displayed with its current line number.
718 Display unknown characters as octal numbers
720 instead of the default
728 If this option is not set, the
732 commands are disallowed.
734 @IP{optimize, opt [on]}
738 Throughput of text is expedited by setting the terminal not to do automatic
739 carriage returns when printing more than one (logical) line of output,
740 greatly speeding output on terminals without addressable cursors when text
741 with leading white space is printed.
743 @emph{This option is not yet implemented.}
745 @IP{paragraphs, para [IPLPPPQPP LIpplpipbp]}
749 Define additional paragraph boundaries for the
754 The value of this option must be a character string consisting
755 of zero or more character pairs.
757 In the text to be edited, the character string
758 @LI{<newline>.<char-pair>},
760 @LI{<char-pair>}is one of the character pairs in the option's value)
761 defines a paragraph boundary.
762 For example, if the option were set to
764 then all of the following additional paragraph boundaries would be
775 The path option can be used to specify a <colon>-separated list of
776 paths, similar to the
777 @LI{PATH}environment variable in the shells.
778 If this option is set,
779 the name of the file to be edited is not an absolute pathname,
780 the first component of the filename is not
784 and the file to be edited doesn't exist in the current directory,
787 option are sequentially searched for a file of the specified name.
788 If such a file is found, it is edited.
789 @comment I cannot get a double quote to print between the square brackets
790 @comment to save my life. The ONLY way I've been able to get this to work
791 @comment is with the .tr command.
795 Characters that are always handled as printable characters.
796 By default, the C library function
798 is used to determine if a character is printable or not.
799 This edit option overrides that decision.
807 to prompt for command input with a
809 character; when it is not set, no prompt is displayed.
811 @IP{readonly, ro [off]}
813 This option causes a force flag to be required to attempt to write the file.
814 Setting this option is equivalent to using the
819 program using the name
824 edit option is not usually persistent, like other edit options.
827 command line option is set,
833 edit option is explicitly set,
834 all files edited in the screen will be marked readonly,
835 and the force flag will be required to write them.
836 However, if none of these conditions are true,
839 edit option is explicitly unset,
842 edit option will toggle based on the write permissions of the file currently
843 being edited as of when it is loaded into the edit buffer.
846 edit option will be set if the current file lacks write permissions,
847 and will not be set if the user has write permissions for the file.
849 @IP{recdir [/var/tmp/vi.recover]}
851 The directory where recovery files are stored.
853 If you change the value of
855 be careful to choose a directory whose contents are not regularly
857 Bad choices include directories in memory based filesystems,
861 as their contents are removed when the machine is rebooted.
863 Public directories like
865 @LI{/var/tmp}are usually safe, although some sites periodically prune old files
867 There is no requirement that you use a public directory,
868 e.g. a sub-directory of your home directory will work fine.
870 Finally, if you change the value of
872 you must modify the recovery script to operate in your chosen recovery
875 See the section entitled
877 for further information.
879 @IP{redraw, re [off]}
883 The editor simulates (using great amounts of output), an intelligent
884 terminal on a dumb terminal (e.g. during insertions in
886 the characters to the right of the cursor are refreshed as each input
889 @emph{This option is not yet implemented.}
893 If this option is set,
894 it is possible to define macros in terms of other macros.
895 Otherwise, each key is only remapped up to one time.
910 option is set, and to
916 Set the threshold of the number of lines that need to be changed or
917 yanked before a message will be displayed to the user.
918 For everything but the yank command, the value is the largest value
919 about which the editor is silent, i.e. by default, 6 lines must be
920 deleted before the user is notified.
921 However, if the number of lines yanked is greater than
923 the set value, it is reported to the user.
929 Display a row/column ruler on the colon command line.
931 @IP{scroll, scr [(environment variable LINES - 1) / 2]}
933 Set the number of lines scrolled by the
943 command, when specified without a count, used two times the size of the
944 scroll value; the POSIX 1003.2 standard specified the window size, which
947 @IP{searchincr [off]}
951 edit option makes the search commands
955 incremental, i.e. the screen is updated and the cursor moves to the matching
956 text as the search pattern is entered.
957 If the search pattern is not found,
958 the screen is beeped and the cursor remains on the colon-command line.
959 Erasing characters from the search pattern backs the cursor up to the
960 previous matching text.
962 @IP{sections, sect [NHSHH HUnhsh]}
966 Define additional section boundaries for the
973 option should be set to a character string consisting of zero or
974 more character pairs.
975 In the text to be edited, the character string
976 @LI{<newline>.<char-pair>},
978 @LI{<char-pair>}is one of the character pairs in the option's value),
979 defines a section boundary in the same manner that
981 option boundaries are defined.
987 edit option turns off all access to external programs.
988 This means that the versions of the
992 commands that filter text through other programs,
1007 commands and file name expansion will not be permitted.
1011 edit option may not be unset.
1013 @IP{shell, sh [environment variable SHELL, or /bin/sh]}
1015 Select the shell used by the editor.
1016 The specified path is the pathname of the shell invoked by the
1019 shell escape command and by the
1023 This program is also used to resolve any shell meta-characters in
1026 @comment I cannot get a double quote to print between the square brackets
1027 @comment to save my life. The ONLY way I've been able to get this to work
1028 @comment is with the .tr command.
1030 @comment @IP{shellmeta [~@{[*?@$`'"\e]}
1031 @item @strong{shellmeta [~@{[*?$`'"\]}
1033 The set of characters that
1035 checks for when doing file name expansion.
1036 If any of the specified characters are found in the file name arguments
1040 the arguments are expanded using the program defined by the
1043 The default set of characters is a union of meta characters
1044 from the Version 7 and the Berkeley C shell.
1046 @IP{shiftwidth, sw [8]}
1048 Set the autoindent and shift command indentation width.
1049 This width is used by the
1058 @IP{showmatch, sm [off]}
1069 is entered, to briefly move the cursor the matching
1076 option for more information.
1078 @IP{showmode, smd [off]}
1084 to display a string identifying the current editor mode on the colon
1086 The string is preceded by an asterisk (``*'') if the file has been
1087 modified since it was last completely written,
1089 @IP{sidescroll [16]}
1093 Sets the number of columns that are shifted to the left or right,
1096 is doing left-right scrolling and the left or right margin is
1100 option for more information.
1102 @IP{slowopen, slow [off]}
1104 This option affects the display algorithm used by
1106 holding off display updating during input of new text to improve
1107 throughput when the terminal in use is slow and unintelligent.
1109 @emph{This option is not yet implemented.}
1111 @IP{sourceany [off]}
1113 If this option is turned on,
1115 historically read startup files that were owned by someone other than
1117 See the section entitled
1118 @QB{Startup Information}
1119 for more information.
1120 This option is a security problem of immense proportions,
1121 and should not be used under any circumstances.
1123 @emph{This option will never be implemented.}
1125 @IP{tabstop, ts [8]}
1127 This option sets tab widths for the editor display.
1129 @IP{taglength, tl [0]}
1131 This option sets the maximum number of characters that are considered
1132 significant in a tag name.
1133 Setting the value to 0 makes all of the characters in the tag name
1136 @IP{tags, tag [tags /var/db/libc.tags /sys/kern/tags]}
1138 Sets the list of tags files, in search order,
1139 which are used when the editor searches for a tag.
1141 @IP{term, ttytype, tty [environment variable TERM]}
1143 Set the terminal type.
1144 Setting this option causes
1146 to set (or reset) the environmental variable
1151 This option has historically made editor messages less verbose.
1152 It has no effect in this implementation.
1155 option for more information.
1161 command to take an associated motion.
1163 @IP{timeout, to [on]}
1165 If this option is set,
1167 waits for a specific period for a subsequent key to complete a key
1171 If the option is not set, the editor waits until enough keys are
1172 entered to resolve the ambiguity, regardless of how long it takes.
1174 @IP{ttywerase [off]}
1178 This option changes how
1180 does word erase during text input.
1181 If this option is set, text is broken up into two classes,
1182 blank characters and nonblank characters.
1183 Changing from one class to another marks the end of a word.
1190 historically bells the terminal for many obvious mistakes, e.g. trying
1191 to move past the left-hand margin, or past the end of the file.
1192 If this option is set, an error message is displayed for all errors.
1194 @IP{w300 [no default]}
1198 Set the window size if the baud rate is less than 1200 baud.
1201 option for more information.
1203 @IP{w1200 [no default]}
1207 Set the window size if the baud rate is equal to 1200 baud.
1210 option for more information.
1212 @IP{w9600 [no default]}
1216 Set the window size if the baud rate is greater than 1200 baud.
1219 option for more information.
1225 This option causes a warning message to the terminal if the file has
1226 been modified, since it was last written, before a
1230 @IP{window, w, wi [environment variable LINES - 1]}
1232 This option determines the default number of lines in a screenful,
1236 It also determines the number of lines scrolled by the
1242 and the default number of lines scrolled by the
1248 The value of window can be unrelated to the real screen size,
1249 although it starts out as the number of lines on the screen.
1250 See the section entitled
1251 @QB{Sizing the Screen}
1252 for more information.
1253 Setting the value of the
1255 option is the same as using the
1257 command line option.
1261 option (as set by the
1267 options) is smaller than the actual size of the screen,
1268 large screen movements will result in displaying only that smaller
1269 number of lines on the screen.
1270 (Further movements in that same area will result in the screen being
1272 This can provide a performance improvement when viewing different
1273 places in one or more files over a slow link.
1275 Resetting the window size does not reset the default number of lines
1282 @IP{windowname [off]}
1285 changes the name of the editor's icon/window to the current file name
1286 when it's possible and not destructive, i.e.,
1287 when the editor can restore it to its original value on exit or when
1288 the icon/window will be discarded as the editor exits.
1293 will change the icon/window name even when it's destructive and the
1294 icon/window name will remain after the editor exits.
1295 (This is the case for
1298 @IP{wraplen, wl [0]}
1300 This option is identical to the
1302 option, with the exception that it specifies the number of columns
1305 margin before the line splits, not the right margin.
1315 @IP{wrapmargin, wm [0]}
1323 will split lines so that they end at least that number of columns
1324 before the right-hand margin of the screen.
1330 In a screen that is 80 columns wide, the command
1331 @QT{:set wrapmargin=8}
1332 attempts to keep the lines less than or equal to 72 columns wide.)
1334 Lines are split at the previous whitespace character closest to the
1336 Any trailing whitespace characters before that character are deleted.
1337 If the line is split because of an inserted
1339 @LI{<tab>}character, and you then enter another
1340 @LI{<space>}character, it is discarded.
1342 If wrapmargin is set to 0,
1343 or if there is no blank character upon which to split the line,
1344 the line is not broken.
1354 @IP{wrapscan, ws [on]}
1356 This option causes searches to wrap around the end or the beginning
1357 of the file, and back to the starting point.
1358 Otherwise, the end or beginning of the file terminates the search.
1360 @IP{writeany, wa [off]}
1362 If this option is set, file-overwriting checks that would usually be
1367 commands, or before an automatic write (see the
1369 option), are not made.
1370 This allows a write to any file, provided the file permissions allow it.