There are a large number of options that may be set (or unset) to change the editor's behavior. This section describes the options, their abbreviations and their default values.
In each entry below, the first part of the tag line is the full name of the option, followed by any equivalent abbreviations. The part in square brackets is the default value of the option. Most of the options are boolean, i.e. they are either on or off, and do not have an associated value.
Options apply to both ex and vi modes, unless otherwise specified.
altwerase [off]
Vi only. Select an alternate word erase algorithm.
autoindent, ai [off]
Automatically indent new lines.
autoprint, ap [off]
Ex only. Display the current line automatically.
autowrite, aw [off]
Write modified files automatically when changing files.
backup [QQ]
Backup files before they are overwritten.
beautify, bf [off]
Discard control characters.
cdpath [environment variable CDPATH, or current directory]
The directory paths used as path prefixes for the cd command.
cedit [no default]
Set the character to edit the colon command-line history.
columns, co [80]
Set the number of columns in the screen.
comment [off]
Vi only. Skip leading comments in shell, C and C++ language files.
directory, dir [environment variable TMPDIR, or /tmp]
The directory where temporary files are created.
edcompatible, ed [off]
Remember the values of the ``c'' and ``g'' suffices to the substitute commands, instead of initializing them as unset for each new command.
errorbells, eb [off]
Ex only. Announce error messages with a bell.
expandtab, et [off]
Prevent the use of <tab> characters in leading whitespace when shifting text, autoindenting, indenting with <control-T>, or outdenting with <control-D>.
exrc, ex [off]
Read the startup files in the local directory.
extended [off]
Regular expressions are extended (i.e. egrep(1)-style) expressions.
filec [no default]
Set the character to perform file path completion on the colon command line.
flash [on]
Flash the screen instead of beeping the keyboard on error.
gtagsmode, gt [off]
Use GTAGS and GRTAGS instead of tags.
hardtabs, ht [8]
Set the spacing between hardware tab settings.
iclower [off]
Makes all Regular Expressions case-insensitive, as long as an upper-case letter does not appear in the search string.
ignorecase, ic [off]
Ignore case differences in regular expressions.
keytime [6]
The 10th's of a second ex/vi waits for a subsequent key to complete a key mapping.
leftright [off]
Vi only. Do left-right scrolling.
lines, li [24]
Vi only. Set the number of lines in the screen.
lisp [off]
Vi only. Modify various search commands and options to work with Lisp. This option is not yet implemented.
list [off]
Display lines in an unambiguous fashion.
lock [on]
Attempt to get an exclusive lock on any file being edited, read or written.
magic [on]
Treat certain characters specially in regular expressions.
matchchars [[]{}()<>]
Character pairs looked for by the % command.
matchtime [7]
Vi only. The 10th's of a second ex/vi pauses on the matching character when the showmatch option is set.
mesg [on]
Permit messages from other users.
modelines, modeline [off]
Read the first and last few lines of each file for ex commands. This option will never be implemented.
noprint [QQ]
Characters that are never handled as printable characters.
number, nu [off]
Precede each line displayed with its current line number.
octal [off]
Display unknown characters as octal numbers, instead of the default hexadecimal.
open [on]
Ex only. If this option is not set, the open and visual commands are disallowed.
optimize, opt [on]
Vi only. Optimize text throughput to dumb terminals. This option is not yet implemented.
paragraphs, para [IPLPPPQPP LIpplpipbp]
Vi only. Define additional paragraph boundaries for the { and } commands.
path []
Define additional directories to search for files being edited.
print [QQ]
Characters that are always handled as printable characters.
prompt [on]
Ex only. Display a command prompt.
readonly, ro [off]
Mark the file and session as read-only.
recdir [/var/tmp/vi.recover]
The directory where recovery files are stored.
redraw, re [off]
Vi only. Simulate an intelligent terminal on a dumb one. This option is not yet implemented.
remap [on]
Remap keys until resolved.
report [5]
Set the number of lines about which the editor reports changes or yanks.
ruler [off]
Vi only. Display a row/column ruler on the colon command line.
scroll, scr [window / 2]
Set the number of lines scrolled.
searchincr [off]
Makes the / and ? commands incremental.
sections, sect [NHSHH HUnhsh]
Vi only. Define additional section boundaries for the [[ and ]] commands.
secure [off]
Turns off all access to external programs.
shell, sh [environment variable SHELL, or /bin/sh]
Select the shell used by the editor.
shellmeta [~{[*?$`'Q\]
Set the meta characters checked to determine if file name expansion is necessary.
shiftwidth, sw [8]
Set the autoindent and shift command indentation width.
showmatch, sm [off]
Vi only. Note matching ``{'' and ``('' for ``}'' and ``)'' characters.
showmode, smd [off]
Vi only. Display the current editor mode and a ``modified'' flag.
sidescroll [16]
Vi only. Set the amount a left-right scroll will shift.
slowopen, slow [off]
Delay display updating during text input. This option is not yet implemented.
sourceany [off]
Read startup files not owned by the current user. This option will never be implemented.
tabstop, ts [8]
This option sets tab widths for the editor display.
taglength, tl [0]
Set the number of significant characters in tag names.
tags, tag [tags /var/db/libc.tags /sys/kern/tags]
Set the list of tags files.
term, ttytype, tty [environment variable TERM]
Set the terminal type.
terse [off]
This option has historically made editor messages less verbose. It has no effect in this implementation.
tildeop [off]
Modify the ~ command to take an associated motion.
timeout, to [on]
Time out on keys which may be mapped.
ttywerase [off]
Vi only. Select an alternate erase algorithm.
verbose [off]
Vi only. Display an error message for every error.
w300 [no default]
Vi only. Set the window size if the baud rate is less than 1200 baud.
w1200 [no default]
Vi only. Set the window size if the baud rate is equal to 1200 baud.
w9600 [no default]
Vi only. Set the window size if the baud rate is greater than 1200 baud.
warn [on]
Ex only. This option causes a warning message to the terminal if the file has been modified, since it was last written, before a ! command.
window, w, wi [environment variable LINES]
Set the window size for the screen.
windowname [off]
Change the icon/window name to the current file name even if it can't be restored on editor exit.
wraplen, wl [0]
Vi only. Break lines automatically, the specified number of columns from the left-hand margin. If both the wraplen and wrapmargin edit options are set, the wrapmargin value is used.
wrapmargin, wm [0]
Vi only. Break lines automatically, the specified number of columns from the right-hand margin. If both the wraplen and wrapmargin edit options are set, the wrapmargin value is used.
wrapscan, ws [on]
Set searches to wrap around the end or beginning of the file.
writeany, wa [off]
Turn off file-overwriting checks.