OPTIONS
*options.txt* For IdeaVIM version 0.12.0. Last change: 2006 Dec 01
IdeaVIM REFERENCE MANUAL by Rick Maddy
Options *options*
1. Setting options |set-option|
2. Automatically setting options |auto-setting|
3. Options summary |option-summary|
For an overview of options see help.txt |option-list|.
Vim has a number of internal variables and switches which can be set to
achieve special effects. These options come in three forms:
boolean can only be on or off *boolean* *toggle*
number has a numeric value
string has a string value
1. Setting options *set-option*
*:se* *:set*
:se[t] Show all options that differ from their default value.
:se[t] all Show all but terminal options.
:se[t] {option}
? Show value of {option}
.
:se[t] {option}
Toggle option: set, switch it on.
Number option: show value.
String option: show value.
:se[t] no{option}
Toggle option: Reset, switch it off.
:se[t] {option}
! or
:se[t] inv{option}
Toggle option: Invert value.
*:set-default* *:set-&* *:set-&vi* *:set-&vim*
:se[t] {option}
& Reset option to its default value. May depend on the
current value of 'compatible'.
:se[t] all& Set all options, except terminal options, to their
default value. The values of 'term', 'lines' and
'columns' are not changed.
*E487* *E521*
:se[t] {option}
={value}
or
:se[t] {option}
:{value}
Set string or number option to {value}
.
*:set-args*
For numeric options the value can be given in decimal,
hex (preceded with 0x) or octal (preceded with '0')
(hex and octal are only available for machines which
have the strtol() function).
White space between {option}
and '=' is allowed and
will be ignored. White space between '=' and {value}
is not allowed.
See |option-backslash| for using white space and
backslashes in {value}
.
:se[t] {option}
+={value}
*:set+=*
Add the {value}
to a number option, or append the
{value}
to a string option. When the option is a
comma separated list, a comma is added, unless the
value was empty.
If the option is a list of flags, superfluous flags
are removed. Otherwise there is no check for doubled
values. You can avoid this by removing a value first.
Example:
:set guioptions-=T guioptions+=T
Also see |:set-args| above.
:se[t] {option}
^={value}
*:set^=*
Multiply the {value}
to a number option, or prepend
the {value}
to a string option. When the option is a
comma separated list, a comma is added, unless the
value was empty.
Also see |:set-args| above.
:se[t] {option}
-={value}
*:set-=*
Subtract the {value}
from a number option, or remove
the {value}
from a string option, if it is there.
If the {value}
is not found in a string option, there
is no error or warning. When the option is a comma
separated list, a comma is deleted, unless the option
becomes empty.
When the option is a list of flags, {value}
must be
exactly as they appear in the option. Remove flags
one by one to avoid problems.
Also see |:set-args| above.
The {option}
arguments to ":set" may be repeated. For example:
:set ai nosi sw=3 ts=3
If you make an error in one of the arguments, an error message will be given
and the following arguments will be ignored.
*option-backslash*
To include white space in a string option value it has to be preceded with a
backslash. To include a backslash you have to use two. Effectively this
means that the number of backslashes in an option value is halved (rounded
down).
A few examples:
:set tags=tags\ /usr/tags results in "tags /usr/tags"
:set tags=tags\\,file results in "tags\,file"
:set tags=tags\\\ file results in "tags\ file"
2. Automatically setting options *auto-setting*
Besides changing options with the ":set" command, there are three alternatives
to set options automatically for one or more files:
1. When starting Vim initializations are read from various places. See
|initialization|. Most of them are performed for all editing sessions,
and some of them depend on the directory where Vim is started.
3. Options summary *option-summary*
In the list below all the options are mentioned with their full name and with
an abbreviation if there is one. Both forms may be used.
In this document when a boolean option is "set" that means that ":set option"
is entered. When an option is "reset", ":set nooption" is used.
*E355*
A jump table for the options with a short description can be found at |Q_op|.
*'digraph'* *'dg'* *'nodigraph'* *'nodg'*
'digraph' 'dg' boolean (default off)
global
Enable the entering of digraphs in Insert mode with {char1}
<BS>
{char2}
. See |digraphs|.
*'gdefault'* *'gd'* *'nogdefault'* *'nogd'*
'gdefault' 'gd' boolean (default off)
global
When on, the ":substitute" flag 'g' is default on. This means that
all matches in a line are substituted instead of one. When a 'g' flag
is given to a ":substitute" command, this will toggle the substitution
of all or one match. See |complex-change|.
command 'gdefault' on 'gdefault' off
:s/// subst. all subst. one
:s///g subst. one subst. all
:s///gg subst. all subst. one
*'hlsearch'* *'hls'* *'nohlsearch'* *'nohls'*
'hlsearch' 'hls' boolean (default off)
global
When there is a previous search pattern, highlight all its matches.
Note
that only the matching text is highlighted, any offsets
are not applied.
When you get bored looking at the highlighted matches, you can turn it
off with |:nohlsearch|. As soon as you use a search command, the
highlighting comes back.
When the search pattern can match an end-of-line, Vim will try to
highlight all of the matched text. However, this depends on where the
search starts. This will be the first line in the window or the first
line below a closed fold. A match in a previous line which is not
drawn may not continue in an newly drawn line.
*'history'* *'hi'*
'history' 'hi' number (default: 20)
global
A history of ":" commands, and a history of previous search patterns
are remembered. This option decides how many entries may be stored in
each of these histories (see |cmdline-editing|).
*'ignorecase'* *'ic'* *'noignorecase'* *'noic'*
'ignorecase' 'ic' boolean (default off)
global
Ignore case in search patterns. Also used when searching in the tags
file.
Also see 'smartcase'.
Can be overruled by using "\c" or "\C" in the pattern, see
|/ignorecase|.
*'matchpairs'* *'mps'*
'matchpairs' 'mps' string (default "(:),{:}
,[:]")
local to buffer
Characters that form pairs. The |%| command jumps from one to the
other. Currently only single character pairs are allowed, and they
must be different. The characters must be separated by a colon. The
pairs must be separated by a comma. Example for including '<' and '>
'
(HTML):
:set mps+=<:>
*'more'* *'nomore'*
'more' boolean (Vim default: on, Vi default: off)
global
When on, listings pause when the whole screen is filled. You will get
the |more-prompt
|. When this option is off there are no pauses, the
listing continues until finished.
*'nrformats'* *'nf'*
'nrformats' 'nf' string (default "octal,hex")
local to buffer
This defines what bases Vim will consider for numbers when using the
CTRL-A
and CTRL-X
commands for adding to and subtracting from a number
respectively; see |CTRL-A| for more info on these commands.
alpha if included, single alphabetical characters will be
incremented or decremented. This is useful for a list with a
letter index a), b), etc.
octal if included, numbers that start with a zero will be considered
to be octal. Example: Using CTRL-A
on "007" results in "010".
hex if included, numbers starting with "0x" or "0X" will be
considered to be hexadecimal. Example: Using CTRL-X
on
"0x100" results in "0x0ff".
Numbers which simply begin with a digit in the range 1-9 are always
considered decimal. This also happens for numbers that are not
recognized as octal or hex.
*'scroll'* *'scr'*
'scroll' 'scr' number (default: half the window height)
local to window
Number of lines to scroll with CTRL-U
and CTRL-D
commands. Will be
set to half the number of lines in the window when the window size
changes. If you give a count to the CTRL-U
or CTRL-D
command it will
be used as the new value for 'scroll'. Reset to half the window
height with ":set scroll=0".
*'scrolljump'* *'sj'*
'scrolljump' 'sj' number (default 1)
global
Minimal number of lines to scroll when the cursor gets off the
screen (e.g., with "j"). Not used for scroll commands (e.g., CTRL-E
,
CTRL-D
). Useful if your terminal scrolls very slowly.
*'scrolloff'* *'so'*
'scrolloff' 'so' number (default 0)
global
Minimal number of screen lines to keep above and below the cursor.
This will make some context visible around where you are working. If
you set it to a very large value (999) the cursor line will always be
in the middle of the window (except at the start or end of the file or
when long lines wrap).
For scrolling horizontallly see 'sidescrolloff'.
*'selection'* *'sel'*
'selection' 'sel' string (default "inclusive")
global
This option defines the behavior of the selection. It is only used
in Visual and Select mode.
Possible values:
value past line inclusive
old no yes
inclusive yes yes
exclusive yes no
"past line" means that the cursor is allowed to be positioned one
character past the line.
"inclusive" means that the last character of the selection is included
in an operation. For example, when "x" is used to delete the
selection.
*'showmode'* *'smd'* *'noshowmode'* *'nosmd'*
'showmode' 'smd' boolean (default: on)
global
If in Insert, Replace or Visual mode put a message on the last line.
Use the 'M' flag in 'highlight' to set the type of highlighting for
this message.
*'sidescroll'* *'ss'*
'sidescroll' 'ss' number (default 0)
global
The minimal number of columns to scroll horizontally. Used only when
the 'wrap' option is off and the cursor is moved off of the screen.
When it is zero the cursor will be put in the middle of the screen.
Not used for "zh" and "zl" commands.
*'sidescrolloff'* *'siso'*
'sidescrolloff' 'siso' number (default 0)
global
The minimal number of screen columns to keep to the left and to the
right of the cursor if 'nowrap' is set. Setting this option to a value
greater than 0 while having |'sidescroll'| also at a non-zero value
makes some context visible in the line you are scrolling in
horizontally (except at the end and beginning of the line). Setting
this option to a large value (like 999) has the effect of keeping the
cursor horizontally centered in the window, as long as one does not
come too close to the beginning or end of the line.
*'smartcase'* *'scs'* *'nosmartcase'* *'noscs'*
'smartcase' 'scs' boolean (default off)
global
Override the 'ignorecase' option if the search pattern contains upper
case characters. Only used when the search pattern is typed and
'ignorecase' option is on. Used for the commands "/", "?", "n", "N",
":g" and ":s". Not used for "*", "#", "gd", tag search, etc.. After
"*" and "#" you can make 'smartcase' used by doing a "/" command,
recalling the search pattern from history and hitting <Enter>
.
*'undolevels'* *'ul'*
'undolevels' 'ul' number (default 100, 1000 for Unix, VMS,
Win32 and OS/2)
global
Maximum number of changes that can be undone. Since undo information
is kept in memory, higher numbers will cause more memory to be used
(nevertheless, a single change can use an unlimited amount of memory).
Set to 0 for Vi compatibility: One level of undo and "u" undoes
itself:
set ul=0
*'visualbell'* *'vb'* *'novisualbell'* *'novb'* *beep*
'visualbell' 'vb' boolean (default off)
global
Use visual bell instead of beeping.
*'wrapscan'* *'ws'* *'nowrapscan'* *'nows'*
'wrapscan' 'ws' boolean (default on) *E384* *E385*
global
Searches wrap around the end of the file.