This appendix describes the important set
command options
for Solaris 2.6 vi,
nvi 1.79,
elvis 2.0,
vim 5.1,
and vile 8.0.
Table C.1 contains brief descriptions of the
important set
command options.
In the first column,
options are listed in alphabetical order; if the option
can be abbreviated, that abbreviation is shown in parentheses.
The second column shows the
default setting that vi uses unless you issue an explicit
set
command (either manually or in the .exrc file).
The last column describes what the option does,
when enabled.
Option | Default | Description |
---|---|---|
autoindent (ai) | noai | In insert mode,
indents each line to the same level as the line above
or below. Use with the |
autoprint (ap) | ap | Displays changes after each editor command. (For global replacement, displays last replacement.) |
autowrite (aw) | noaw | Automatically writes (saves) the file if changed
before opening another file with |
beautify (bf) | nobf | Ignores all control characters during input (except tab, newline, or formfeed). |
directory (dir) | /tmp | Names directory in which ex/vi stores buffer files. (Directory must be writable.) |
edcompatible |
| Remember the flags used with the most recent substitute command (global, confirming), and use them for the next substitute command. Despite the name, no actual version of ed actually behaved this way. |
errorbells (eb) | errorbells | Sounds bell when an error occurs. |
exrc (ex) | noexrc | Allows the execution of .exrc files that reside outside the user's home directory. |
hardtabs (ht) | 8 | Defines boundaries for terminal hardware tabs. |
ignorecase (ic) | noic | Disregards case during a search. |
lisp | nolisp | Inserts indents in appropriate lisp format.
|
list | nolist | Prints tabs as |
magic | magic | Wildcard characters |
mesg | mesg | Permits system messages to display on terminal while editing in vi. |
novice | nonovice | Requires the use of
long ex command names, such as
|
number (nu) | nonu | Displays line numbers on left of screen during editing session. |
open | open | Allows entry to open or visual mode from ex. Although not in Solaris 2.6 vi, this option has traditionally been in vi, and may be in your UNIX's version of vi. |
optimize (opt) | noopt | Abolishes carriage returns at the end of lines when printing multiple lines, speeds output on dumb terminals when printing lines with leading whitespace (spaces or tabs). |
paragraphs (para) |
| Defines paragraph delimiters for movement
by |
prompt | prompt | Displays the ex prompt (:)
when vi's |
readonly (ro) | noro | Any writes (saves) of a file will fail unless you
use |
redraw (re) |
| vi redraws the screen whenever edits are made
(in other words, insert mode
pushes over existing characters, and deleted lines immediately close up).
Default depends on line speed and terminal type. |
remap | remap | Allows nested map sequences. |
report | 5 | Displays a message on the status line whenever you make an edit that
affects at least a certain number of lines. For example,
|
scroll | [ ½ window] | Number of lines to scroll with |
sections (sect) | SHNHH HU | Defines section delimiters for |
shell (sh) | /bin/sh | Pathname of shell used for shell escape ( |
shiftwidth (sw) | 8 | Defines number of spaces in
backward ( |
showmatch (sm) | nosm | In vi, when
|
showmode | noshowmode | In insert mode, displays a message on the prompt line indicating the type of insert you are making. For example, "OPEN MODE," or "APPEND MODE." |
slowopen (slow) |
| Holds off display during insert. Default depends on line speed and terminal type. |
tabstop (ts) | 8 | Defines number of spaces that a [TAB] indents during editing session. (Printer still uses system tab of 8.) |
taglength (tl) | 0 | Defines number of characters that are significant for tags. Default (zero) means that all characters are significant. |
tags | tags /usr/lib/tags | Defines pathname of files containing tags. (See the UNIX
|
tagstack | tagstack | Enables stacking of tag locations on a stack. |
term |
| Sets terminal type. |
terse | noterse | Displays shorter error messages. |
timeout (to) | timeout | Keyboard maps time out after 1 second.[1] |
ttytype |
| Sets terminal type.
This is just another name for |
warn | warn | Displays the warning message, "No write since last change." |
window (w) |
| Shows a certain number of lines of the file on the screen. Default depends on line speed and terminal type. |
wrapscan (ws) | ws | Searches wrap around either end of file. |
wrapmargin (wm) | 0 | Defines right margin. If greater than zero, automatically inserts carriage returns to break lines. |
writeany (wa) | nowa | Allows saving to any file. |
[1] When you have mappings of several keys (for example,
:map zzz 3dw
), you probably want to usenotimeout
. Otherwise you need to typezzz
within 1 second. When you have an insert mode mapping for a cursor key (for example,:map! ^[OB ^[ja
), you should usetimeout
. Otherwise, vi won't react to [ESC] until you type another key.