1 .\" $NetBSD: set.opt.roff,v 1.1 2008/09/02 09:25:39 christos Exp $
4 .\" The Regents of the University of California. All rights reserved.
5 .\" Copyright (c) 1994, 1995, 1996
6 .\" Keith Bostic. All rights reserved.
8 .\" See the LICENSE file for redistribution information.
10 .\" @(#)set.opt.roff 8.66 (Berkeley) 10/10/96
14 There are a large number of options that may be set (or unset) to
15 change the editor's behavior.
16 This section describes the options, their abbreviations and their
19 In each entry below, the first part of the tag line is the full name
20 of the option, followed by any equivalent abbreviations.
21 (Regardless of the abbreviations, it is only necessary to use the
22 minimum number of characters necessary to distinguish an abbreviation
23 from all other commands for it to be accepted, in
25 Historically, only the full name and the official abbreviations
28 Using full names in your startup files and environmental variables will
29 probably make them more portable.)
30 The part in square brackets is the default value of the option.
31 Most of the options are boolean, i.e. they are either on or off,
32 and do not have an associated value.
38 modes, unless otherwise specified.
40 With a few exceptions,
41 all options are settable per screen, i.e. the
43 option can be set differently in each screen.
44 The exceptions are the
51 Changing these options modifies the respective information for all screens.
53 For information on modifying the options or to display the options and
54 their current values, see the
56 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]"
73 If this option is set, whenever you create a new line (using the
94 commands) the new line is automatically indented to align the cursor with
95 the first nonblank character of the line from which you created it.
96 Lines are indented using tab characters to the extent possible (based on
99 option) and then using space characters as necessary.
100 For commands inserting text into the middle of a line, any blank characters
101 to the right of the cursor are discarded, and the first nonblank character
102 to the right of the cursor is aligned as described above.
104 The indent characters are themselves somewhat special.
105 If you do not enter more characters on the new line before moving to
106 another line, or entering
108 the indent character will be deleted and the line will be empty.
109 For example, if you enter
110 .LI <carriage-return>
112 the line created by the first
113 .LI <carriage-return>
114 will not have any characters in it,
115 regardless of the indentation of the previous or subsequent line.
117 Indent characters also require that you enter additional erase characters
120 if you have an indented line, containing only blanks, the first
122 character you enter will erase up to end of the indent characters,
123 and the second will erase back to the beginning of the line.
124 (Historically, only the
126 key would erase the indent characters.
129 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]"
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]"
175 If this option is set, the
193 commands automatically write the current file back to the current file name
194 if it has been modified since it was last written.
195 If the write fails, the command fails and goes no further.
197 Appending the optional force flag character
210 stops the automatic write from being attempted.
214 command ignored the optional force flag.)
231 option is ignored if the file is considered read-only for any reason.
232 .\" I cannot get a double quote to print between the square brackets
233 .\" to save my life. The ONLY way I've been able to get this to work
234 .\" 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]"
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]"
284 This option is used to specify a colon separated list of directories
285 which are used as path prefixes for any relative path names used as
289 The value of this option defaults to the value of the environmental
292 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
303 variable or the option value.
305 .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
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]"
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"
362 If the first non-empty line of the file begins with the string
369 to skip to the end of that shell, C or C++ comment (probably a
370 terribly boring legal notice) before displaying the file.
372 .IP "directory, dir [environment variable TMPDIR, or /tmp]"
373 The directory where temporary files are created.
374 The environmental variable
376 is used as the default value if it exists, otherwise
380 .IP "edcompatible, ed [off]"
381 Remember the values of the
387 commands, instead of initializing them as unset for each new
389 Specifying pattern and replacement strings to the
398 The 10th's of a second
400 waits for a subsequent key to complete an
404 .IP "errorbells, eb [off]"
408 error messages are normally presented in inverse video.
409 If that is not possible for the terminal, setting this option causes
410 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.
423 This option causes all regular expressions to be treated as POSIX
424 1003.2 Extended Regular Expressions (which are similar to historic
428 .IP "filec [no default]"
429 This option adds the ability to do shell expansion when entering input
430 on the colon command line.
431 This option is set to a string.
432 Whenever the first character of that string is entered on the colon
434 the <blank> delimited string immediately before the cursor is expanded
435 as if it were followed by a
437 character, and file name expansion for the
439 edit command was done.
440 If no match is found, the screen is flashed and text input resumed.
441 If a single match results, that match replaces the expanded text.
442 In addition, if the single match is for a directory, a
444 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,
460 .QT "set filec=<literal-next><escape>" .
464 .QT "set filec=\e<tab>" .
468 edit option is set to the same character as the
472 will perform colon command-line editing if the character is entered as
473 the first character of the line,
476 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]"
483 This option defines the spacing between hardware tab settings, i.e.
484 the tab expansion done by the operating system and/or the terminal
490 characters to the terminal, unlike historic versions of
492 this option does not currently have any affect.
497 edit option makes all Regular Expressions case-insensitive,
498 as long as an upper-case letter does not appear in the search string.
500 .IP "ignorecase, ic [off]"
501 This option causes regular expressions, both in
503 commands and in searches,
504 to be evaluated in a case-insensitive manner.
507 The 10th's of a second
509 waits for a subsequent key to complete a key mapping.
511 .IP "leftright [off]"
514 This option causes the screen to be scrolled left-right to view
515 lines longer than the screen, instead of the traditional
517 screen interface which folds long lines at the right-hand margin
523 The number of lines in the screen.
524 Setting this option causes
526 to set (or reset) the environmental variable
528 See the section entitled
529 .QB "Sizing the Screen"
530 for more information.
535 This option changes the behavior of the
544 commands to match the Lisp language.
547 option's behavior is changed to be appropriate for Lisp.
549 .i "This option is not yet implemented."
552 This option causes lines to be displayed in an unambiguous fashion.
553 Specifically, tabs are displayed as control characters, i.e.
555 and the ends of lines are marked with a
560 This option causes the editor to attempt to get an exclusive lock on
561 any file being edited, read or written.
562 Reading or writing a file that cannot be locked produces a warning
563 message, but no other effect.
564 Editing a file that cannot be locked results in a read only edit session,
567 edit option were set.
570 This option is on by default.
573 option off causes all regular expression characters except for
577 to be treated as ordinary characters.
578 To re-enable characters individually, when the
581 precede them with a backslash
584 See the section entitled
585 .QB "Regular Expressions and Replacement Strings"
586 for more information.
588 .IP "matchchars [[]{}()<>]"
591 This option defines the character pairs used by the
598 The 10th's of a second
600 pauses on the matching character when the
605 This option allows other users to contact you using the
609 utilities, while you are editing.
611 does not turn message on, i.e. if messages were turned off when the
612 editor was invoked, they will stay turned off.
613 This option only permits you to disallow messages for the edit session.
616 utility for more information.
619 This option selects a message catalog to be used to display error and
620 informational messages in a specified language.
621 If the value of this option ends with a '/', it is treated as the name
622 of a directory that contains a message catalog
628 environmental variable, if it's set, or the value of the
630 environmental variable if it's not.
631 If neither of those environmental variables are set,
632 or if the option doesn't end in a '/',
633 the option is treated as the full path name of the message catalog to use.
635 If any messages are missing from the catalog,
636 the backup text (English) is used instead.
638 See the distribution file
640 for additional information on building and installing message catalogs.
642 .IP "modelines, modeline [off]"
647 has historically scanned the first and last five lines of each file as
648 it is read for editing, looking for any
650 commands that have been placed in those lines.
651 After the startup information has been processed, and before the user
652 starts editing the file, any commands embedded in the file are executed.
654 Commands were recognized by the letters
662 at the beginning of a line or following a tab or space character,
670 This option is a security problem of immense proportions,
671 and should not be used under any circumstances.
673 .i "This option will never be implemented."
674 .\" I cannot get a double quote to print between the square brackets
675 .\" to save my life. The ONLY way I've been able to get this to work
676 .\" is with the .tr command.
682 Characters that are never handled as printable characters.
683 By default, the C library function
685 is used to determine if a character is printable or not.
686 This edit option overrides that decision.
688 .IP "number, nu [off]"
689 Precede each line displayed with its current line number.
692 Display unknown characters as octal numbers
694 instead of the default
701 If this option is not set, the
705 commands are disallowed.
707 .IP "optimize, opt [on]"
710 Throughput of text is expedited by setting the terminal not to do automatic
711 carriage returns when printing more than one (logical) line of output,
712 greatly speeding output on terminals without addressable cursors when text
713 with leading white space is printed.
715 .i "This option is not yet implemented."
717 .IP "paragraphs, para [IPLPPPQPP LIpplpipbp]"
720 Define additional paragraph boundaries for the
725 The value of this option must be a character string consisting
726 of zero or more character pairs.
728 In the text to be edited, the character string
729 .LI "<newline>.<char-pair>" ,
732 is one of the character pairs in the option's value)
733 defines a paragraph boundary.
734 For example, if the option were set to
736 then all of the following additional paragraph boundaries would be
746 The path option can be used to specify a <colon>-separated list of
747 paths, similar to the
749 environment variable in the shells.
750 If this option is set,
751 the name of the file to be edited is not an absolute pathname,
752 the first component of the filename is not
756 and the file to be edited doesn't exist in the current directory,
759 option are sequentially searched for a file of the specified name.
760 If such a file is found, it is edited.
761 .\" I cannot get a double quote to print between the square brackets
762 .\" to save my life. The ONLY way I've been able to get this to work
763 .\" is with the .tr command.
769 Characters that are always handled as printable characters.
770 By default, the C library function
772 is used to determine if a character is printable or not.
773 This edit option overrides that decision.
780 to prompt for command input with a
782 character; when it is not set, no prompt is displayed.
784 .IP "readonly, ro [off]"
785 This option causes a force flag to be required to attempt to write the file.
786 Setting this option is equivalent to using the
791 program using the name
796 edit option is not usually persistent, like other edit options.
799 command line option is set,
805 edit option is explicitly set,
806 all files edited in the screen will be marked readonly,
807 and the force flag will be required to write them.
808 However, if none of these conditions are true,
811 edit option is explicitly unset,
814 edit option will toggle based on the write permissions of the file currently
815 being edited as of when it is loaded into the edit buffer.
818 edit option will be set if the current file lacks write permissions,
819 and will not be set if the user has write permissions for the file.
821 .IP "recdir [/var/tmp/vi.recover]"
822 The directory where recovery files are stored.
824 If you change the value of
826 be careful to choose a directory whose contents are not regularly
828 Bad choices include directories in memory based filesystems,
832 as their contents are removed when the machine is rebooted.
834 Public directories like
838 are usually safe, although some sites periodically prune old files
840 There is no requirement that you use a public directory,
841 e.g. a sub-directory of your home directory will work fine.
843 Finally, if you change the value of
845 you must modify the recovery script to operate in your chosen recovery
848 See the section entitled
850 for further information.
852 .IP "redraw, re [off]"
855 The editor simulates (using great amounts of output), an intelligent
856 terminal on a dumb terminal (e.g. during insertions in
858 the characters to the right of the cursor are refreshed as each input
861 .i "This option is not yet implemented."
864 If this option is set,
865 it is possible to define macros in terms of other macros.
866 Otherwise, each key is only remapped up to one time.
881 option is set, and to
886 Set the threshold of the number of lines that need to be changed or
887 yanked before a message will be displayed to the user.
888 For everything but the yank command, the value is the largest value
889 about which the editor is silent, i.e. by default, 6 lines must be
890 deleted before the user is notified.
891 However, if the number of lines yanked is greater than
893 the set value, it is reported to the user.
898 Display a row/column ruler on the colon command line.
900 .IP "scroll, scr [(environment variable LINES - 1) / 2]"
901 Set the number of lines scrolled by the
911 command, when specified without a count, used two times the size of the
912 scroll value; the POSIX 1003.2 standard specified the window size, which
915 .IP "searchincr [off]"
918 edit option makes the search commands
922 incremental, i.e. the screen is updated and the cursor moves to the matching
923 text as the search pattern is entered.
924 If the search pattern is not found,
925 the screen is beeped and the cursor remains on the colon-command line.
926 Erasing characters from the search pattern backs the cursor up to the
927 previous matching text.
929 .IP "sections, sect [NHSHH HUnhsh]"
932 Define additional section boundaries for the
939 option should be set to a character string consisting of zero or
940 more character pairs.
941 In the text to be edited, the character string
942 .LI "<newline>.<char-pair>" ,
945 is one of the character pairs in the option's value),
946 defines a section boundary in the same manner that
948 option boundaries are defined.
953 edit option turns off all access to external programs.
954 This means that the versions of the
958 commands that filter text through other programs,
973 commands and file name expansion will not be permitted.
977 edit option may not be unset.
979 .IP "shell, sh [environment variable SHELL, or /bin/sh]"
980 Select the shell used by the editor.
981 The specified path is the pathname of the shell invoked by the
984 shell escape command and by the
988 This program is also used to resolve any shell meta-characters in
991 .\" I cannot get a double quote to print between the square brackets
992 .\" to save my life. The ONLY way I've been able to get this to work
993 .\" is with the .tr command.
995 .ds ms shellmeta [~{[*?$`'Q\e]
999 The set of characters that
1001 checks for when doing file name expansion.
1002 If any of the specified characters are found in the file name arguments
1006 the arguments are expanded using the program defined by the
1009 The default set of characters is a union of meta characters
1010 from the Version 7 and the Berkeley C shell.
1012 .IP "shiftwidth, sw [8]"
1013 Set the autoindent and shift command indentation width.
1014 This width is used by the
1023 .IP "showmatch, sm [off]"
1032 is entered, to briefly move the cursor the matching
1038 option for more information.
1040 .IP "showmode, smd [off]"
1045 to display a string identifying the current editor mode on the colon
1047 The string is preceded by an asterisk (``*'') if the file has been
1048 modified since it was last completely written,
1050 .IP "sidescroll [16]"
1053 Sets the number of columns that are shifted to the left or right,
1056 is doing left-right scrolling and the left or right margin is
1060 option for more information.
1062 .IP "slowopen, slow [off]"
1063 This option affects the display algorithm used by
1065 holding off display updating during input of new text to improve
1066 throughput when the terminal in use is slow and unintelligent.
1068 .i "This option is not yet implemented."
1070 .IP "sourceany [off]"
1071 If this option is turned on,
1073 historically read startup files that were owned by someone other than
1075 See the section entitled
1076 .QB "Startup Information"
1077 for more information.
1078 This option is a security problem of immense proportions,
1079 and should not be used under any circumstances.
1081 .i "This option will never be implemented."
1083 .IP "tabstop, ts [8]"
1084 This option sets tab widths for the editor display.
1086 .IP "taglength, tl [0]"
1087 This option sets the maximum number of characters that are considered
1088 significant in a tag name.
1089 Setting the value to 0 makes all of the characters in the tag name
1092 .IP "tags, tag [tags /var/db/libc.tags /sys/kern/tags]"
1093 Sets the list of tags files, in search order,
1094 which are used when the editor searches for a tag.
1096 .IP "term, ttytype, tty [environment variable TERM]"
1097 Set the terminal type.
1098 Setting this option causes
1100 to set (or reset) the environmental variable
1104 This option has historically made editor messages less verbose.
1105 It has no effect in this implementation.
1108 option for more information.
1113 command to take an associated motion.
1115 .IP "timeout, to [on]"
1116 If this option is set,
1118 waits for a specific period for a subsequent key to complete a key
1122 If the option is not set, the editor waits until enough keys are
1123 entered to resolve the ambiguity, regardless of how long it takes.
1125 .IP "ttywerase [off]"
1128 This option changes how
1130 does word erase during text input.
1131 If this option is set, text is broken up into two classes,
1132 blank characters and nonblank characters.
1133 Changing from one class to another marks the end of a word.
1139 historically bells the terminal for many obvious mistakes, e.g. trying
1140 to move past the left-hand margin, or past the end of the file.
1141 If this option is set, an error message is displayed for all errors.
1143 .IP "w300 [no default]"
1146 Set the window size if the baud rate is less than 1200 baud.
1149 option for more information.
1151 .IP "w1200 [no default]"
1154 Set the window size if the baud rate is equal to 1200 baud.
1157 option for more information.
1159 .IP "w9600 [no default]"
1162 Set the window size if the baud rate is greater than 1200 baud.
1165 option for more information.
1170 This option causes a warning message to the terminal if the file has
1171 been modified, since it was last written, before a
1175 .IP "window, w, wi [environment variable LINES - 1]"
1176 This option determines the default number of lines in a screenful,
1180 It also determines the number of lines scrolled by the
1186 and the default number of lines scrolled by the
1192 The value of window can be unrelated to the real screen size,
1193 although it starts out as the number of lines on the screen.
1194 See the section entitled
1195 .QB "Sizing the Screen"
1196 for more information.
1197 Setting the value of the
1199 option is the same as using the
1201 command line option.
1205 option (as set by the
1211 options) is smaller than the actual size of the screen,
1212 large screen movements will result in displaying only that smaller
1213 number of lines on the screen.
1214 (Further movements in that same area will result in the screen being
1216 This can provide a performance improvement when viewing different
1217 places in one or more files over a slow link.
1219 Resetting the window size does not reset the default number of lines
1226 .IP "windowname [off]"
1228 changes the name of the editor's icon/window to the current file name
1229 when it's possible and not destructive, i.e.,
1230 when the editor can restore it to its original value on exit or when
1231 the icon/window will be discarded as the editor exits.
1236 will change the icon/window name even when it's destructive and the
1237 icon/window name will remain after the editor exits.
1238 (This is the case for
1241 .IP "wraplen, wl [0]"
1242 This option is identical to the
1244 option, with the exception that it specifies the number of columns
1247 margin before the line splits, not the right margin.
1257 .IP "wrapmargin, wm [0]"
1264 will split lines so that they end at least that number of columns
1265 before the right-hand margin of the screen.
1271 In a screen that is 80 columns wide, the command
1272 .QT ":set wrapmargin=8"
1273 attempts to keep the lines less than or equal to 72 columns wide.)
1275 Lines are split at the previous whitespace character closest to the
1277 Any trailing whitespace characters before that character are deleted.
1278 If the line is split because of an inserted
1282 character, and you then enter another
1284 character, it is discarded.
1286 If wrapmargin is set to 0,
1287 or if there is no blank character upon which to split the line,
1288 the line is not broken.
1298 .IP "wrapscan, ws [on]"
1299 This option causes searches to wrap around the end or the beginning
1300 of the file, and back to the starting point.
1301 Otherwise, the end or beginning of the file terminates the search.
1303 .IP "writeany, wa [off]"
1304 If this option is set, file-overwriting checks that would usually be
1309 commands, or before an automatic write (see the
1311 option), are not made.
1312 This allows a write to any file, provided the file permissions allow it.