Table 9-1. :set Options
Option | Default | Description |
---|
autoindent (ai) | noai | In insert mode, indent each line to the same level as the line above or below. Use with the shiftwidth option. |
autoprint (ap) | ap | Display changes after each editor command. (For global replacement, display last replacement.) |
autowrite (aw) | noaw | Automatically write (save) the file if changed before opening another file with a command such as :n, or before giving Unix command with :!. |
background (bg) | | Describe the background so the editor can choose appropriate highlighting colors. Default value of dark or light depends on the environment in which the editor is invoked. {vim} |
backup (bk) | nobackup | Create a backup file when overwriting an existing file. {vim} |
backupdir= (bdir) | .,~/tmp/,~/ | Name directories in which to store backup files if possible. The list of directories is comma-separated and in order of preference. {vim} |
beautify (bf) | nobf | Ignore all control characters during input (except tab, newline, or formfeed). |
backupext= (bex) | ~ | String to append to filenames for backup files. {vim} |
cindent (cin) | nocindent | In insert mode, indent each line relative to the one above it, as is appropriate for C or C++ code. {vim} |
compatible (cp) | cp | Make vim behave more like vi. Default is nocp when a ~/.vimrc file is found. {vim} |
directory (dir) | /tmp | Name of directory in which ex/vi stores buffer files. (Directory must be writable.) This can be a comma-separated list for vim. |
edcompatible | noedcompatible | Remember the flags used with the most recent substitute command (global, confirming) and use them for the next substitute command. Despite the name, no version of ed actually does this. |
equalprg= (ep) | | Use the specified program for the = command. When the option is blank (the default), the key invokes the internal C indention function or the value of the indentexpr option. {vim} |
errorbells (eb) | errorbells | Sound bell when an error occurs. |
exrc (ex) | noexrc | Allow the execution of .exrc files that reside outside the user's home directory. |
formatprg= (fp) | | The gq command will invoke the named external program to format text. It will call internal formatting functions when this option is empty (the default). {vim} |
gdefault (gd) | nogdefault | Set the g flag on for substitutions by default. {vim} |
hardtabs= (ht) | 8 | Define boundaries for terminal hardware tabs. |
hidden (hid) | nohidden | Hide buffers rather than unload them when they are abandoned. {vim} |
hlsearch (hls) | hlsearch | Highlight all matches of most recent search pattern. Use :nohlsearch to remove highlighting. {vim} |
history= (hi) | 20 | Number of ex commands to store in the history table. {vim} |
ignorecase (ic) | noic | Disregard case during a search. |
incsearch (is) | noincsearch | Highlight matches to a search pattern as it is typed. {vim} |
lisp | nolisp | Insert indents in appropriate Lisp format. ( ), { }, [ [, and ] ] are modified to have meaning for Lisp. |
list | nolist | Print tabs as ^I; mark ends of lines with $. (Use list to tell if end character is a tab or a space.) |
magic | magic | Wildcard characters; . (dot), * (asterisk), and [ ] (brackets) have special meaning in patterns. |
mesg | mesg | Permit system messages to display on terminal while editing in vi. |
mousehide (mh) | mousehide | When characters are typed, hide the mouse pointer. {vim} |
novice | nonovice | Require the use of long ex command names, such as copy or read. |
number (nu) | nonu | Display line numbers on left of screen during editing session. |
open | open | Allow entry to open or visual mode from ex. Although not in vim, this option has traditionally been in vi, and may be in your version of vi. |
optimize (opt) | noopt | Abolish carriage returns at the end of lines when printing multiple lines; speed output on dumb terminals when printing lines with leading whitespace (spaces or tabs). |
paragraphs (para) | IPLPPPQPP LIpplpipnpbp | Define paragraph delimiters for movement by { or }. The pairs of characters in the value are the names of troff macros that begin paragraphs. |
paste | nopaste | Change the defaults of various options to make pasting text into a terminal window work better. All options are returned to their original value when the paste option is reset. {vim} |
prompt | prompt | Display the ex prompt ( : ) when vi 's Q command is given. |
readonly (ro) | noro | Any writes (saves) of a file fail unless you use ! after the write (works with w, ZZ, or autowrite). |
redraw (re) | | vi redraws the screen whenever edits are made. noredraw is useful at slow speeds on a dumb terminal: the screen isn't fully updated until you press Escape. Default depends on line speed and terminal type. |
remap | remap | Allow nested map sequences. |
report= | 5 | Display a message on the status line whenever you make an edit that affects at least a certain number of lines. For example, 6dd reports the message "6 lines deleted." |
ruler (ru) | ruler | Show line and column numbers for the current cursor position. {vim} |
scroll= | [1/2 window] | Number of lines to scroll with ^D and ^U commands. |
sections= (sect) | SHNHH HUnhsh+c | Define section delimiters for [ [ and ] ] movement. The pairs of characters in the value are the names of troff macros that begin sections. |
shell= (sh) | /bin/sh | Pathname of shell used for shell escape (:!) and shell command (:sh). Default value is derived from shell environment, which varies on different systems. |
shiftwidth= (sw) | 8 | Define number of spaces used when the indent in increased or decreased. |
showmatch (sm) | nosm | In vi, when ) or } is entered, cursor moves briefly to matching ( or {. (If no match, rings the error message bell.) Very useful for programming. |
showmode | noshowmode | In insert mode, display a message on the prompt line indicating the type of insert you are making. For example, "OPEN MODE" or "APPEND MODE." |
slowopen (slow) | | Hold off display during insert. Default depends on line speed and terminal type. |
smartcase (scs) | nosmartcase | Override the ignorecase option when a search pattern contains uppercase characters. {vim} |
tabstop= (ts) | 8 | Define number of spaces a tab indents during editing session. (Printer still uses system tab of 8.) |
taglength= (tl) | 0 | Define number of characters that are significant for tags. Default (zero) means that all characters are significant. |
tags= | tags /usr/lib/tags | Define pathname of files containing tags. (See the Unix ctags command.) (By default, vi searches the file tags in the current directory and /usr/lib/tags.) |
tagstack | tagstack | Enable stacking of tag locations on a stack. (Solaris vi and vim.) |
term= | | Set terminal type. |
terse | noterse | Display shorter error messages. |
textwidth= (tw) | 0 | The maximum width of text to be inserted; longer lines are broken after whitespace. Default (zero) disables this feature, in which case wrapmargin is used. {vim} |
timeout (to) | timeout | Keyboard maps timeout after 1 second.[a] |
timeoutlen= (tm) | 1000 | Number of milliseconds after which keyboard maps timeout. Default value of 1000 provides traditional vi behavior. {vim} |
ttytype= | | Set terminal type. This is just another name for term. |
undolevels= (ul) | 1000 | Number of changes that can be undone. {vim} |
warn | warn | Display the warning message, "No write since last change." |
window (w) | | Show a certain number of lines of the file on the screen. Default depends on line speed and terminal type. |
wrap | | When on, long lines wrap on the screen. When off, only the first part of the line is displayed. {vim} |
wrapmargin (wm) | 0 | Define right margin. If greater than zero, vi automatically inserts carriage returns to break lines. |
wrapscan (ws) | ws | Searches wrap around either end of file. |
writeany (wa) | nowa | Allow saving to any file. |
writebackup (wb) | wb | Back up files before attempting to overwrite them. Remove the backup when the file has been successfully written, unless the backup option is set. {vim} |