Vim documentation: options
main help file
*options.txt* For Vim version 5.8. Last change: 2001 Feb 27
VIM REFERENCE MANUAL by Bram Moolenaar
Options *options*
1. Setting options |set-option|
2. Automatically setting options |auto-setting|
3. Saving settings |save-settings|
4. 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] termcap Show all terminal options. Note that in the GUI the
key codes are not shown, because they are generated
interally and can't be changed. Changing the terminal
codes in the GUI is not useful either...
: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. {not in Vi}
:se[t] {option}& Reset option to its default value. {not in Vi}
:se[t] all& Set all options, except terminal options, to their
default value. The values of 'term', 'lines' and
'columns' are not changed. {not in Vi}
: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).
The old value can be inserted by typing 'wildchar' (by
default this is a <Tab> or CTRL-E if 'compatible' is
set). See |cmdline-completion|.
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. 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.
Also see |:set-args| above.
:bro[wse] se[t] *:set-browse* *:browse-set* *:opt* *:options*
:opt[ions] Open a window for viewing and setting all options.
Options are grouped by function.
Offers short help for each option. Hit <CR> on the
short help to open a help window with more help for
the option.
Modify the value of the option and hit <CR> on the
"set" line to set the new value. For window and
buffer specific options, the last accessed window is
used to set the option value in, unless this is a help
window, in which case the window below help window is
used (skipping the option-window).
{not available when compiled without the |+eval| or
|+autocmd| features}
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.
For {option} the form "t_xx" may be used to set a termcap option. This will
override the value from the termcap. You can then use it in a mapping. If
the "xx" part contains special characters, use the <t_xx> form:
:set <t_#4>=^[Ot
The listing from ":set" looks different from Vi. Long string options are put
at the end of the list. The number of options is quite large. The output of
"set all" probably does not fit on the screen, causing Vim to give the
|more-prompt|.
*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"
For MS-DOS and WIN32 backslashes in file names are mostly not removed. More
precise: For options that expect a file name (those where environment
variables are expanded) a backslash before a normal file name character is not
removed. But a backslash before a special character (space, backslash, comma,
etc.) is used like explained above.
There is one special situation, when the value starts with "\\":
:set dir=\\machine\path results in "\\machine\path"
:set dir=\\\\machine\\path results in "\\machine\path"
:set dir=\\path\\file results in "\\path\file" (wrong!)
For the first one the start is kept, but for the second one the backslashes
are halved. This makes sure it works both when you expect backslashes to be
halved and when you expect the backslashes to be kept. The third gives a
result which is probably not what you want. Avoid it.
*add-option-flags* *remove-option-flags*
Some options are a list of flags. When you want to add a flag to such an
option, without changing the existing ones, you can do it like this:
:set guioptions+=a
Remove a flag from an option like this:
:set guioptions-=a
This removes the 'a' flag from 'guioptions'.
Note that you should add or remove one flag at a time. If 'guioptions' has
the value "ab", using "set guioptions-=ba" won't work, because the string "ba"
doesn't appear.
*:set_env* *expand-env* *expand-environment-var*
Environment variables in most string options will be expanded. If the
environment variable exists the '$' and the following environment variable
name is replaced with its value. If it does not exist the '$' and the name
are not modified. Any non-id character (not a letter, digit or '_') may
follow the environment variable name. That character and what follows is
appended to the value of the environment variable. Examples:
:set term=$TERM.new
:set path=/usr/$INCLUDE,$HOME/include,.
*$HOME*
Using "~" is like using "$HOME", but it is only recognized at the start of an
option and after a space or comma.
On Unix systems "~user" can be used too. It is replaced by the home directory
of user "user". Example:
:set path=~mool/include,/usr/include,.
On Unix systems the form "${HOME}" can be used too. The name between {} can
contain non-id characters then. Note that if you want to use this for the
"gf" command, you need to add the '{' and '}' characters to 'isfname'.
*$VIM*
The environment variable "$VIM" is used to locate various user files for Vim,
such as the user startup script ".vimrc". This depends on the system, see
|startup|.
To avoid the need for every user to set the $VIM environment variable, Vim
will try to get the value for $VIM in this order:
1. The value defined by the $VIM environment variable. You can use this to
make Vim look in a specific directory for its support files. Example:
setenv VIM /home/paul/vim
2. The path from 'helpfile' is used, unless it contains some environment
variable too (the default is "$VIMRUNTIME/doc/help.txt": chicken-egg
problem). The file name ("help.txt" or any other) is removed. Then
trailing directory names are removed, in this order: "doc", "runtime" and
"vim{version}" (e.g., "vim54").
3. For MSDOS, Win32 and OS/2 Vim tries to use the directory name of the
executable. If it ends in "/src", this is removed. This is useful if you
unpacked the .zip file in some directory, and adjusted the search path to
find the vim executable. Trailing directory names are removed, in this
order: "runtime" and "vim{version}" (e.g., "vim54").
4. For Unix the compile-time defined installation directory is used (see the
output of ":version").
Once Vim has done this once, it will set the $VIM environment variable. To
change it later, use a ":let" command like this:
let $VIM = "/home/paul/vim/"
*$VIMRUNTIME*
The environment variable "$VIMRUNTIME" is used to locate various support
files, such as the on-line documentation and files used for syntax
highlighting. For example, the main help file is normally
"$VIMRUNTIME/doc/help.txt".
You don't normally set $VIMRUNTIME youself, but let Vim figure it out. This
is the order used to find the value of $VIMRUNTIME:
1. If the environment variable $VIMRUNTIME is set, it is used. You can use
this when the runtime files are in an unusual location.
2. If "$VIM/vim{version}" exists, it is used. {version} is the version
number of Vim, without any '-' or '.'. For example: "$VIM/vim54". This is
the normal value for $VIMRUNTIME.
3. If "$VIM/runtime" exists, it is used.
4. The value of $VIM is used. This is for backwards compatibility with older
versions.
5. When the 'helpfile' option is set and doesn't contain a '$', its value is
used, with "doc/help.txt" removed from the end.
For Unix, when there is a compiled-in default for $VIMRUNTIME (check the
output of ":version"), steps 2, 3 and 4 are skipped, and the compiled-in
default is used after step 5. This means that the compiled-in default
overrules the value of $VIM. This is useful if $VIM is "/etc" and the runtime
files are in "/user/share/vim/vim54".
Once Vim has done this once, it will set the $VIMRUNTIME environment variable.
To change it later, use a ":let" command like this:
let $VIMRUNTIME = "/home/piet/vim/vim54"
Note the maximum length of an expanded option is limited. How much depends on
the system, mostly it is something like 256 or 1024 characters.
*:fix* *:fixdel*
:fix[del] Set the value of 't_kD':
't_kb' is 't_kD' becomes
CTRL-? CTRL-H
not CTRL-? CTRL-?
(CTRL-? is 0177 octal, 0x7f hex) {not in Vi}
If your delete key terminal code is wrong, but the
code for backspace is alright, you can put this in
your .vimrc:
:fixdel
This works no matter what the actual code for
backspace is.
If the backspace key terminal code is wrong you can
use this:
:if &term == "termname"
: set t_kb=^V<BS>
: fixdel
:endif
Where "^V" is CTRL-V and "<BS>" is the backspace key
(don't type four characters!). Replace "termname"
with your terminal name.
If your <Delete> key sends a strange key sequence (not
CTRL-? or CTRL-H) you cannot use ":fixdel". Then use:
:if &term == "termname"
: set t_kD=^V<Delete>
:endif
Where "^V" is CTRL-V and "<Delete>" is the delete key
(don't type eight characters!). Replace "termname"
with your terminal name.
*Linux-backspace*
Note about Linux: By default the backspace key
produces CTRL-?, which is wrong. You can fix it by
putting this line in your rc.local:
echo "keycode 14 = BackSpace" | loadkeys
*NetBSD-backspace*
Note about NetBSD: If your backspace doesn't produce
the right code, try this this:
xmodmap -e "keycode 22 = BackSpace"
If this works, add this in your .Xmodmap file:
keysym 22 = BackSpace
You need to restart for this to take effect.
==============================================================================
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.
2. If you start editing a new file, the automatic commands are executed.
This can be used to set options for files matching a particular pattern and
many other things. See |autocommand|.
3. If you start editing a new file, and the 'modeline' option is on, a
number of lines at the beginning and end of the file are checked for
modelines. This is explained here.
*modeline* *vim:* *vi:* *ex:*
There are two forms of modelines. The first form:
[text]{white}{vi:|vim:|ex:}[white]{options}
[text] any text or empty
{white} at least one white space (<Space> or <Tab>)
{vi:|vim:|ex:} the string "vi:", "vim:" or "ex:"
[white] optional white space
{options} a list of option settings, separated with white space or ':',
where each part between ':' is the argument for a ":set"
command
Example:
vi:noai:sw=3 ts=6
The second form (this is compatible with some versions of Vi):
[text]{white}{vi:|vim:|ex:}[white]set {options}:[text]
[text] any text or empty
{white} at least one white space (<Space> or <Tab>)
{vi:|vim:|ex:} the string "vi:", "vim:" or "ex:"
[white] optional white space
set the string "set " (note the space)
{options} a list of options, separated with white space, which is the
argument for a ":set" command
: a colon
[text] any text or empty
Example:
/* vim: set ai tw=75: */
The white space before {vi:|vim:|ex:} is required. This minimizes the chance
that a normal word like "lex:" is caught. There is one exception: "vi:" and
"vim:" can also be at the start of the line (for compatibility with version
3.0). Using "ex:" at the start of the line will be ignored (this could be
short for "example:").
The number of lines that are checked can be set with the 'modelines' option.
If 'modeline' is off or 'modelines' is 0 no lines are checked.
Note that for the first form all of the rest of the line is used, thus a line
like:
/* vi:ts=4: */
will give an error message for the trailing "*/". This line is OK:
/* vi:set ts=4: */
If an error is detected the rest of the line is skipped.
If you want to include a ':' in a set command precede it with a '\'. The
backslash in front of the ':' will be removed. Example:
/* vi:set dir=c\:\tmp: */
This sets the 'dir' option to "c:\tmp". Only a single backslash before the
':' is removed. Thus to include "\:" you have to specify "\\:".
No other commands than "set" are supported, for security reasons (somebody
might create a Trojan horse text file with modelines).
==============================================================================
3. Saving settings *save-settings*
*:mk* *:mkexrc*
:mk[exrc] [file] Write current key mappings and changed options to
[file] (default ".exrc" in the current directory),
unless it already exists. {not in Vi}
:mk[exrc]! [file] Always write current key mappings and changed
options to [file] (default ".exrc" in the current
directory). {not in Vi}
*:mkv* *:mkvimrc*
:mkv[imrc][!] [file] Like ":mkexrc", but the default is ".vimrc" in the
current directory. The ":version" command is also
written to the file. {not in Vi}
*:mks* *:mksession*
:mks[ession][!] [file] Like ":mkvimrc", but write commands to the end of the
file that reload the files being edited at the time of
the command. |session-file|
The default file name is "Session.vim".
The created file can be loaded with a |:source|
command to recreate the current edit session.
{not in Vi} {only when compiled with the |+mksession|
feature enabled}
These commands will write ":map" and ":set" commands to a file, in such a way
that when these commands are executed, the current key mappings and options
will be set to the same values. The options 'columns', 'endofline',
'fileformat', 'key', 'lines', 'modified', 'scroll', 'term', 'textmode',
'ttyfast' and 'ttymouse' are not included, because these are terminal or file
dependent. Note that the options 'binary', 'paste' and 'readonly' are
included, this might not always be what you want.
When special keys are used in mappings, The 'cpoptions' option will be
temporarily made empty, to avoid the mappings to be misinterpreted. This
makes the file incompatible with Vi, but makes sure it can be used with
different terminals.
A common method is to use a default ".vimrc" file, make some modifications
with ":map" and ":set" commands and write the modified file. First read the
default ".vimrc" in with a command like ":source ~piet/.vimrc.Cprogs", change
the settings and then save them in the current directory with ":mkvimrc!". If
you want to make this file your default .vimrc, move it to your home directory
(on Unix), s: (Amiga) or $VIM directory (MS-DOS). You could also use
autocommands |autocommand| and/or modelines |modeline|.
If you only want to add a single option setting to your vimrc, you can use
these steps:
1. Edit your vimrc file with Vim.
2. Play with the option until it's right. E.g., try out different values for
'guifont'.
3. Append a line to set the value of the option, using the expression register
'=' to enter the value. E.g., for the 'guifont' option:
o:set guifont=<C-R>=&guifont<CR><Esc>
[<C-R> is a CTRL-R, <CR> is a return, <Esc> is the escape key]
Note that when you create a .vimrc file, this can influence the 'compatible'
option, which has several side effects. See |'compatible'|.
":mkvimrc", ":mkexrc" and ":mksession" write the command to set or reset the
'compatible' option to the output file first, because of these side effects.
*session-file*
You can use session files to quickly switch between different projects,
automatically loading the files you were last working on in that project.
Session files are a nice addition to viminfo-files, which are used to remember
information for all sessions together |viminfo-file|.
The output of ":mksession" is like ":mkvimrc", but additional commands are
added to the file. Which ones depends on the 'sessionoptions' option. The
resulting file, when executed with a ":source" command:
1. Restores mappings and options, if 'sessionoptions' contains "options".
2. Restores global variables that start with an uppercase letter and contain
at least one lowercase letter, if 'sessionoptions' contains "globals".
3. Unloads all currently loaded buffers.
4. Restores the working directory.
5. Restores GUI vim window position, if 'sessionoptions' contains "winpos".
6. Restores screen height, if 'sessionoptions' contains "resize".
7. Reloads the files you were editing, at the lines where you left them. If
'sessionoptions' contains "buffers" then all buffers are restored,
including hidden and unloaded buffers. Otherwise only buffers in windows
are restored.
8. Restores windows, if 'sessionoptions' contains "winsize".
If the Vim window size has been restored or is already the same as in the
loaded session, the window sizes are restored exactly. Otherwise, the
windows are just given sensible sizes
9. If a file exists with the same name as the session file, but ending in
"x.vim" (for eXtra), executes that as well. You can use *x.vim files to
specify additional settings and actions associated with a given session,
such as creating menu items in the GUI version.
The full filename of your current session is available in the internal
variable "v:this_session". See |this_session-variable|.
So an example mapping might be (all one line):
:nmap <S-F1> :wa<Bar>exe "mksession! " . v:this_session<CR>:so $VIM/sessions/
which saves the files and session, and starts off the command to load another.
==============================================================================
4. 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.
For some options there are two default values: The "Vim default", which is
used when 'compatible' is not set, and the "Vi default", which is used when
'compatible' is set.
Most options are the same in all windows and buffers. There are a few that
are specific to how the text is presented in a window. These can be set to a
different value in each window. For example the 'list' option can be set in
one window and reset in another for the same text, giving both types of view
at the same time. There are a few options that are specific to a certain
file. These can have a different value for each file or buffer. For example
the 'textwidth' option can be 78 for a normal text file and 0 for a C
program.
global one option for all buffers and windows
local to window each window has its own copy of this option
local to buffer each buffer has its own copy of this option
When creating a new window the option values from the currently active window
are used as a default value for the window-specific options. For the
buffer-specific options this depends on the 's' and 'S' flags in the
'cpoptions' option. If 's' in included (which is the default) the values for
buffer options are copied from the currently active buffer when a buffer is
first entered. If 'S' is present the options are copied each time the buffer
is entered, this is almost like having global options. If 's' and 'S' are not
present, the options are copied from the currently active buffer when the
buffer is created.
A jump table for the options with a short description can be found at |X_op|.
*'aleph'* *'al'* *aleph* *Aleph*
'aleph' 'al' number (default 128 for MS-DOS, 224 otherwise)
global
{not in Vi}
{only available when compiled with the |+rightleft|
feature}
The ASCII code for the first letter of the Hebrew alphabet. The
routine that maps the keyboard in Hebrew mode, both in Insert mode
(when hkmap is set) and on the command-line (when hitting CTRL-_)
outputs the Hebrew characters in the range [aleph..aleph+26].
aleph=128 applies to PC code, and aleph=224 applies to ISO 8859-8.
See |rightleft.txt|.
*'allowrevins'* *'ari'* *'noallowrevins'* *'noari'*
'allowrevins' 'ari' boolean (default off)
global
{not in Vi}
{only available when compiled with the |+rightleft|
feature}
Allow CTRL-_ in Insert and Command-line mode. This is default off, to
avoid that users that accidentally type CTRL-_ instead of SHIFT-_ get
into reverse Insert mode, and don't know how to get out. See
'revins'.
NOTE: This option is reset when 'compatible' is set.
*'altkeymap'* *'akm'* *'noaltkeymap'* *'noakm'*
'altkeymap' 'akm' boolean (default off)
global
{not in Vi}
{only available when compiled with the |+farsi|
feature}
When on, the second language is Farsi. In editing mode CTRL-_ toggles
the keyboard map between Farsi and English, when 'allowrevins' set.
When off, the keyboard map toggles between Hebrew and English. This
is useful to start the vim in native mode i.e. English (left-to-right
mode) and have default second language Farsi or Hebrew (right-to-left
mode). See |farsi.txt|.
*'autoindent'* *'ai'* *'noautoindent'* *'noai'*
'autoindent' 'ai' boolean (default off)
local to buffer
Copy indent from current line when starting a new line (typing <CR>
in Insert mode or when using the "o" or "O" command). If you do not
type anything on the new line except <BS> and then type <Esc> or
<CR>, the indent is deleted again. When autoindent is on,
formatting (with the "gq" command or when you reach 'textwidth' in
Insert mode) uses the indentation of the first line. When
'smartindent' or 'cindent' is on the indent is changed in specific
cases. The 'autoindent' option is reset when the 'paste' option is
set. {small difference from Vi: After the indent is deleted when
typing <Esc> or <CR>, the cursor position when moving up or down is
after the deleted indent; Vi puts the cursor somewhere in the deleted
indent}.
*'autowrite'* *'aw'* *'noautowrite'* *'noaw'*
'autowrite' 'aw' boolean (default off)
global
Write the contents of the file, if it has been modified, on each
:next, :rewind, :previous, :stop, :suspend, :tag, :!, :make, CTRL-]
and CTRL-^ command; and when a CTRL-O, CTRL-I, '{A-Z0-9}, or `{A-Z0-9}
command takes one to another file.
*'background'* *'bg'*
'background' 'bg' string (default "dark" or "light")
global
{not in Vi}
When set to "dark", Vim will try to use colors that look good on a
dark background. When set to "light", Vim will try to use colors that
look good on a light background. Any other value is illegal.
Vim tries to set the default value according to the terminal used.
This will not always be correct.
Setting this option does not change the background color, it tells Vim
what the backround color looks like. For changing the background
color, see |:hi-normal|.
When starting the GUI, the default value for 'background' will be
"light". When the value is not set in the .gvimrc, and Vim detects
that the background is actually quite dark, 'background' is set to
"dark". But this happens only AFTER the .gvimrc file has been read
(because the window needs to be opened to find the actual background
color). To get around this, force the GUI window to be opened by
putting a ":gui" command in the .gvimrc file, before where the value
of 'background' is used (e.g., before ":syntax on").
For the Win32 GUI, setting 'background' before starting the GUI, will
change the background and foreground colors to lightgrey on black or
black on white. On other systems setting 'background' does not
change the foreground or background colors.
Normally this option would be set in the .vimrc file. Possibly
depending on the terminal name. Example:
if &term == "pcterm"
set background=dark
endif
When this option is set, the default settings for the highlight groups
will change. To use other settings, place ":highlight" commands AFTER
the setting of the 'background' option.
This option is also used in the "$VIMRUNTIME/syntax/syntax.vim" file
to select the colors for syntax highlighting. After changing this
option, you must load syntax.vim again to see the result. This can be
done with ":syntax on".
*'backspace'* *'bs'*
'backspace' 'bs' string (default "")
global
{not in Vi}
Influences the working of <BS>, <Del>, CTRL-W and CTRL-U in Insert
mode. This is a list of items, separated by commas. Each item allows
a way to backspace over something:
value effect
indent allow backspacing over autoindent
eol allow backspacing over line breaks (join lines)
start allow backspacing over the start of insert; CTRL-W and CTRL-U
stop once at the start of insert.
When the value is empty, Vi compatible backspacing is used.
For backwards compatibility with version 5.4 and earlier:
value effect
0 same as "" (Vi compatible)
1 same as "indent,eol"
2 same as "indent,eol,start"
See |:fixdel| if your <BS> or <Del> key does not do what you want.
NOTE: This option is set to "" when 'compatible' is set.
*'backup'* *'bk'* *'nobackup'* *'nobk'*
'backup' 'bk' boolean (default off)
global
{not in Vi}
Make a backup before overwriting a file. Leave it around after the
file has been successfully written. If you do not want to keep the
backup file, but you do want a backup while the file is being
written, reset this option and set the 'writebackup' option (this is
the default). If you do not want a backup file at all reset both
options (use this if your file system is almost full). See the
|backup-table| for more explanations.
NOTE: This option is reset when 'compatible' is set.
*'backupdir'* *'bdir'*
'backupdir' 'bdir' string (default for Amiga: ".,t:",
for MS-DOS and Win32: ".,c:/tmp,c:/temp"
for Unix: ".,~/tmp,~/")
global
{not in Vi}
List of directories for the backup file, separated with commas.
- The backup file will be created in the first directory in the list
where this is possible.
- Empty means that no backup file will be created ('patchmode' is
impossible!).
- A directory "." means to put the backup file in the same directory
as the edited file.
- A directory starting with "./" (or ".\" for MS-DOS et.al.) means to
put the backup file relative to where the edited file is. The
leading "." is replaced with the path name of the edited file.
("." inside a directory name has no special meaning).
- Spaces after the comma are ignored, other spaces are considered part
of the directory name. To have a space at the start of a directory
name, precede it with a backslash.
- To include a comma in a directory name precede it with a backslash.
- A directory name may end in an '/'.
- Environment variables are expanded |:set_env|.
- Careful with '\' characters, type one before a space, type two to
get one in the option (see |option-backslash|), for example:
:set bdir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces
- For backwards compatibility with Vim version 3.0 a '>' at the start
of the option is removed.
See also 'backup' and 'writebackup' options.
If you want to hide your backup files on Unix, consider this value:
:set backupdir=./.backup,~/.backup,.,/tmp
You must create a ".backup" directory in each directory and in your
home directory for this to work properly.
The use of |:set+=| and |:set-=| is preferred when adding or removing
directories from the list. This avoids problems when a future version
uses another default.
*'backupext'* *'bex'*
'backupext' 'bex' string (default "~", for VMS: "_")
global
{not in Vi}
String which is appended to a file name to make the name of the
backup file. The default is quite unusual, because this avoids
accidentally overwriting existing files with a backup file. You might
prefer using ".bak", but make sure that you don't have files with
".bak" that you want to keep.
*'binary'* *'bin'* *'nobinary'* *'nobin'*
'binary' 'bin' boolean (default off)
local to buffer
{not in Vi}
This option should be set before editing a binary file. You can also
use the "-b" Vim argument. When this option is switched on a few
options will be changed (also when it already was on):
'textwidth' will be set to 0
'wrapmargin' will be set to 0
'modeline' will be off
'expandtab' will be off
Also, 'fileformat' and 'fileformats' options will not be used, the
file is read and written like 'fileformat' was "unix" (a single <NL>
separates lines).
NOTE: When you start editing a(nother) file while the 'bin' option is
on, settings from autocommands may change the settings again (e.g.,
'textwidth'), causing trouble when editing. You might want to set
'bin' again when the file has been loaded.
The previous values of these options are remembered and restored when
'bin' is switched from on to off. Each buffer has its own set of
saved option values.
When writing a file the <EOL> for the last line is only written if
there was one in the original file (normally Vim appends an <EOL> to
the last line if there is none; this would make the file longer). See
the 'endofline' option.
*'bioskey'* *'biosk'* *'nobioskey'* *'nobiosk'*
'bioskey' 'biosk' boolean (default on)
global
{not in Vi} {only for MS-DOS}
When on the bios is called to obtain a keyboard character. This works
better to detect CTRL-C, but only works for the console. When using a
terminal over a serial port reset this option.
Also see |'conskey'|.
*'breakat'* *'brk'*
'breakat' 'brk' string (default " ^I!@*-+_;:,./?")
global
{not in Vi}
{not available when compiled without the |+linebreak|
feature}
This option lets you choose which characters might cause a line
break if 'linebreak' is on.
*'browsedir'* *'bsdir'*
'browsedir' 'bsdir' string (default for "last")
global
{not in Vi} {only for Motif and Win32 GUI}
Which directory to use for the file browser:
last Use same directory as with last file browser.
buffer Use the directory of the related buffer.
current Use the current directory.
*'cindent'* *'cin'* *'nocindent'* *'nocin'*
'cindent' 'cin' boolean (default off)
local to buffer
{not in Vi}
{not available when compiled without the |+cindent|
feature}
Enables automatic C program indenting See 'cinkeys' to set the keys
that trigger reindenting in insert mode and 'cinoptions' to set your
preferred indent style. If 'lisp' is not on and 'equalprg' is empty,
the "=" operator indents using this algorithm rather than calling an
external program. See |C-indenting|. This option is switched off
when 'paste' is set. When you don't like the way 'cindent' works, try
the 'smartindent' option.
NOTE: This option is reset when 'compatible' is set.
'cinkeys' 'cink' string (default "0{,0},:,0#,!^F,o,O,e")
local to buffer
{not in Vi}
{not available when compiled without the |+cindent|
feature}
A list of keys that, when typed in Insert mode, cause reindenting of
the current line. Only happens if 'cindent' is on. See
|C-indenting|.
*'cinoptions'* *'cino'*
'cinoptions' 'cino' string (default "")
local to buffer
{not in Vi}
{not available when compiled without the |+cindent|
feature}
The 'cinoptions' affect the way 'cindent' reindents lines in a C
program. See |cinoptions-values| for the values of this option, and
|C-indenting| for info on C indenting in general.
*'cinwords'* *'cinw'*
'cinwords' 'cinw' string (default "if,else,while,do,for,switch")
local to buffer
{not in Vi}
{not available when compiled without both the
|+cindent| and the |+smartindent| features}
These keywords start an extra indent in the next line when
'smartindent' or 'cindent' is set. For 'cindent' this is only done at
an appropriate place (inside {}).
Note that 'ignorecase' isn't used for 'cinwords'. If case doesn't
matter, include the keyword both the upper case and lower case:
"if,If,IF".
*'clipboard'* *'cb'*
'clipboard' 'cb' string (default "")
global
{not in Vi}
{only in GUI versions or when the |+xterm_clipboard|
feature is included}
This option is a list of comma separated names.
These names are recognized:
unnamed When included, Vim will use the clipboard register '*'
for all yank, delete and put operations which would
normally go to the unnamed register. When a register
is explictly specified, it will always be used
regardless of whether "unnamed" is in 'clipboard' or
not. The clipboard register can always be explicitly
accessed using the "* notation. Also see
|gui-clipboard|.
autoselect Works like the 'a' flag in 'guioptions': If present,
then whenever Visual mode is started, or the Visual
area extended, Vim tries to become the owner of the
windowing system's global selection or put the
selected text on the clipboard. See |guioptions_a|
for details. When the GUI is active, the 'a' flag in
'guioptions' is used, when the GUI is not active, this
"autoselect" flag is used.
*'cmdheight'* *'ch'*
'cmdheight' 'ch' number (default 1)
global
{not in Vi}
Number of screen lines to use for the command-line. Helps avoiding
|hit-return| prompts.
*'columns'* *'co'*
'columns' 'co' number (default 80 or terminal width)
global
{not in Vi}
Number of columns of the screen. Normally this is set by the terminal
initialization and does not have to be set by hand.
When Vim is running in the GUI or in a resizable window, setting this
option may cause the window size to be changed.
When you set this option and Vim is unable to change the physical
number of columns of the display, the display may be messed up.
*'comments'* *'com'*
'comments' 'com' string (default
"s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-")
local to buffer
{not in Vi}
{not available when compiled without the |+comments|
feature}
A comma separated list of strings that can start a comment line. See
|format-comments|. See |option-backslash| about using backslashes to
insert a space.
*'compatible'* *'cp'* *'nocompatible'* *'nocp'*
'compatible' 'cp' boolean (default on, off when a .vimrc file is found)
global
{not in Vi}
This option has the effect of making Vim either more Vi-compatible, or
make Vim behave in a more useful way.
This is a special kind of option, because when it's set or reset,
other options are also changed as a side effect. CAREFUL: Setting or
resetting this option can have a lot of unexpected effects: Mappings
are interpreted in another way, undo behaves differently, etc. If you
set this option in your vimrc file, you should probably put it at the
very start.
By default this option is on and the Vi defaults are used for the
options. This default was chosen for those people who want to use Vim
just like Vi, and don't even (want to) know about the 'compatible'
option.
When a ".vimrc" file is found while Vim is starting up, this option is
switched off, and all options that have not been modified will be set
to the Vim defaults. Effectively, this means that when a ".vimrc"
file exists, Vim will use the Vim defaults, otherwise it will use the
Vi defaults. (Note: This doesn't happen for the system-wide vimrc
file). Also see |compatible-default|.
You can also set this option with the "-C" argument, and reset it with
"-N". See |-C| and |-N|.
Switching this option off makes the Vim defaults be used for options
that have a different Vi and Vim default value. See the options
marked with a '+' below. Other options are not modified.
At the moment this option is set, several other options will be set
or reset to make Vim as Vi-compatible as possible. See the table
below. This can be used if you want to revert to Vi compatible
editing.
See also 'cpoptions'.
option + set value effect
'allowrevins' off no CTRL-_ command
'backspace' "" normal backspace
'backup' off no backup file
'cindent' off no C code indentation
'cpoptions' + (all flags) Vi-compatible flags
'cscopetag' off don't use cscope for ":tag"
'cscopetagorder' 0 see |cscopetagorder|
'cscopeverbose' off see |cscopeverbose|
'digraph' off no digraphs
'esckeys' + off no <Esc>-keys in Insert mode
'expandtab' off tabs not expanded to spaces
'fileformats' + "" no automatic file format detection,
"dos,unix" except for DOS, Windows and OS/2
'formatoptions' + "vt" Vi compatible formatting
'gdefault' off no default 'g' flag for ":s"
'history' + 0 no commandline history
'hkmap' off no Hebrew keyboard mapping
'hkmapp' off no phonetic Hebrew keyboard mapping
'hlsearch' off no highlighting of search matches
'incsearch' off no incremental searching
'insertmode' off do not start in Insert mode
'iskeyword' + "@,48-57,_" keywords contain alphanumeric
characters and '_'
'joinspaces' on insert 2 spaces after period
'modeline' + off no modelines
'more' + off no pauses in listings
'revins' off no reverse insert
'ruler' off no ruler
'scrolljump' 1 no jump scroll
'scrolloff' 0 no scroll offset
'shiftround' off indent not rounded to shiftwidth
'shortmess' + "" no shortening of messages
'showcmd' + off command characters not shown
'showmode' + off current mode not shown
'smartcase' off no automatic ignore case switch
'smartindent' off no smart indentation
'smarttab' off no smart tab size
'softtabstop' 0 tabs are always 'tabstop' positions
'startofline' on goto startofline with some commands
'tagrelative' + off tag file names are not relative
'textauto' + off no automatic textmode detection
'textwidth' 0 no automatic line wrap
'tildeop' off tilde is not an operator
'ttimeout' off no terminal timeout
'whichwrap' + "" left-right movements don't wrap
'wildchar' + CTRL-E only when the current value is <Tab>
use CTRL-E for cmdline completion
'writebackup' on or off depends on +writebackup feature
*'complete'* *'cpt'*
'complete' 'cpt' string (default: ".,w,b,u,t,i")
local to buffer
{not in Vi}
This option specifies how keyword completion |ins-completion| works
when CTRL-P or CTRL-N are used. It indicates the type of completion
and the places to scan. It is a comma separated list of flags:
. scan the current buffer ('wrapscan' is ignored)
w scan buffers from other windows
b scan other loaded buffers
u scan the unloaded buffers
k scan the files given with the 'dictionary' option
k[dict] scan the file [dict]. Several "k" flags can be given,
patterns are valid too. For example:
:set cpt=k/usr/dict/*,k~/spanish
i scan current and included files
d scan current and included files for defined name or macro
|i_CTRL-X_CTRL-D|
] tag completion
t same as "]"
Unloaded buffers are not loaded, thus their autocmds |:autocmd| are
not executed, this may lead to unexpected completions from some files
(gzipped files for example)
The default is ".,w,b,u,t,i", which means to scan:
1. the current buffer
2. buffers in other windows
3. other loaded buffers
4. unloaded buffers
5. tags
6. included files
As you can see, CTRL-N and CTRL-P can be used to do any 'iskeyword'-
based expansion (eg dictionary |i_CTRL-X_CTRL-K|, included patterns
|i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions)
*'confirm'* *'cf'* *'noconfirm'* *'nocf'*
'confirm' 'cf' boolean (default off)
global
{not in Vi}
When 'confirm' is on, certain operations that would normally
fail because of unsaved changes to a buffer, e.g. ":q" and ":e",
instead raise a |dialog| asking if you wish to save the current
file(s). You can still use a ! to unconditionally |abandon| a buffer.
If 'confirm' is off you can still activate confirmation for one
command only (this is most useful in mappings) with the |:confirm|
command.
Also see the |confirm()| function and the 'v' flag in 'guioptions'.
*'conskey'* *'consk'* *'noconskey'* *'noconsk'*
'conskey' 'consk' boolean (default off)
global
{not in Vi} {only for MS-DOS}
When on direct console I/O is used to obtain a keyboard character.
This should work in most cases. Also see |'bioskey'|. Together,
three methods of console input are available:
'conskey' 'bioskey' action
on on or off direct console input
off on BIOS
off off STDIN
*'cpoptions'* *'cpo'*
'cpoptions' 'cpo' string (Vim default: "aABceFs",
Vi default: all flags)
global
{not in Vi}
A sequence of single character flags. When a character is present
this indicates vi-compatible behavior. This is used for things where
not being vi-compatible is mostly or sometimes preferred.
'cpoptions' stands for "compatible-options".
Commas can be added for readability.
To avoid problems with flags that are added in the future, use the
"+=" and "-=" feature of ":set" |add-option-flags|.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
contains behaviour
a When included, a ":read" command with a file name
argument will set the alternate file name for the
current window.
A When included, a ":write" command with a file name
argument will set the alternate file name for the
current window.
b "\|" in a ":map" command is recognized as the end of
the map command. The '\' is included in the mapping,
the text after the '|' is interpreted as the next
command. Use a CTRL-V instead of a backslash to
include the '|' in the mapping. Applies to all
mapping, abbreviation, menu and autocmd commands.
See also |map_bar|.
B A backslash has no special meaning in mappings,
abbreviations and the "to" part of the menu commands.
Remove this flag to be able to use a backslash like a
CTRL-V. For example, the command ":map X \<Esc>"
results in X being mapped to:
'B' included: "\^[" (^[ is a real <Esc>)
'B' excluded: "<Esc>" (5 characters)
('<' excluded in both cases)
C Do not concatenate sourced lines that start with a
backslash. See |line-continuation|.
< Disable the recognition of special key codes in |<>|
form in mappings, abbreviations, and the "to" part of
menu commands. For example, the command
":map X <Tab>" results in X being mapped to:
'<' included: "<Tab>" (5 characters)
'<' excluded: "^I" (^I is a real <Tab>)
Also see the 'k' flag below.
c Searching continues at the end of any match at the
cursor position. When not present searching continues
one character from the cursor position. With 'c'
"abababababab" only gets three matches when repeating
"/abab", without 'c' there are five matches.
d Using "./" in the 'tags' option doesn't mean to use
the tags file relative to the current file, but the
tags file in the current directory.
e When executing a register with ":@r", always add a
<CR> to the last line, also when the register is not
linewise. If this flag is not present, the register
is not linewise and the last line does not end in a
<CR>, then the last line is put on the command-line
and can be edited before hitting <CR>.
E It is an error when using "y", "d", "c", "g~", "gu" or
"gU" on an Empty region. The operators only work when
at least one character is to be operate on. Example:
This makes "y0" fail in the first column.
f When included, a ":read" command with a file name
argument will set the file name for the current buffer,
if the current buffer doesn't have a file name yet.
F When included, a ":write" command with a file name
argument will set the file name for the current
buffer, if the current buffer doesn't have a file name
yet.
j When joining lines, only add two spaces after a '.',
not after '!' or '?'. Also see 'joinspaces'.
J A |sentence| has to be followed by two spaces after
the '.', '!' or '?'. A <Tab> is not recognized as
white space.
k Disable the recognition of raw key codes in
mappings, abbreviations, and the "to" part of menu
commands. For example, if <Key> sends ^[OA (where ^[
is <Esc>), the command ":map X ^[OA" results in X
being mapped to:
'k' included: "^[OA" (3 characters)
'k' excluded: "<Key>" (one key code)
Also see the '<' flag above.
K Don't wait for a key code to complete when it is
halfway a mapping. This breaks mapping <F1><F1> when
only part of the second <F1> has been read. It
enables cancelling the mapping by typing <F1><Esc>.
l Backslash in a [] range in a search pattern is taken
literally, only "\]" is special See |/[]|
'l' included: "/[ \t]" finds <Space>, '\' and 't'
'l' excluded: "/[ \t]" finds <Space> and <Tab>
L When the 'list' option is set, 'wrapmargin',
'textwidth' and Virtual replace mode (see |gR|) count
a <Tab> as two characters, instead of the normal
behavior of a <Tab>.
m When included, a showmatch will always wait half a
second. When not included, a showmatch will wait half
a second or until a character is typed. |'showmatch'|
o Line offset to search command is not remembered for
next search.
O Don't complain if a file is being overwritten, even
when it didn't exist when editing it. This is a
protection agains a file unexpectedly created by
someone else. Vi didn't complain about this.
p Vi compatible Lisp indenting. When not present, a
slightly better algorithm is used.
r Redo ("." command) uses "/" to repeat a search
command, instead of the actually used search string.
s Set buffer options when entering the buffer for the
first time. This is like it is in Vim version 3.0.
And it is the default. If not present the options are
set when the buffer is created.
S Set buffer options always when entering a buffer
(except 'readonly', 'fileformat', 'filetype' and
'syntax'). This is the (most) Vi compatible setting.
The options are set to the values in the current
buffer. When you change an option and go to another
buffer, the value is copied. Effectively makes the
buffer options global to all buffers.
's' 'S' copy buffer options
no no when buffer created
yes no when buffer first entered (default)
X yes each time when buffer entered (vi comp.)
t Search pattern for the tag command is remembered for
"n" command. Otherwise Vim only puts the pattern in
the history for search pattern, but doesn't change the
last used search pattern.
u Undo is Vi compatible. See |undo-two-ways|.
w When using "cw" on a blank character, only change one
character and not all blanks until the start of the
next word.
W Don't overwrite a readonly file. When omitted, ":w!"
overwrites a readonly file, if possible.
x <Esc> on the command-line executes the command-line.
The default in Vim is to abandon the command-line,
because <Esc> normally aborts a command. |c_<Esc>|
y A yank command can be redone with ".".
$ When making a change to one line, don't redisplay the
line, but put a '$' at the end of the changed text.
The changed text will be overwritten when you type the
new text. The line is redisplayed if you type any
command that moves the cursor from the insertion
point.
! When redoing a filter command, use the last used
external command, whatever it was. Otherwise the last
used -filter- command is used.
* Use ":*" in the same way as ":@". When not included,
":*" is an alias for ":'<,'>", select the Visual area.
% Vi-compatible matching is done for the "%" command.
Does not recognize "#if", "#endif", etc.
Does not recognize "/*" and "*/".
Parens inside single and double quotes are also
counted, causing a string that contains a paren to
disturb the matching. For example, in a line like
"if (strcmp("foo(", s))" the first paren does not
match the last one. When this flag is not included,
parens inside single and double quotes are treated
specially. When matching a paren outside of quotes,
everything inside quotes is ignored. When matching a
paren inside quotes, it will find the matching one (if
there is one). This works very well for C programs.
*'cscopeprg'* *'csprg'*
'cscopeprg' 'csprg' string (default "cscope")
global
{not available when compiled without the |+cscope|
feature}
{not in Vi}
Specifies the command to execute cscope. See |cscopeprg|.
When this option is set from a |modeline|, while the 'secure' option
is set, you will get a warning message.
*'cscopetag'* *'cst'* *'nocscopetag'* *'nocst'*
'cscopetag' 'cst' boolean (default off)
global
{not available when compiled without the |+cscope|
feature}
{not in Vi}
Use cscope for tag commands. See |cscope-options|.
NOTE: This option is reset when 'compatible' is set.
*'cscopetagorder'* *'csto'*
'cscopetagorder' 'csto' number (default 0)
global
{not available when compiled without the |+cscope|
feature}
{not in Vi}
Determines the order in which ":cstag" performs a search. See
|cscopetagorder|.
NOTE: This option is set to 0 when 'compatible' is set.
*'cscopeverbose'* *'csverb'*
*'nocscopeverbose'* *'nocsverb'*
'cscopeverbose' 'csverb' boolean (default off)
global
{not available when compiled without the |+cscope|
feature}
{not in Vi}
Give messages when adding a cscope database. See |cscopeverbose|.
NOTE: This option is reset when 'compatible' is set.
*'define'* *'def'*
'define' 'def' string (default "^#\s*define")
global
{not in Vi}
Pattern to be used to find a macro definition. It is a search
pattern, just like for the "/" command. This option is used for the
commands like "[i" and "[d" |include-search|. The 'isident' option is
used to recognize the identifier name after the match. See
|option-backslash| about inserting backslashes to include a space or
backslash.
The default value is for C programs. For C++ this value would be
useful, to include const type declarations:
^\(#\s*define\|[a-z]*\s*const\s*[a-z]*\)
When using the ":set" command, you need to double the backslashes!
*'dictionary'* *'dict'*
'dictionary' 'dict' string (default "")
global
{not in Vi}
List of file names, separated by commas, that are used to lookup words
for keyword completion commands |i_CTRL-X_CTRL-K|. Each file should
contain a list of words. This can be one word per line, or several
words per line, separated by non-keyword characters (white space is
preferred).
To include a comma in a file name precede it with a backslash. Spaces
after a comma are ignored, otherwise spaces are included in the file
name. See |option-backslash| about using backslashes.
Where to find a list of words?
- On FreeBSD, there is the file "/usr/share/dict/words".
- In the Simtel archive, look in the "msdos/linguist" directory.
- In "miscfiles" of the GNU collection.
The use of |:set+=| and |:set-=| is preferred when adding or removing
directories from the list. This avoids problems when a future version
uses another default.
*'digraph'* *'dg'* *'nodigraph'* *'nodg'*
'digraph' 'dg' boolean (default off)
global
{not in Vi}
{not available when compiled without the |+digraphs|
feature}
Enable the entering of digraphs in Insert mode with {char1} <BS>
{char2}. See |digraphs|.
NOTE: This option is reset when 'compatible' is set.
*'directory'* *'dir'*
'directory' 'dir' string (default for Amiga: ".,t:",
for MS-DOS and Win32: ".,c:\tmp,c:\temp"
for Unix: ".,~/tmp,/var/tmp,/tmp")
global
List of directory names for the swap file, separated with commas.
- The swap file will be created in the first directory where this is
possible.
- Empty means that no swap file will be used (recovery is
impossible!).
- A directory "." means to put the swap file in the same directory as
the edited file. On Unix, a dot is prepended to the file name, so
it doesn't show in a directory listing.
- A directory starting with "./" (or ".\" for MS-DOS et.al.) means to
put the swap file relative to where the edited file is. The leading
"." is replaced with the path name of the edited file.
- For Unix and Win32, if a directory ends in two path separators, the
swap file name will be built from the complete path to the file
with all path separators substituted to percent '%' signs. This will
ensure file name uniqueness in the preserve directory.
- Spaces after the comma are ignored, other spaces are considered part
of the directory name. To have a space at the start of a directory
name, precede it with a backslash.
- To include a comma in a directory name precede it with a backslash.
- A directory name may end in an ':' or '/'.
- Environment variables are expanded |:set_env|.
- Careful with '\' characters, type one before a space, type two to
get one in the option (see |option-backslash|), for example:
:set dir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces
- For backwards compatibility with Vim version 3.0 a '>' at the start
of the option is removed.
Using "." first in the list is recommended. This means that editing
the same file twice will result in a warning. Using "/tmp" on Unix is
discouraged: When the system crashes you lose the swap file.
"/var/tmp" is often not cleared when rebooting, thus is a better
choice than "/tmp". But it can contain a lot of files, your swap
files get lost in the crowd. That is why a "tmp" directory in your
home directory is tried first.
The use of |:set+=| and |:set-=| is preferred when adding or removing
directories from the list. This avoids problems when a future version
uses another default.
{Vi: directory to put temp file in, defaults to "/tmp"}
*'display'* *'dy'*
'display' 'dy' string (default "")
global
{not in Vi}
Change the way text is displayed. This is comma separated list of
flags. Currently only one is supported:
lastline When included, as much as possible of the last line
in a window will be displayed. When not included, a
last line that doesn't fit is replaced with "@" lines.
*'ed'* *'edcompatible'* *'noed'* *'noedcompatible'*
'edcompatible' 'ed' boolean (default off)
global
Makes the 'g' and 'c' flags of the ":substitute" command to be
toggled each time the flag is given. See |complex-change|. See
also 'gdefault' option.
Switching this option on is discouraged!
*'endofline'* *'eol'* *'noendofline'* *'noeol'*
'endofline' 'eol' boolean (default on)
local to buffer
{not in Vi}
When writing a file and this option is off and the 'binary' option
is on, no <EOL> will be written for the last line in the file. This
option is automatically set when starting to edit a new file, unless
the file does not have an <EOL> for the last line in the file, in
which case it is reset. Normally you don't have to set or reset this
option. When 'binary' is off the value is not used when writing the
file. When 'binary' is on it is used to remember the presence of a
<EOL> for the last line in the file, so that when you write the file
the situation from the original file can be kept. But you can change
it if you want to.
*'equalalways'* *'ea'* *'noequalalways'* *'noea'*
'equalalways' 'ea' boolean (default on)
global
{not in Vi}
When on, all the windows are automatically made the same size after
splitting or closing a window. When off, splitting a window will
reduce the size of the current window and leave the other windows the
same. When closing a window the extra lines are given to the window
above it.
*'equalprg'* *'ep'*
'equalprg' 'ep' string (default "")
global
{not in Vi}
External program to use for "=" command. When this option is empty
the internal formatting functions are used ('lisp' or 'cindent').
Environment variables are expanded |:set_env|. See |option-backslash|
about including spaces and backslashes.
When this option is set from a |modeline|, while the 'secure' option
is set, you will get a warning message.
*'errorbells'* *'eb'* *'noerrorbells'* *'noeb'*
'errorbells' 'eb' boolean (default off)
global
Ring the bell (beep or screen flash) for error messages. This only
makes a difference for error messages, the bell will be used always
for a lot of errors without a message (e.g., hitting <Esc> in Normal
mode). See 'visualbell' on how to make the bell behave like a beep,
screen flash or do nothing.
*'errorfile'* *'ef'*
'errorfile' 'ef' string (Amiga default: "AztecC.Err",
others: "errors.err")
global
{not in Vi}
{not available when compiled without the |+quickfix|
feature}
Name of the errorfile for the QuickFix mode (see |:cf|).
When the "-q" command-line argument is used, 'errorfile' is set to the
following argument. See |-q|.
NOT used for the ":make" command. See 'makeef' for that.
Environment variables are expanded |:set_env|.
See |option-backslash| about including spaces and backslashes.
*'errorformat'* *'efm'*
'errorformat' 'efm' string (default is very long)
global
{not in Vi}
{not available when compiled without the |+quickfix|
feature}
Scanf-like description of the format for the lines in the error file
(see |errorformat|).
*'esckeys'* *'ek'* *'noesckeys'* *'noek'*
'esckeys' 'ek' boolean (Vim default: on, Vi default: off)
global
{not in Vi}
Function keys that start with an <Esc> are recognized in Insert
mode. When this option is off, the cursor and function keys cannot be
used in Insert mode if they start with an <Esc>. The advantage of
this is that the single <Esc> is recognized immediately, instead of
after one second. Instead of resetting this option, you might want to
try changing the values for 'timeoutlen' and 'ttimeoutlen'. Note that
when 'esckeys' is off, you can still map anything, but the cursor keys
won't work by default.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'eventignore'* *'ei'*
'eventignore' 'ei' string (default "")
global
{not in Vi}
A list of autocommand event names, which are to be ignored.
When set to "all", all autocommand events are ignored, autocommands
will not be executed.
Otherwise this is a comma separated list of event names. Example:
:set ei=WinEnter,WinLeave
*'expandtab'* *'et'* *'noexpandtab'* *'noet'*
'expandtab' 'et' boolean (default off)
local to buffer
{not in Vi}
In Insert mode: Use the appropriate number of spaces to insert a
<Tab>. Spaces are used in indents with the '>' and '<' commands and
when 'autoindent' is on. To insert a real tab when 'expandtab' is
on, use CTRL-V<Tab>. See also |:retab| and |ins-expandtab|.
NOTE: This option is reset when 'compatible' is set.
*'exrc'* *'ex'* *'noexrc'* *'noex'*
'exrc' 'ex' boolean (default off)
global
{not in Vi}
Enables the reading of .vimrc, .exrc and .gvimrc in the current
directory. If you switch this option on you should also consider
setting the 'secure' option (see |initialization|). Using a local
.exrc, .vimrc or .gvimrc is a potential security leak, use with care!
also see |.vimrc| and |gui-init|.
This option cannot be set from a |modeline|.
*'fileencoding'* *'fe'*
'fileencoding' 'fe' string (default: "ansi")
local to buffer
{only available when compiled with the |+multi_byte|
feature}
{not in Vi}
Enables editing of alternative encoded files, for example shift-JIS or
Unicode. When you set this option, it fires of a 'FileEncoding'
autocommand so you can set up fonts if necessary.
See |multibyte|.
Possible values are:
ansi default setting, good for most Western languages
unicode (to be implemented>
japan set to use shift-JIS (Windows CP 932) encoding
korea set to use Korean DBCS
prc use simplified Chinese encoding
taiwan use traditional Chinese encoding
hebrew (to be implemented)
farsi (to be implemented)
This lets you view, for example, a Japanese S-JIS encoded file
(provided you have a suitable font). The DBCS characters are treated
as a unit, i.e. you cursor past them or delete them, etc as a unit,
rather than deleting half a character.
*'fileformat'* *'ff'*
'fileformat' 'ff' string (DOS, Win32, OS/2 default: "dos",
Unix default: "unix",
Macintosh default: "mac")
local to buffer
{not in Vi}
This gives the <EOL> of the current buffer, which is used for
reading/writing the buffer from/to a file:
dos <CR> <NL>
unix <NL>
mac <CR>
When "dos" is used, CTRL-Z at the end of a file is ignored.
See |file-formats| and |file-read|.
When 'binary' is set, the value of 'fileformat' is ignored, file I/O
works like it was set to "unix'.
This option is set automatically when starting to edit a file and
'fileformats' is not empty and 'binary' is off.
When this option is set, after starting to edit a file, the 'modified'
option is set, because the file would be different when written.
For backwards compatibility: When this option is set to "dos",
'textmode' is set, otherwise 'textmode' is reset.
*'fileformats'* *'ffs'*
'fileformats' 'ffs' string (Vim+Vi DOS, Win32, OS/2 default: "dos,unix",
Vim Unix default: "unix,dos",
Vim Mac default: "mac,unix,dos",
Vi others default: "")
global
{not in Vi}
This gives the end-of-line (<EOL>) formats that will be tried. It is
used when starting to edit a new buffer and when reading a file into
an existing buffer:
- When empty, the format defined with 'fileformat' will be used
always. It is not set automatically.
- When set to one name, that format will be used whenever a new buffer
is opened. 'fileformat' is set accordingly for that buffer. The
'fileformats' name will be used when a file is read into an existing
buffer, no matter what 'fileformat' for that buffer is set to.
- When more than one name is present, separated by commas, automatic
<EOL> detection will be done when reading a file. When starting to
edit a file, a check is done for the <EOL>:
1. If all lines end in <CR><NL>, and 'fileformats' includes "dos",
'fileformat' is set to "dos".
2. If a <NL> is found and 'fileformats' includes "unix, 'fileformat'
is set to "unix". Note that when a <NL> is found without a
preceding <CR>, "unix" is preferred over "dos".
3. If 'fileformats' includes "mac", 'fileformat' is set to "mac".
This means that "mac" is only chosen when "unix" is not present,
or when no <NL> is found in the file, and when "dos" is not
present, or no <CR><NL> is present in the file.
Also if "unix" was first chosen, but the first <CR> is before
the first <NL> and there appears to be more <CR>'s than <NL>'s in
the file, then 'fileformat' is set to "mac".
4. If 'fileformat' is still not set, the first name from
'fileformats' is used.
When reading a file into an existing buffer, the same is done, but
this happens like 'fileformat' has been set appropriately for that
file only, the option is not changed.
When 'binary' is set, the value of 'fileformats' is not used.
For systems with a Dos-like <EOL> (<CR><NL>), when reading files that
are ":source"ed and for vimrc files, automatic <EOL> detection may be
done:
- When 'fileformats' is empty, there is no automatic detection. Dos
format will be used.
- When 'fileformats' is set to one or more names, automatic detection
is done. This is based on the first <NL> in the file: If there is a
<CR> in front of it, Dos format is used, otherwise Unix format is
used.
Also see |file-formats|.
For backwards compatibility: When this option is set to an empty
string or one format (no comma is included), 'textauto' is reset,
otherwise 'textauto' is set.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'filetype'* *'ft'*
'filetype' 'ft' string (default: "")
local to buffer
{not in Vi}
{not available when compiled without the |+autocmd|
feature}
When this option is set, the FileType autocommand event is triggered.
All autocommands that match with the value of this option will be
executed. Thus the value of 'filetype' is used in place of the file
name.
Otherwise this option does not always reflect the current file type.
This option is normally set when the file type is detected. To enable
this use the ":filetype on" command. |:filetype|
Setting this option to a different value is most useful in a modeline,
for a file for which the file type is not automatically recognized.
Example, for in an IDL file:
/* vim: set filetype=idl : */
|FileType| |autocmd-filetypes|
Do not confuse this option with 'osfiletype', which is for the file
type that is actually stored with the file.
This option is not copied to another buffer, independent of the 's' or
'S' flag in 'cpoptions'.
*'fkmap'* *'fk'* *'nofkmap'* *'nofk'*
'fkmap' 'fk' boolean (default off)
global
{not in Vi}
{only available when compiled with the |+rightleft|
feature}
When on, the keyboard is mapped for the Farsi character set.
Normally you would set 'allowrevins' and use CTRL-_ in insert mode to
toggle this option |i_CTRL-_|. See |farsi.txt|.
*'formatoptions'* *'fo'*
'formatoptions' 'fo' string (Vim default: "tcq", Vi default: "vt")
local to buffer
{not in Vi}
This is a sequence of letters which describes how automatic
formatting is to be done. See |fo-table|. When the 'paste' option is
on, no formatting is done (like 'formatoptions' is empty). Commas can
be inserted for readability.
To avoid problems with flags that are added in the future, use the
"+=" and "-=" feature of ":set" |add-option-flags|.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'formatprg'* *'fp'*
'formatprg' 'fp' string (default "")
global
{not in Vi}
The name of an external program that will be used to format the lines
selected with the "gq" command. The program must take the input on
stdin and produce the output on stdout. The Unix program "fmt" is
such a program. If this option is an empty string, the internal
format function will be used |C-indenting|. Environment variables are
expanded |:set_env|. See |option-backslash| about including spaces
and backslashes.
When this option is set from a |modeline|, while the 'secure' option
is set, you will get a warning message.
*'gdefault'* *'gd'* *'nogdefault'* *'nogd'*
'gdefault' 'gd' boolean (default off)
global
{not in Vi}
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
NOTE: This option is reset when 'compatible' is set.
*'grepformat'* *'gfm'*
'grepformat' 'gfm' string (default "%f:%l%m,%f %l%m")
global
{not in Vi}
Format to recognize for the ":grep" command output.
This is a scanf-like string that uses the same format as the
'errorformat' option: see |errorformat|.
*'grepprg'* *'gp'*
'grepprg' 'gp' string (default "grep -n", Win32: "findstr /n")
global
{not in Vi}
Program to use for the ":grep" command. This option may contain '%'
and '#' characters, which are expanded like when used in a command-
line. The placeholder "$*" is allowed to specify where the arguments
will be included. Environment variables are expanded |:set_env|. See
|option-backslash| about including spaces and backslashes.
See also the section |:make_makeprg|, since most of the comments there
apply equally to 'grepprg'.
When this option is set from a |modeline|, while the 'secure' option
is set, you will get a warning message.
*'guicursor'* *'gcr'*
'guicursor' 'gcr' string (default "n-v-c:block-Cursor,ve:ver35-Cursor,
o:hor50-Cursor,i-ci:ver25-Cursor,
r-cr:hor20-Cursor,sm:block-Cursor
-blinkwait175-blinkoff150-blinkon175")
global
{not in Vi}
{only available when compiled with GUI enabled, and
for MSDOS and Win32 console}
This option tells Vim what the cursor should look like in different
modes. The option is a comma separated list of parts. Each part
consist of a mode-list and an argument-list:
mode-list:argument-list,mode-list:argument-list,..
The mode-list is a dash separated list of these modes:
n Normal mode
v Visual mode
ve Visual mode with 'selection' "exclusive" (same as 'v',
if not specified)
o Operator-pending mode
i Insert mode
r Replace mode
c Command-line Normal (append) mode
ci Command-line Insert mode
cr Command-line Replace mode
sm showmatch in Insert mode
a all modes
The argument-list is a dash separated list of these arguments:
hor{N} horizontal bar, {N} percent of the character height
ver{N} vertical bar, {N} percent of the character width
block block cursor, fills the whole character
[only one of the above three should be present]
blinkwait{N} *cursor-blinking*
blinkon{N}
blinkoff{N}
blink times for cursor: blinkwait is the delay before
the cursor starts blinking, blinkon is the time that
the cursor is shown and blinkoff is the time that the
cursor is not shown. The times are in msec. When one
of the numbers is zero, there is no blinking. The
default is: "blinkwait700-blinkon400-blinkoff250".
These numbers are used for a missing entry. This
means that blinking is enabled by default. To switch
blinking off you can use "blinkon0". The cursor only
blinks when Vim is waiting for input, not while
executing a command.
To make the cursor blink in an xterm, see
|xterm-blink|.
{group-name}
a highlight group name, that sets the color and font
for the cursor
Examples of parts:
n-c-v:block-nCursor in Normal, Command-line and Visual mode, use a
block cursor with colors from the "nCursor"
highlight group
i-ci:ver30-iCursor-blinkwait300-blinkon200-blinkoff150
In Insert and Command-line Insert mode, use a
30% vertical bar cursor with colors from the
"iCursor" highlight group. Blink a bit
faster.
The 'a' mode is different. It will set the given argument-list for
all modes. It does not reset anything to defaults. This can be used
to do a common setting for all modes. For example, to switch off
blinking: "a:blinkon0"
Examples of cursor highlighting:
:highlight Cursor gui=reverse guifg=NONE guibg=NONE
:highlight Cursor gui=NONE guifg=bg guibg=fg
In an MSDOS or Win32 console, only the height of the cursor can be
changed. This can be done by specifying a block cursor, or a
percentage for a vertical or horizontal cursor.
*'guifont'* *'gfn'*
'guifont' 'gfn' string (default "")
global
{not in Vi}
{only available when compiled with GUI enabled}
This is a list of fonts which will be used for the GUI version of Vim.
In its simplest form the value is just one font name. When
the font cannot be found you will get an error message. To try other
font names a list can be specified, font names separated with commas.
The first valid font is used.
Spaces after a comma are ignored. To include a comma in a font name
precede it with a backslash. Setting an option requires an extra
backslash before a space and a backslash. See also
|option-backslash|. For example:
:set guifont=Screen15,\ 7x13,font\\,with\\,commas
will make vim try to use the font "Screen15" first, and if it fails it
will try to use "7x13" and then "font,with,commas" instead.
Note that the fonts must be mono-spaced (all characters have the same
width).
To preview a font on X11, you might be able to use the "xfontsel"
program. The "xlsfonts" program gives a list of all available fonts.
For Win32 and GTK only:
:set guifont=*
will bring up a font requester, where you can pick the font you want.
If none of the fonts can be loaded, vim will keep the current setting.
If an empty font list is given, vim will try using other resource
settings (for X, it will use the Vim.font resource), and finally it
will try some builtin default which should always be there ("7x13" in
the case of X). The font names given should be "normal" fonts. Vim
will try to find the related bold and italic fonts.
For the Win32 GUI
- takes these options in the font name:
hXX - height is XX (points)
wXX - width is XX (points)
b - bold
i - italic
u - underline
s - strikeout
Use a ':' to separate the options.
- A '_' can be used in the place of a space, so you don't need to use
backslashes to escape the spaces.
- Example:
:set guifont=courier_new:h12:w5:b
Have a look at http://nova.bsuvc.bsu.edu/prn/monofont/ for
mono-spaced fonts and comments on them.
See also |font-sizes|.
*'guiheadroom'* *'ghr'*
'guiheadroom' 'ghr' number (default 50)
global
{not in Vi} {only for GTK and X11 GUI}
The number of pixels subtracted from the screen height when fitting
the GUI window on the screen. Set this before the GUI is started,
e.g., in your |gvimrc| file. When zero, the whole screen height will
be used by the window. When positive, the specified number of pixel
lines will be left for window decorations and other items on the
screen. Set it to a negative value to allow windows taller than the
screen.
*'guifontset'* *'gfs'*
'guifontset' 'gfs' string (default "")
global
{not in Vi}
{only available when compiled with GUI enabled and
with the |+xfontset| feature}
When not empty, specifies two fonts to be used. The first one for
normal english, the second one for your special language. See
|xfontset|.
*'guioptions'* *'go'*
'guioptions' 'go' string (default "agimrtT" (Win32 and GTK),
"agimrt" (Unix) or "gmrt")
global
{not in Vi}
{only available when compiled with GUI enabled}
This option only has an effect in the GUI version of vim. It is a
sequence of letters which describes what components and options of the
GUI should be used.
To avoid problems with flags that are added in the future, use the
"+=" and "-=" feature of ":set" |add-option-flags|.
Valid letters are as follows:
*guioptions_a*
'a' Autoselect: If present, then whenever VISUAL mode is started,
or the Visual area extended, Vim tries to become the owner of
the windowing system's global selection. This means that the
Visually highlighted text is available for pasting into other
applications as well as into Vim itself. When the Visual mode
ends, possibly due to an operation on the text, or when an
application wants to paste the selection, the highlighted text
is automatically yanked into the "* selection register.
Thus the selection is still available for pasting into other
applications after the VISUAL mode has ended.
If not present, then Vim won't become the owner of the
windowing system's global selection unless explicitly told to
by a yank or delete operation for the "* register.
'f' Foreground: Don't use fork() to detach the GUI from the shell
where it was started. Use this for programs that wait for the
editor to finish (e.g., an e-mail program). Alternatively you
can use "gvim -f" or ":gui -f" to start the GUI in the
foreground. |gui-fork|
Note: Set this option in the vimrc file. The forking may have
happened already when the gvimrc file is read.
'i' Use a Vim icon. For GTK with KDE it is used in the left-upper
corner of the window. It's black&white on non-GTK, because of
limitations of X11. For a color icon, see |X11-icon|.
'm' Menu bar is present.
'M' The system menu "$VIMRUNTIME/menu.vim" is not sourced. Note
that this flag must be added in the .vimrc file. When the
.gvimrc file is sourced the system menu has already been
loaded.
'g' Grey menu items: Make menu items that are not active grey. If
'g' is not included inactive menu items are not shown at all.
Exception: Athena will always use grey menu items.
't' Include tearoff menu items. Currently only works for Win32,
GTK+, and Motif 1.2 GUI.
'T' Include Toolbar. Currently only in Win32 and GTK+ GUI.
'r' Right-hand scrollbar is present when 'r' is included.
'l' Left-hand scrollbar is present when 'l' is included.
'b' Bottom (horizontal) scrollbar is present when 'b' is included.
And yes, you may even have scrollbars on the left AND the right if
you really want to :-). See |gui-scrollbars| for more information.
'v' Use a vertical button layout for dialogs. When not included,
a horizontal layout is preferred, but when it doesn't fit a
vertical layout is used anyway.
'p' Use Pointer callbacks for X11 GUI. This is required for some
window managers. If the cursor is not blinking or hollow at
the right moment, try adding this flag. This must be done
before starting the GUI. Set it in your gvimrc. Adding or
removing it after the GUI has started has no effect.
*'guipty'* *'noguipty'*
'guipty' boolean (default on)
global
{not in Vi}
{only available when compiled with GUI enabled}
Only in the GUI: If on, an attempt is made to open a pseudo-tty for
I/O to/from shell commands. See |gui-pty|.
*'helpfile'* *'hf'*
'helpfile' 'hf' string (default (MSDOS) "$VIMRUNTIME\doc\help.txt"
(others) "$VIMRUNTIME/doc/help.txt")
global
{not in Vi}
Name of the help file. All help files should be placed together in
one directory. Environment variables are expanded |:set_env|. For
example: "$VIMRUNTIME/doc/help.txt". If $VIMRUNTIME is not set, $VIM
is also tried. Also see |$VIMRUNTIME| and |option-backslash|
about including spaces and backslashes.
*'helpheight'* *'hh'*
'helpheight' 'hh' number (default 20)
global
{not in Vi}
Minimal initial height of the help window when it is opened with the
":help" command. The initial height of the help window is half of the
current window, or (when the 'ea' option is on) the same as other
windows. When the height is less than 'helpheight', the height is
set to 'helpheight'. Set to zero to disable.
*'hidden'* *'hid'* *'nohidden'* *'nohid'*
'hidden' 'hid' boolean (default off)
global
{not in Vi}
When off a buffer is unloaded when it is |abandon|ed. When on a
buffer becomes hidden when it is |abandon|ed. If the buffer is still
displayed in another window, it does not become hidden, of course.
The commands that move through the buffer list sometimes make a buffer
hidden although the 'hidden' option is off: When the buffer is
modified, 'autowrite' is off or writing is not possible, and the '!'
flag was used. See also |windows.txt|.
WARNING: It's easy to forget that you have changes in hidden buffers.
Think twice when using ":q!" or ":qa!".
*'highlight'* *'hl'*
'highlight' 'hl' string (default (as a single string):
"8:SpecialKey,@:NonText,d:Directory,
e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,
M:ModeMsg,n:LineNr,r:Question,
s:StatusLine,S:StatusLineNC,t:Title,
v:Visual,w:WarningMsg,W:WildMenu")
global
{not in Vi}
This option can be used to set highlighting mode for various
occasions. It is a comma separated list of character pairs. The
first character in a pair gives the occasion, the second the mode to
use for that occasion. The occasions are:
|hl-SpecialKey| 8 Meta and special keys listed with ":map"
|hl-NonText| @ '~' and '@' at the end of the window and
characters from 'showbreak'
|hl-Directory| d directories in CTRL-D listing and other special
things in listings
|hl-ErrorMsg| e error messages
h (obsolete, ignored)
|hl-IncSearch| i 'incsearch' highlighting
|hl-Search| l last search pattern highlighting (see 'hlsearch')
|hl-MoreMsg| m |more-prompt|
|hl-ModeMsg| M Mode (e.g., "-- INSERT --")
|hl-LineNr| n line number for ":number" and ":#" commands
|hl-Question| r |hit-return| prompt and yes/no questions
|hl-StatusLine| s status line of current window |status-line|
|hl-StatusLineNC| S status lines of not-current windows
|hl-Title| t Titles for output from ":set all", ":autocmd" etc.
|hl-Visual| v Visual mode
|hl-VisualNOS| V Visual mode when Vim does is "Not Owning the
Selection" Only X11 Gui's |gui-x11| and
|xterm-clipboard|.
|hl-WarningMsg| w warning messages
|hl-WildMenu| W wildcard matches displayed for 'wildmenu'
The display modes are:
r reverse (termcap entry "mr" and "me")
i italic (termcap entry "ZH" and "ZR")
b bold (termcap entry "md" and "me")
s standout (termcap entry "so" and "se")
u underline (termcap entry "us" and "ue")
n no highlighting
- no highlighting
: use a highlight group
The default is used for occasions that are not included.
If you want to change what the display modes do, see |dos-colors|
for an example.
When using the ':' display mode, this must be followed by the name of
a highlight group. A highlight group can be used to define any type
of highlighting, including using color. See |:highlight| on how to
define one. The default uses a different group for each occasion.
See |highlight-default| for the default highlight groups.
*'hlsearch'* *'hls'* *'nohlsearch'* *'nohls'*
'hlsearch' 'hls' boolean (default off)
global
{not in Vi}
{not available when compiled without the
|+extra_search| feature}
When there is a previous search pattern, highlight all its matches.
The type of highlighting used can be set with the 'l' occasion in the
'highlight' option. This uses the "Search" highlight group by
default. Note that only the matching text is highlighted, any offsets
are not applied.
See also: 'incsearch'.
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.
NOTE: This option is reset when 'compatible' is set.
*'history'* *'hi'*
'history' 'hi' number (Vim default: 20, Vi default: 0)
global
{not in Vi}
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|).
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'hkmap'* *'hk'* *'nohkmap'* *'nohk'*
'hkmap' 'hk' boolean (default off)
global
{not in Vi}
{only available when compiled with the |+rightleft|
feature}
When on, the keyboard is mapped for the Hebrew character set.
Normally you would set 'allowrevins' and use CTRL-_ in insert mode to
toggle this option. See |rightleft.txt|.
NOTE: This option is reset when 'compatible' is set.
*'hkmapp'* *'hkp'* *'nohkmapp'* *'nohkp'*
'hkmapp' 'hkp' boolean (default off)
global
{not in Vi}
{only available when compiled with the |+rightleft|
feature}
When on, phonetic keyboard mapping is used. 'hkmap' must also be on.
This is useful if you have a non-Hebrew keyboard.
See |rightleft.txt|.
NOTE: This option is reset when 'compatible' is set.
*'icon'* *'noicon'*
'icon' boolean (default off, on when title can be restored)
global
{not in Vi}
{not available when compiled without the |+title|
feature}
When on, the icon text of the window will be set to the value of
'iconstring' (if it is not empty), or to the name of the file
currently being edited. Only the last part of the name is used.
Overridden by the 'iconstring' option.
Only works if the terminal supports setting window icons (currently
only X11 GUI and terminals with a non-empty 't_IS' option - these are
Unix xterm and iris-ansi by default, where 't_IS' is taken from the
builtin termcap).
When Vim was compiled with HAVE_X11 defined, the original icon will be
restored if possible |X11|. See |X11-icon| for changing the icon on
X11.
*'iconstring'*
'iconstring' string (default "")
global
{not in Vi}
{not available when compiled without the |+title|
feature}
When this option is not empty, it will be used for the icon text of
the window. This happens only when the 'icon' option is on.
Only works if the terminal supports setting window icon text
(currently only X11 GUI and terminals with a non-empty 't_IS' option).
Does not work for MS Windows.
When Vim was compiled with HAVE_X11 defined, the original icon will be
restored if possible |X11|.
When this option contains printf-style '%' items, they will be
expanded according to the rules used for 'statusline'. See
'titlestring' for example settings.
{not available when compiled without the |+statusline| feature}
*'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'.
*'include'* *'inc'*
'include' 'inc' string (default "^#\s*include")
global
{not in Vi}
Pattern to be used to find an include command. It is a search
pattern, just like for the "/" command (See |pattern|). The default
value is for C programs. This option is used for the commands "[i",
"]I", "[d", etc.. The 'isfname' option is used to recognize the file
name that comes after the matched pattern. See |option-backslash|
about including spaces and backslashes.
*'incsearch'* *'is'* *'noincsearch'* *'nois'*
'incsearch' 'is' boolean (default off)
global
{not in Vi}
{not available when compiled without the
|+extra_search| feature}
While typing a search pattern, show immediately where the so far
typed pattern matches. The matched string is highlighted. If the
pattern is invalid or not found, nothing is shown. The screen will
be updated often, this is only useful on fast terminals. Note that
the match will be shown, but the cursor is not actually positioned
there. You still need to finish the search command with <CR> to move
the cursor. The highlighting can be set with the 'i' flag in
'highlight'. See also: 'hlsearch'.
NOTE: This option is reset when 'compatible' is set.
*'infercase'* *'inf'* *'noinfercase'* *'noinf'*
'infercase' 'inf' boolean (default off)
local to buffer
{not in Vi}
When doing keyword completion in insert mode |ins-completion|, and
'ignorecase' is also on, the case of the match is adjusted. If the
typed text contains a lowercase letter where the match has an upper
case letter, the completed part is made lower case. If the typed text
has no lower case letters and the match has a lower case letter where
the typed text has an upper case letter, and there is a letter before
it, the completed part is made uppercase.
*'insertmode'* *'im'* *'noinsertmode'* *'noim'*
'insertmode' 'im' boolean (default off)
global
{not in Vi}
Makes Vim work in a way that Insert mode is the default mode. Useful
if you want to use Vim as a modeless editor.
These Insert mode commands will be useful:
- Use the cursor keys to move around.
- Use CTRL-O to execute one Normal mode command |i_CTRL-O|). When
this is a mapping, it is executed as if 'insertmode' was off.
Normal mode remains active until the mapping is finished.
*i_CTRL-L*
- Use CTRL-L to execute a number of Normal mode commands, then use
<Esc> to get back to Insert mode.
These items change when 'insertmode' is set:
- when starting to edit of a file, Vim goes to Insert mode.
- <Esc> in Insert mode is a no-op and beeps.
- <Esc> in Normal mode makes Vim go to Insert mode.
- CTRL-L in Insert mode is a command, it is not inserted.
- CTRL-Z in Insert mode suspends Vim, see |CTRL-Z|. *i_CTRL-Z*
However, when <Esc> is used inside a mapping, it behaves like
'insertmode' was not set. This was done to be able to use the same
mappings with 'insertmode' set or not set.
NOTE: This option is reset when 'compatible' is set.
*'isfname'* *'isf'*
'isfname' 'isf' string (default for MS-DOS, Win32 and OS/2:
"@,48-57,/,.,-,_,+,,,$,:,!,\"
for AMIGA: "@,48-57,/,.,-,_,+,,,$,:"
otherwise: "@,48-57,/,.,-,_,+,,,$,~")
global
{not in Vi}
The characters given by this option are included in file names and
path names. Filenames are used for commands like "gf", "[i" and in
the tags file. It is also used for "\f" in a |pattern|.
Besides the characters in this option characters that are defined by
the C function isalpha() are also always included (this depends on the
character set and "locale").
Note that on systems using a backslash as path separator, Vim tries to
do its best to make it work as you would expect. That is a bit
tricky, since Vi originally used the backslash to escape special
characters. Vim on will not remove a backslash in front of a normal
file name character on these systems, but it will on Unix and alikes.
The format of this option is a list of parts, separated with commas.
Each part can be a single character number or a range. A range is two
character numbers with '-' in between. A character number can be a
decimal number between 0 and 255 or the ASCII character itself (does
not work for digits). Example:
"_,-,128-140,#-43" (include '_' and '-' and the range
128 to 140 and '#' to 43)
If a part starts with '^', the following character number or range
will be excluded from the option. The option is interpreted from left
to right. Put the excluded character after the range where it is
included. To include '^' itself use it as the last character of the
option or the end of a range. Example:
"^a-z,#,^" (exclude 'a' to 'z', include '#' and '^')
If the character is '@', all characters where isalpha() returns TRUE
are included. Normally these are the characters a to z and A to Z,
plus accented characters. To include '@' itself use "@-@". Examples:
"@,^a-z" All alphabetic characters, excluding lower
case letters.
"a-z,A-Z,@-@" All letters plus the '@' character.
A comma can be included by using it where a character number is
expected. Example:
"48-57,,,_" Digits, command and underscore.
A comma can be excluded by prepending a '^'. Example:
" -~,^,,9" All characters from space to '~', excluding
comma, plus <Tab>.
See |option-backslash| about including spaces and backslashes.
*'isident'* *'isi'*
'isident' 'isi' string (default for MS-DOS, Win32 and OS/2:
"@,48-57,_,128-167,224-235"
otherwise: "@,48-57,_,192-255")
global
{not in Vi}
The characters given by this option are included in identifiers.
Identifiers are used in recognizing environment variables and after a
match of the 'define' option. It is also used for "\i" in a
|pattern|. See 'isfname' for a description of the format of this
option.
Careful: If you change this option, it might break expanding
environment variables. E.g., when '/' is included and Vim tries to
expand "$HOME/.viminfo". Maybe you should change 'iskeyword' instead.
*'iskeyword'* *'isk'*
'iskeyword' 'isk' string (Vim default for MS-DOS and Win32:
"@,48-57,_,128-167,224-235"
otherwise: "@,48-57,_,192-255"
Vi default: "@,48-57,_")
local to buffer
{not in Vi}
Keywords are used in searching and recognizing with many commands:
"w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See
'isfname' for a description of the format of this option. For C
programs you could use "a-z,A-Z,48-57,_,.,-,>".
For a help file it is set to all non-blank printable characters except
'*', '"'' and '|' (so that CTRL-] on a command finds the help for that
command).
When the 'lisp' option is on the '-' character is always included.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'isprint'* *'isp'*
'isprint' 'isp' string (default for MS-DOS, Win32, OS/2 and Macintosh:
"@,~-255"; otherwise: "@,161-255")
global
{not in Vi}
The characters given by this option are displayed directly on the
screen. It is also used for "\p" in a |pattern|. The characters from
space (ascii 32) to '~' (ascii 126) are always displayed directly,
even when they are not included in 'isprint' or excluded. See
'isfname' for a description of the format of this option.
Non-printable characters are displayed with two characters:
0 - 31 "^@" - "^_"
32 - 126 always single characters
127 "^?"
128 - 159 "~@" - "~_"
160 - 254 "| " - "|~"
255 "~?"
*'joinspaces'* *'js'* *'nojoinspaces'* *'nojs'*
'joinspaces' 'js' boolean (default on)
global
{not in Vi}
Insert two spaces after a '.', '?' and '!' with a join command.
When 'cpoptions' includes the 'j' flag, only do this after a '.'.
Otherwise only one space is inserted.
NOTE: This option is set when 'compatible' is set.
*'key'*
'key' string (default "")
local to buffer
{not in Vi}
The key that is used for encrypting and decrypting the current buffer.
See |encryption|.
Careful: Do not set the key value by hand, someone might see the typed
key. Use the |:X| command. But you can make 'key' empty:
set key=
It is not possible to get the value of this option with ":set key" or
"echo &key". This is to avoid showing it to someone who shouldn't
know. It also means you cannot see it yourself once you have set it,
be careful not to make a typing error!
*'keymodel'* *'km'*
'keymodel' 'km' string (default "")
global
{not in Vi}
List of comma separated words, which enable special things that keys
can do. These values can be used:
startsel Using a shifted special key starts selection (either
Select mode or Visual mode, depending on "key" being
present in 'selectmode').
stopsel Using a not-shifted special key stops selection.
Special keys in this context are the cursor keys, <End>, <Home>,
<PageUp> and <PageDown>.
The 'keymodel' option is set by the |:behave| command.
*'keywordprg'* *'kp'*
'keywordprg' 'kp' string (default "man" or "man -s", DOS: "",
OS/2: "view /", VMS: "help")
global
{not in Vi}
Program to use for the |K| command. Environment variables are
expanded |:set_env|. When empty ":help" is used.
When "man" is used, Vim will automatically translate a count for the
"K" command to a section number. Also for "man -s", in which case the
"-s" is removed when there is no count.
See |option-backslash| about including spaces and backslashes.
Example:
:set keywordprg=man\ -s
When this option is set from a |modeline|, while the 'secure' option
is set, you will get a warning message.
*'langmap'* *'lmap'*
'langmap' 'lmap' string (default "")
global
{not in Vi}
{only available when compiled with the |+langmap|
feature}
This option allows support for keyboards that have a mode for a
special language. The idea is that when you are typing text in Insert
mode your keyboard is switched in the special language mode, you get
different key codes for the special characters. When in command mode
the 'langmap' option takes care of translating these special
characters to the original meaning of the key. This means you don't
have to change the keyboard mode to be able to execute normal mode
commands.
Example (for greek): *greek*
:set langmap=ÁA,ÂB,ØC,ÄD,ÅE,ÖF,ÃG,ÇH,ÉI,ÎJ,ÊK,ËL,ÌM,ÍN,ÏO,ÐP,QQ,ÑR,ÓS,ÔT,ÈU,ÙV,WW,×X,ÕY,ÆZ,áa,âb,øc,äd,åe,öf,ãg,çh,éi,îj,êk,ël,ìm,ín,ïo,ðp,qq,ñr,ós,ôt,èu,ùv,òw,÷x,õy,æz
Example (exchanges meaning of z and y for commands):
:set langmap=zy,yz,ZY,YZ
The 'langmap' option is a list of parts, separated with commas. Each
part can be in one of two forms:
1. A list of pairs. Each pair is a "from" character immediately
followed by the "to" character. Examples: "aA", "aAbBcC".
2. A list of "from" characters, a semi-colon and a list of "to"
characters. Example: "abc;ABC"
Example: "aA,fgh;FGH,cCdDeE"
Special characters need to be preceded with a backslash. These are
";", ',' and backslash itself.
This will allow you to activate vim actions without having to switch
back and forth between the languages. Your language characters will
be understood as normal vim English characters (according to the
langmap mappings) in the following cases:
o Normal/Visual mode (commands, buffer/register names, user mappings)
o Insert/Replace Mode: Register names after CTRL-R
o Insert/Replace Mode: Mappings
Characters entered in Command-line mode will NOT be affected by
this option. Note that this option can be changed at any time
allowing to switch between mappings for different languages/encodings.
Use a mapping to avoid having to type it each time!
*'laststatus'* *'ls'*
'laststatus' 'ls' number (default 1)
global
{not in Vi}
The value of this option influences when the last window will have a
status line:
0: never
1: only if there are at least two windows
2: always
The screen looks nicer with a status line if you have several
windows, but it takes another screen line. |status-line|
*'lazyredraw'* *'lz'* *'nolazyredraw'* *'nolz'*
'lazyredraw' 'lz' boolean (default off)
global
{not in Vi}
When this option is set, the screen will not be redrawn while
executing macros, registers and other commands that have not been
typed.
*'linebreak'* *'lbr'* *'nolinebreak'* *'nolbr'*
'linebreak' 'lbr' boolean (default off)
local to window
{not in Vi}
{not available when compiled without the |+linebreak|
feature}
If on Vim will wrap long lines at a character in 'breakat' rather
than at the last character that fits on the screen. Unlike
'wrapmargin' and 'textwidth', this does not insert <EOL>s in the file,
it only affects the way the file is displayed, not its contents. The
value of 'showbreak' is used to put in front of wrapped lines. This
option is not used when the 'wrap' option is off. Note that <Tab>
characters after an <EOL> are mostly not displayed correctly.
*'lines'*
'lines' number (default 24 or terminal height)
global
Number of lines in the display. Normally you don't need to set this.
That is done automatically by the terminal initialization code.
When Vim is running in the GUI or in a resizable window, setting this
option may cause the window size to be changed.
When you set this option and Vim is unable to change the physical
number of lines of the display, the display may be messed up.
*'lisp'* *'nolisp'*
'lisp' boolean (default off)
local to buffer
{not available when compiled without the |+lispindent|
feature}
Lisp mode: When a return is typed in insert mode set the indent for
the next line to Lisp standards (well, sort of). Also happens with
"cc" or "S". 'autoindent' must also be on for this to work. The 'p'
flag in 'cpoptions' changes the method of indenting: Vi compatible or
better.
The '-' character is included in keyword characters. Redefines the
"=" operator to use this same indentation algorithm rather than
calling an external program if 'equalprg' is empty. This option is
reset when 'paste' is set. {Vi: Does it a little bit differently}
*'list'* *'nolist'*
'list' boolean (default off)
local to window
List mode: Show tabs as CTRL-I, show end of line with $. Useful to
see the difference between tabs and spaces and for trailing blanks.
Note that this will also affect formatting (set with 'textwidth' or
'wrapmargin') when 'cpoptions' includes 'L'. See 'listchars' for
changing the way tabs are displayed.
*'listchars'* *'lcs'*
'listchars' 'lcs' string (default "eol:$")
global
{not in Vi}
Strings to use in 'list' mode. It is a comma separated list of string
settings.
eol:c Character to show at the end of each line. When
omitted, there is no extra character at the end of the
line.
tab:xy Two characters to be used to show a Tab. The first
char is used once. The second char is repeated to
fill the space that the Tab normally occupies.
"tab:>-" will show a Tab that takes four spaces as
">---". When omitted, a Tab is show as ^I.
trail:c Character to show for trailing spaces. When omitted,
trailing spaces are blank.
extends:c Character to show in the last column, when 'wrap' is
off and the line continues beyond the right of the
screen.
The characters ':' and ',' cannot be used.
Examples:
:set lcs=tab:>-,trail:-
:set lcs=tab:>-,eol:<
The "NonText" highlighting will be used for these characters.
*'magic'* *'nomagic'*
'magic' boolean (default on)
global
Changes the special characters that can be used in search patterns.
See |pattern|. NOTE: To avoid portability problems with using
patterns, always keep this option at the default "on".
*'makeef'* *'mef'*
'makeef' 'mef' string (Amiga default: "t:vim##.Err",
Unix: "/tmp/vim##.err",
others: "vim##.err")
global
{not in Vi}
{not available when compiled without the |+quickfix|
feature}
Name of the errorfile for the |:make| command (see |:make_makeprg|)
and the |:grep| command.
When "##" is included, it is replaced by a number to make the name
unique. This makes sure that the ":make" command doesn't overwrite an
existing file.
NOT used for the ":cf" command. See 'errorfile' for that.
Environment variables are expanded |:set_env|.
See |option-backslash| about including spaces and backslashes.
*'makeprg'* *'mp'*
'makeprg' 'mp' string (default "make")
global
{not in Vi}
Program to use for the ":make" command. See |:make_makeprg|. This
option may contain '%' and '#' characters, which are expanded like
when used in a command-line. Environment variables are expanded
|:set_env|. See |option-backslash| about including spaces and
backslashes. Note that a '|' must be escaped twice: once for ":set"
and once for the interpretation of a command. When you use a filter
called "myfilter" do it like this:
:set makeprg=gmake\ \\\|\ myfilter
The placeholder "$*" can be given (even multiple times) to specify
where the arguments will be included, for example:
:set makeprg=latex\ \\\\nonstopmode\ \\\\input\\{$*}
When this option is set from a |modeline|, while the 'secure' option
is set, you will get a warning message.
*'matchpairs'* *'mps'*
'matchpairs' 'mps' string (default "(:),{:},[:]")
local to buffer
{not in Vi}
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+=<:>
A more exotic example, to jump between the '=' and ';' in an
assignment, useful for languages like C and Java:
au FileType c,cpp,java set mps+==:;
*'matchtime'* *'mat'*
'matchtime' 'mat' number (default 5)
global
{not in Vi}{in Nvi}
Tenths of a second to show the matching paren, when 'showmatch' is
set. Note that this is not in milliseconds, like other options that
set a time. This is to be compatible with Nvi.
*'maxfuncdepth'* *'mfd'*
'maxfuncdepth' 'mfd' number (default 100)
global
{not in Vi}
Maximum depth of function calls for user functions. This normally
catches endless recursion. When using a recursive function with
more depth, set 'maxfuncdepth' to a bigger number. But this will use
more memory, there is the danger of failing when memory is exhausted.
See also |:function|.
*'maxmapdepth'* *'mmd'*
'maxmapdepth' 'mmd' number (default 1000)
global
{not in Vi}
Maximum number of times a mapping is done without resulting in a
character to be used. This normally catches endless mappings, like
":map x y" with ":map y x". It still does not catch ":map g wg",
because the 'w' is used before the next mapping is done. See also
|key-mapping|.
*'maxmem'* *'mm'*
'maxmem' 'mm' number (default 512)
global
{not in Vi}
Maximum amount of memory (in Kbyte) to use for one buffer. When this
limit is reached allocating extra memory for a buffer will cause
other memory to be freed. Maximum value 2000000. Use this to work
without a limit. Also see 'maxmemtot'.
*'maxmemtot'* *'mmt'*
'maxmemtot' 'mmt' number (default 2048, or half the amount of memory
available)
global
{not in Vi}
Maximum amount of memory (in Kbyte) to use for all buffers together.
Maximum value 2000000. Use this to work without a limit. Also see
'maxmem'.
*'modeline'* *'ml'* *'nomodeline'* *'noml'*
'modeline' 'ml' boolean (Vim default: on, Vi default: off)
local to buffer
*'modelines'* *'mls'*
'modelines' 'mls' number (default 5)
global
{not in Vi}
If 'modeline' is on 'modelines' gives the number of lines that is
checked for set commands. If 'modeline' is off or 'modelines' is zero
no lines are checked. See |modeline|.
NOTE: 'modeline' is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'modified'* *'mod'* *'nomodified'* *'nomod'*
'modified' 'mod' boolean (default off)
local to buffer
{not in Vi}
When on the buffer is considered to be modified. This option is set
by every command that makes a change to the buffer. Only the undo
command may reset it, when all changes have been undone.
*'more'* *'nomore'*
'more' boolean (Vim default: on, Vi default: off)
global
{not in Vi}
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.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'mouse'*
'mouse' string (default "", "a" for GUI, MS-DOS and Win32)
global
{not in Vi}
Enable the use of the mouse. Only works for certain terminals
(xterm, MS-DOS, Win32 |win32-mouse| and Linux console with gpm). For
using the mouse in the GUI, see |gui-mouse|.
The mouse can be enabled for different modes:
n Normal mode
v Visual mode
i Insert mode
c Command-line mode
h all previous modes when editing a help file
a all previous modes
r for |hit-return| and |more-prompt| prompt
Normally you would enable the mouse in all four modes with:
:set mouse=a
When the mouse is not enabled, the GUI will still use the mouse for
modeless selection. This doesn't move the text cursor.
See |mouse-using|. Also see |'clipboard'|.
Note: When enabling the mouse in an xterm, GUI copy/paste will be used
if there is access to an X-server. The xterm copy/paste can still be
used by keeping the shift key pressed. The GUI copy/paste only works
in Normal, Visual and Insert mode. This setting is suggested to allow
normal xterm selection in Command-line mode:
:set mouse=nvi
Also see the 'clipboard' option.
*'mousefocus'* *'mousef'* *'nomousefocus'* *'nomousef'*
'mousefocus' 'mousef' boolean (default off)
global
{not in Vi}
{only works in the GUI}
The window that the mouse pointer is on is automatically activated.
When changing the window layout or window focus in another way, the
mouse pointer is moved to the window with keyboard focus. Off is the
default because it makes using the pull down menus a little goofy, as
a pointer transit may activate a window unintentionally.
*'mousehide'* *'mh'* *'nomousehide'* *'nomh'*
'mousehide' 'mh' boolean (default off)
global
{not in Vi}
{only works in the GUI}
When on, the mouse pointer is hidden when characters are typed.
The mouse pointer is restored when the mouse is moved.
*'mousemodel'* *'mousem'*
'mousemodel' 'mousem' string (default "extend", "popup" for MS-DOS and Win32)
global
{not in Vi}
Sets the model to use for the mouse. The name mostly specifies what
the right mouse button is used for:
extend Right mouse button extends a selection. This works
like in an xterm.
popup Right mouse button pops up a menu. The shifted left
mouse button extends a selection. This works like
with Microsoft Windows
popup_setpos Like "popup", but the cursor will be moved to the
position where the mouse was clicked, and thus the
selected operation will act upon the clicked object.
If clicking inside a selection, that selection will
be acted upon, ie. no cursor move. This implies of
course, that right clicking outside a selection will
end Visual mode.
Overview of what button does what for each model:
mouse extend popup(_setpos)
left click place cursor place cursor
left drag start selection start selection
shift-left search word extend selection
right click extend selection popup menu (place cursor)
right drag extend selection -
middle click paste paste
In the "popup" model the right mouse button produces a pop-up menu.
You need to define this first, see |popup-menu|.
Note that you can further refine the meaning of buttons with mappings.
See |gui-mouse-mapping|. But mappings are NOT used for modeless
selection (because that's handled in the GUI code directly).
The 'mousemodel' option is set by the |:behave| command.
*'mousetime'* *'mouset'*
'mousetime' 'mouset' number (default 500)
global
{not in Vi}
Only for GUI, MS-DOS, Win32 and Unix with xterm. Defines the maximum
time in msec between two mouse clicks for the second click to be
recognized as a multi click.
*'nrformats'* *'nf'*
'nrformats' 'nf' string (default "octal,hex")
local to buffer
{not in Vi}
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.
If "octal" is included, numbers that start with a zero will be
considered to be octal. Example: Using CTRL-A on "007" results in
"010".
If "hex" is 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.
*'number'* *'nu'* *'nonumber'* *'nonu'*
'number' 'nu' boolean (default off)
local to window
Print the line number in front of each line. Tip: If you don't like
wrapping lines to mix with the line numbers, set the 'showbreak'
option to eight spaces:
:set showbreak=\ \ \ \ \ \ \ \
See |hl-LineNr| for the highlighting used for the number.
*'osfiletype'* *'oft'*
'osfiletype' 'oft' string (RISC OS default: "Text",
others default: "")
local to buffer
{not in Vi}
{only available when compiled with the |+osfiletype|
feature}
Some operating systems store extra information about files besides
name, datastamp and permissions. This option contains the extra
information, the nature of which will vary between systems.
The value of this option is usually set when the file is loaded, and
use to set the file type when file is written.
It can affect the pattern matching of the automatic commands.
|autocmd-osfiletypes|
*'paragraphs'* *'para'*
'paragraphs' 'para' string (default "IPLPPPQPP LIpplpipbp")
global
Specifies the nroff macros that separate paragraphs. These are pairs
of two letters (see |object-motions|).
*'paste'* *'nopaste'*
'paste' boolean (default off)
global
{not in Vi}
Put Vim in Paste mode. This is useful if you want to cut or copy
some text from one window and paste it in Vim. This will avoid
unexpected effects.
Setting this option is useful when using Vim in a terminal, where Vim
cannot distinguish between typed text and pasted text. In the GUI, Vim
knows about pasting and will mostly do the right thing without 'paste'
being set. Also in a terminal where Vim handles the mouse clicks
itself.
When the 'paste' option is switched on (also when it was already on):
- mapping in Insert mode and Command-line mode is disabled
- abbreviations are disabled
- 'textwidth' is set to 0
- 'wrapmargin' is set to 0
- 'autoindent' is reset
- 'smartindent' is reset
- 'cindent' is reset
- 'softtabstop' is set to 0
- 'lisp' is reset
- 'revins' is reset
- 'ruler' is reset
- 'showmatch' is reset
- 'formatoptions' is used like it is empty
NOTE: When you start editing another file while the 'paste' option is
on, settings from the modelines or autocommands may change the
settings again, causing trouble when pasting text. You might want to
set the 'paste' option again.
When the 'paste' option is reset the mentioned options are restored to
the value before the moment 'paste' was switched from off to on.
Resetting 'paste' before ever setting it does not have any effect.
Since mapping doesn't work while 'paste' is active, you need to use
the 'pastetoggle' option to toggle the 'paste' option with some key.
*'pastetoggle'* *'pt'*
'pastetoggle' 'pt' string (default "")
global
{not in Vi}
When non-empty, specifies the key sequence that toggles the 'paste'
option. This is like specifying a mapping:
map {keys} :set invpaste<CR>
Where {keys} is the value of 'pastetoggle'.
The difference is that it will work even when 'paste' is set.
'pastetoggle' works in Insert mode and Normal mode, but not in
Command-line mode.
Mappings are checked first, thus overrule 'pastetoggle'. However,
when 'paste' is on mappings are ignored in Insert mode, thus you can do
this:
map <F10> :set paste<CR>
map <F11> :set nopaste<CR>
imap <F10> <C-O>:set paste<CR>
imap <F11> <nop>
set pastetoggle=<F11>
This will make <F10> start paste mode and <F11> stop paste mode.
Note that typing <F10> in paste mode inserts "<F10>", since in paste
mode everything is inserted literally, except the 'pasttoggle' key
sequence.
*'patchmode'* *'pm'*
'patchmode' 'pm' string (default "")
global
{not in Vi}
When non-empty the oldest version of a file is kept. This can be used
to keep the original version of a file if you are changing files in a
source distribution. Only the first time that a file is edited a copy
of the original file will be kept. The name of the copy is the name
of the original file with the string in the 'patchmode' option
appended. This option should start with a dot. Use a string like
".org". 'backupdir' must not be empty for this to work (Detail: The
backup file is renamed to the patchmode file after the new file has
been successfully written, that's why it must be possible to write a
backup file). If there was no file to be backed up, an empty file is
created.
*'path'* *'pa'*
'path' 'pa' string (default on Unix: ".,/usr/include,,"
on OS/2: ".,/emx/include,,"
other systems: ".,,")
global
{not in Vi}
This is a list of directories which will be searched when using the
|gf|, [f, ]f, ^Wf, |:find| and other commands, provided that the file
being searched for has a relative path (not starting with '/'). The
directories in the 'path' option may be relative or absolute.
- Use commas to separate directory names:
:set path=.,/usr/local/include,/usr/include
- Spaces can also be used to separate directory names (for backwards
compatibility with version 3.0). To have a space in a directory
name, precede it with an extra backslash, and escape the space:
:set path=.,/dir/with\\\ space
- To include a comma in a directory name precede it with an extra
backslash:
:set path=.,/dir/with\\,comma
- To search relative to the directory of the current file, use:
:set path=.
- To search in the current directory use an empty string between two
commas:
:set path=,,
- A directory name may end in a ':' or '/'.
- Environment variables are expanded |:set_env|.
- Use wildcards to specify directories more freely, e.g.,
:set path=/usr/include/*
means all subdirectories in /usr/include (but not /usr/include
itself).
- Use '**' if you want the whole subtree to be searched:
:set path=/home/user_x/src/**
means search in the whole subtree under "/home/usr_x/src". (to avoid
endless recursion, the depth is restricted to 100 levels)
- Give wildcards and recursions in any order:
:set path=/**/include/**
specifies a path with at least one directory /include/ in it.
- The set of allowed wildcards and the possible usage depend on the
operating system, but /etc/*/etc and /etc/**/etc work on any
system. |:_%<|
- Careful with '\' characters, type two to get one in the option:
:set path=.,c:\\include
Or just use '/' instead:
:set path=.,c:/include
Don't forget "." or files won't even be found in the same directory as
the file!
The maximum length is limited. How much depends on the system, mostly
it is something like 256 or 1024 characters.
You can check if all the include files are found, using the value of
'path', see |:checkpath|.
The use of |:set+=| and |:set-=| is preferred when adding or removing
directories from the list. This avoids problems when a future version
uses another default. To remove the current directory use:
:set path-=
To add the current directory use:
:set path+=
To use an environment variable, you probably need to replace the
separator. Here is an example to append $INCL, in which directory
names are separated with a semi-colon:
let &path = &path . "," . substitute($INCL, ';', ',', 'g')
Replace the ';' with a ':' or whatever separator is used. Note that
this doesn't work when $INCL contains a comma or white space.
*'previewheight'* *'pvh'*
'previewheight' 'pvh' number (default 12)
global
{not in Vi}
Default height for a preview window. Used for |:ptag| and associated
commands. Used for |CTRL-W_}| when no count is given.
*'readonly'* *'ro'* *'noreadonly'* *'noro'*
'readonly' 'ro' boolean (default off)
local to buffer
{not in Vi}
If on, writes fail unless you use a '!'. Protects you from
accidentally overwriting a file. Default on when Vim is started
in read-only mode ("vim -R") or when the executable is called "view".
{not in Vi:} When using the ":view" command the 'readonly' option is
set for the newly edited buffer. When using ":w!" the 'readonly'
option is reset for the current buffer.
*'remap'* *'noremap'*
'remap' boolean (default on)
global
Allows for mappings to work recursively. If you do not want this for
a single entry, use the :noremap[!] command.
*'report'*
'report' number (default 2)
global
Threshold for reporting number of lines changed. When the number of
changed lines is more than 'report' a message will be given for most
":" commands. For the ":substitute" command the number of
substitutions is used instead of the number of lines.
*'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
'restorescreen' 'rs' boolean (default on)
global
{not in Vi} {Windows 95/NT version only}
When set, the screen contents is restored when exiting Vim. This also
happens when executing external commands.
For non-Windows Vim: You can set or reset the 't_ti' and 't_te'
options in your .vimrc. To disable restoring:
set t_ti= t_te=
To enable restoring (for an xterm):
set t_ti=^[7^[[r^[[?47h t_te=^[[?47l^[8
(Where ^[ is an <Esc>, type CTRL-V <Esc> to insert it)
*'revins'* *'ri'* *'norevins'* *'nori'*
'revins' 'ri' boolean (default off)
global
{not in Vi}
{only available when compiled with the |+rightleft|
feature}
Inserting characters in Insert mode will work backwards. See "typing
backwards" |ins-reverse|. This option can be toggled with the CTRL-_
command in Insert mode, when 'allowrevins' is set.
NOTE: This option is reset when 'compatible' or 'paste' is set.
*'rightleft'* *'rl'* *'norightleft'* *'norl'*
'rightleft' 'rl' boolean (default off)
local to window
{not in Vi}
{only available when compiled with the |+rightleft|
feature}
When on, display orientation becomes right-to-left, i.e., character
that are stored in the file appear from the right to the left. Using
this option, it is possible to edit files for languages that are
written from the right to the left such as Hebrew and Arabic. This
option is per window, so it is possible to edit mixed files
simultaneously, or to view the same file in both ways (this is
sometimes useful when editing Hebrew TeX--XeT files). See
|rightleft.txt|.
*'ruler'* *'ru'* *'noruler'* *'noru'*
'ruler' 'ru' boolean (default off)
global
{not in Vi}
{not available when compiled without the
|+cmdline_info| feature}
Show the line and column number of the cursor position, separated by a
comma. When there is room, the relative position of the displayed
text in the file is shown on the far right:
Top first line is visible
Bot last line is visible
All first and last line are visible
45% relative position in the file
If 'rulerformat' is set, it will determine the contents of the ruler.
Each window has its own ruler. If a window has a status line, the
ruler is shown there. Otherwise it is shown in the last line of the
screen. If the statusline is given by 'statusline' (ie. not empty),
this option takes precedence over 'ruler' and 'rulerformat'
If there are characters in the line that take two positions on the
screen, both the "real" column and the screen column are shown,
separated with a dash.
For an empty line "0-1" is shown.
For an empty buffer the line number will also be zero: "0,0-1".
This option is reset when the 'paste' option is set.
If you don't want to see the ruler all the time but want to know where
you are, use "g CTRL-G" |g_CTRL-G|.
NOTE: This option is reset when 'compatible' is set.
*'rulerformat'* *'ruf'*
'rulerformat' 'ruf' string (default empty)
global
{not in Vi}
{not available when compiled without the |+statusline|
feature}
The format of this option, is like that of 'statusline'. When it is
not empty it determines the content of the ruler string. If the
option has a leading "%{wid}(", then {wid} determines the width of the
ruler. The default ruler width is 17 characters.
*'scroll'* *'scr'*
'scroll' 'scr' number (default 'lines' / 2)
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 'lines' / 2 with
":set scroll=0". {Vi is a bit different: 'scroll' gives the number
of screen lines instead of file lines, makes a difference when lines
wrap}
*'scrollbind'* *'scb'* *'noscrollbind'* *'noscb'*
'scrollbind' 'scb' boolean (default off)
local to window
{not in Vi}
{not available when compiled without the |+scrollbind|
feature}
See also |scroll-binding|. When this option is set, the current
window scrolls as other scrollbind windows (windows that also have
this option set) scroll. This option is useful for viewing the
differences between two versions of a file. See |'scrollopt'| for
options that determine how this option should be interpreted.
*'scrolljump'* *'sj'*
'scrolljump' 'sj' number (default 1)
global
{not in Vi}
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.
NOTE: This option is set to 1 when 'compatible' is set.
*'scrolloff'* *'so'*
'scrolloff' 'so' number (default 0)
global
{not in Vi}
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).
NOTE: This option is set to 0 when 'compatible' is set.
*'scrollopt'* *'sbo'*
'scrollopt' 'sbo' string (default "ver,jump")
global
{not available when compiled without the |+scrollbind|
feature}
{not in Vi}
This is a comma-separated list of words that specifies how
'scrollbind' windows should behave.
The following words are available:
ver Bind vertical scrolling for 'scrollbind' windows
hor Bind horizontal scrolling for 'scrollbind' windows
jump Applies to the offset between two windows for vertical
scrolling. This offset is the difference in the first
displayed line of the bound windows. When moving
around in a window, another 'scrollbind' window may
reach a position before the start or after the end of
the buffer. The offset is not changed though, when
moving back the 'scrollbind' window will try to scroll
to the desired position when possible.
When now making that window the current one, two
things can be done with the relative offset:
1. When "jump" is not included, the relative offset is
adjusted for the scroll position in the new current
window. When going back to the other window, the
the new relative offset will be used.
2. When "jump" is included, the other windows are
scrolled to keep the same relative offset. When
going back to the other window, it still uses the
same relative offset.
Also see |scroll-binding|.
*'sections'* *'sect'*
'sections' 'sect' string (default "SHNHH HUnhsh")
global
Specifies the nroff macros that separate sections. These are pairs of
two letters (See |object-motions|). The default makes a section start
at the nroff macros ".SH", ".NH", ".H", ".HU", ".nh" and ".sh".
*'secure'* *'nosecure'*
'secure' boolean (default off)
global
{not in Vi}
When on, ":autocmd", shell and write commands are not allowed in
".vimrc" and ".exrc" in the current directory and map commands are
displayed. Switch it off only if you know that you will not run into
problems, or when the 'exrc' option is off. On Unix this option is
only used if the ".vimrc" or ".exrc" is not owned by you. This can be
dangerous if the systems allows users to do a "chown". You better set
'secure' at the end of your ~/.vimrc then.
This option cannot be set from a |modeline|.
*'selection'* *'sel'*
'selection' 'sel' string (default "inclusive")
global
{not in Vi}
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.
The 'selection' option is set by the |:behave| command.
*'selectmode'* *'slm'*
'selectmode' 'slm' string (default "")
global
{not in Vi}
This is a comma separated list of words, which specifies when to start
Select mode instead of Visual mode, when a selection is started.
Possible values:
mouse when using the mouse
key when using shifted special keys
cmd when using "v", "V" or CTRL-V
See |Select-mode|.
The 'selectmode' option is set by the |:behave| command.
*'sessionoptions'* *'ssop'*
'sessionoptions' 'ssop' string (default "buffers,winsize,options,help,blank")
global
{not in Vi}
Changes the effect of the |:mksession| command. It is a comma
separated list of words. Each word enables saving and restoring
something:
word save and restore
buffers hidden and unloaded buffers, not just those in windows
globals global variables that start with an uppercase letter
and contain at least one lowercase letter.
help the help window
blank empty windows
options options and mappings
winpos position of the GUI vim window
resize size of the screen: 'lines' and 'columns'
winsize window sizes (where possible)
slash backslashes in file names replaced with forward
slashes
unix with Unix end-of-line format (single <NL>), even when
on Windows or DOS
"slash" and "unix" are useful on Windows when sharing session files
with Unix. The Unix version of Vim cannot source dos format scripts,
but the Windows version of Vim can source unix format scripts.
*'shell'* *'sh'*
'shell' 'sh' string (default $SHELL or "sh",
MS-DOS and Win32: "command",
OS/2: "cmd")
global
Name of the shell to use for ! and :! commands. When changing the
value also check the 'shelltype', 'shellpipe', 'shellslash' and
'shellredir' options.
It is allowed to give an argument to the command, e.g. "csh -f".
See |option-backslash| about including spaces and backslashes.
Environment variables are expanded |:set_env|.
For Dos 32 bits (DJGPP), you can set the $DJSYSFLAGS environment
variable to change the way external commands are executed. See the
libc.inf file of DJGPP.
If the name of the shell contains a space, you might need to enclose
it in quotes. Example:
:set shell=\"c:\program\ files\unix\sh.exe\"\ -f
Note the backslash before each quote (to avoid starting a comment) and
each space (to avoid ending the option value). Also note that the
"-f" is not inside the quotes, because it is not part of the command
name. And Vim automagically recognizes the backslashes that are path
separators.
Under MS-Windows, when the executable ends in ".com" it must be
included. Thus setting the shell to "command.com" or "4dos.com"
works, but "command" and "4dos" do not work for all commands (e.g.,
filtering).
For unknown reasons, when using "4dos.com" the current directory is
changed to "C:\". To avoid this set 'shell' like this:
:set shell=command.com\ /c\ 4dos
The 'shell' option cannot be set from a |modeline|.
*'shellcmdflag'* *'shcf'*
'shellcmdflag' 'shcf' string (default: "-c", MS-DOS and Win32, when 'shell'
does not contain "sh" somewhere: "/c")
global
{not in Vi}
Flag passed to the shell to execute "!" and ":!" commands; e.g.,
"bash.exe -c ls" or "command.com /c dir". For the MS-DOS-like
systems, the default is set according to the value of 'shell', to
reduce the need to set this option by the user. It's not used for
OS/2 (EMX figures this out itself). See |option-backslash| about
including spaces and backslashes. See |dos-shell|.
This option cannot be set from a |modeline|.
*'shellpipe'* *'sp'*
'shellpipe' 'sp' string (default ">", "| tee", "|& tee" or "2>&1| tee")|||
global
{not in Vi}
{not available when compiled without the |+quickfix|
feature}
String to be used to put the output of the ":make" command in the
error file. See also |:make_makeprg|. See |option-backslash| about
including spaces and backslashes.
For the Amiga and MS-DOS the default is ">". The output is directly
saved in a file and not echoed to the screen.
For Unix the default it "| tee". The stdout of the compiler is saved
in a file and echoed to the screen. If the 'shell' option is "csh" or
"tcsh" after initializations, the default becomes "|& tee". If the
'shell' option is "sh", "ksh", "zsh" or "bash" the default becomes
"2>&1| tee". This means that stderr is also included.
The initialization of this option is done after reading the ".vimrc"
and the other initializations, so that when the 'shell' option is set
there, the 'shellpipe' option changes automatically, unless it was
explicitly set before.
When 'shellpipe' is set to an empty string, no redirection of the
":make" output will be done. This is useful if you use a 'makeprg'
that writes to 'makeef' by itself. If you want no piping, but do
want to include the 'makeef', set 'shellpipe' to a single space.
Don't forget to precede the space with a backslash: ":set sp=\ ".
In the future pipes may be used for filtering and this option will
become obsolete (at least for Unix).
This option cannot be set from a |modeline|.
*'shellquote'* *'shq'*
'shellquote' 'shq' string (default: ""; MS-DOS and Win32, when 'shell'
contains "sh" somewhere: "\"")
global
{not in Vi}
Quoting character(s), put around the command passed to the shell, for
the "!" and ":!" commands. The redirection is kept outside of the
quoting. See 'shellxquote' to include the redirection. It's
probably not useful to set both options.
This is an empty string by default. Only known to be useful for
third-party shells on MS-DOS-like systems, such as the MKS Korn Shell
or bash, where it should be "\"". The default is adjusted according
the value of 'shell', to reduce the need to set this option by the
user. See |dos-shell|.
This option cannot be set from a |modeline|.
*'shellredir'* *'srr'*
'shellredir' 'srr' string (default ">", ">&" or ">%s 2>&1")
global
{not in Vi}
String to be used to put the output of a filter command in a temporary
file. See also |:!|. See |option-backslash| about including spaces
and backslashes.
The name of the temporary file can be represented by "%s" if necessary
(the file name is appended automatically if no %s appears in the value
of this option).
The default is ">". For Unix, if the 'shell' option is "csh", "tcsh"
or "zsh" during initializations, the default becomes ">&". If the
'shell' option is "sh", "ksh" or "bash" the default becomes
">%s 2>&1". This means that stderr is also included.
The initialization of this option is done after reading the ".vimrc"
and the other initializations, so that when the 'shell' option is set
there, the 'shellredir' option changes automatically unless it was
explicitly set before.
In the future pipes may be used for filtering and this option will
become obsolete (at least for Unix).
This option cannot be set from a |modeline|.
*'shellslash'* *'ssl'* *'noshellslash'* *'nossl'*
'shellslash' 'ssl' boolean (default off)
global
{not in Vi} {only for MSDOS, MS-Windows and OS/2}
When set, a forward slash is used when expanding file names. This is
useful when a Unix-like shell is used instead of command.com or
cmd.exe. Backward slashes can still be typed, but they are changed to
forward slashes by Vim.
Note that setting or resetting this option has no effect for existing
file names, thus this option needs to be set before opening any file
for best results. This might change in the future.
*'shelltype'* *'st'*
'shelltype' 'st' number (default 0)
global
{not in Vi} {only for the Amiga}
On the Amiga this option influences the way how the commands work
which use a shell.
0 and 1: always use the shell
2 and 3: use the shell only to filter lines
4 and 5: use shell only for ':sh' command
When not using the shell, the command is executed directly.
0 and 2: use "shell 'shellcmdflag' cmd" to start external commands
1 and 3: use "shell cmd" to start external commands
*'shellxquote'* *'sxq'*
'shellxquote' 'sxq' string (default: "";
for Win32, when 'shell' contains "sh"
somewhere: "\""
for Unix, when using system(): "\"")
global
{not in Vi}
Quoting character(s), put around the command passed to the shell, for
the "!" and ":!" commands. Includes the redirection. See
'shellquote' to exclude the redirection. It's probably not useful
to set both options.
This is an empty string by default. Known to be useful for
third-party shells when using the Win32 version, such as the MKS Korn
Shell or bash, where it should be "\"". The default is adjusted
according the value of 'shell', to reduce the need to set this option
by the user. See |dos-shell|.
This option cannot be set from a |modeline|.
*'shiftround'* *'sr'* *'noshiftround'* *'nosr'*
'shiftround' 'sr' boolean (default off)
global
{not in Vi}
Round indent to multiple of 'shiftwidth'. Applies to > and <
commands. CTRL-T and CTRL-D in Insert mode always round the indent to
a multiple of 'shiftwidth' (this is Vi compatible).
NOTE: This option is reset when 'compatible' is set.
*'shiftwidth'* *'sw'*
'shiftwidth' 'sw' number (default 8)
local to buffer
Number of spaces to use for each step of (auto)indent. Used for
|'cindent'|, |>>|, |<<|, etc.
*'shortmess'* *'shm'*
'shortmess' 'shm' string (Vim default "filnxtToO", Vi default: "")
global
{not in Vi}
This option helps to avoid all the |hit-return| prompts caused by file
messages, for example with CTRL-G, and to avoid some other messages.
It is a list of flags:
flag meaning when present
f use "(3 of 5)" instead of "(file 3 of 5)"
i use "[noeol]" instead of "[Incomplete last line]"
l use "999L, 888C" instead of "999 lines, 888 characters"
m use "[+]" instead of "[Modified]"
n use "[New]" instead of "[New File]"
r use "[RO]" instead of "[readonly]"
w use "[w]" instead of "written" for file write message.
x use "[dos]" instead of "[dos format]", "[unix]" instead of
"[unix format]" and "[mac]" instead of "[mac format]".
a all of the above abbreviations
o overwrite message for writing a file with subsequent message
for reading a file (useful for ":wn" or when 'autowrite' on)
O message for reading a file overwrites any previous message.
Also for quickfix message (e.g., ":cn").
s don't give "search hit BOTTOM, continuing at TOP" or "search
hit TOP, continuing at BOTTOM" messages
t truncate file message at the start if it is too long to fit
on the command-line, "<" will appear in the left most column.
Ignored in Ex mode.
T truncate other messages in the middle if they are too long to
fit on the command line. "..." will appear in the middle.
Ignored in Ex mode.
W don't give "written" or "[w]" when writing a file
A don't give the "ATTENTION" message when an existing swap file
is found.
I don't give the intro message when starting Vim |:intro|.
This gives you the opportunity to avoid that a change between buffers
requires you to hit return, but still gives as useful a message as
possible for the space available. To get the whole message that you
would have got with 'shm' empty, use ":file!"
Useful values:
shm= No abbreviation of message.
shm=a Abbreviation, but no loss of information.
shm=at Abbreviation, and truncate message when necessary.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'shortname'* *'sn'* *'noshortname'* *'nosn'*
'shortname' 'sn' boolean (default off)
local to buffer
{not in Vi, not in MS-DOS versions}
Filenames are assumed to be 8 characters plus one extension of 3
characters. Multiple dots in file names are not allowed. When this
option is on, dots in file names are replaced with underscores when
adding an extension (".~" or ".swp"). This option is not available
for MS-DOS, because then it would always be on. This option is useful
when editing files on an MS-DOS compatible filesystem, e.g., messydos
or crossdos. When running the Win32 GUI version under Win32s, this
option is always on by default.
*'showbreak'* *'sbr'*
'showbreak' 'sbr' string (default "")
global
{not in Vi}
{not available when compiled without the |+linebreak|
feature}
String to put at the start of lines that have been wrapped. Useful
values are "> " or "+++ ". Only printable characters are allowed,
excluding <Tab> and comma (in a future version the comma might be used
to separate the part that is shown at the end and at the start of a
line). The characters are highlighted according to the '@' flag in
'highlight'.
*'showcmd'* *'sc'* *'noshowcmd'* *'nosc'*
'showcmd' 'sc' boolean (Vim default: on, off for Unix, Vi default:
off)
global
{not in Vi}
{not available when compiled without the
|+cmdline_info| feature}
Show (partial) command in status line. Set this option off if your
terminal is slow.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'showfulltag'* *'sft'* *'noshowfulltag'* *'nosft'*
'showfulltag' 'sft' boolean (default off)
global
{not in Vi}
When completing a word in insert mode (see |ins-completion|) from the
tags file, show both the tag name and a tidied-up form of the search
pattern (if there is one) as possible matches. Thus, if you have
matched a C function, you can see a template for what arguments are
required (coding style permitting).
*'showmatch'* *'sm'* *'noshowmatch'* *'nosm'*
'showmatch' 'sm' boolean (default off)
global
When a bracket is inserted, briefly jump to the matching one. The
jump is only done if the match can be seen on the screen. The time to
show the match can be set with 'matchtime'.
A Beep is given if there is no match (no matter if the match can be
seen or not). This option is reset when the 'paste' option is set.
When the 'm' flag is not included in 'cpoptions', typing a character
will immediately move the cursor back to where it belongs.
See the "sm" field in 'guicursor' for setting the cursor shape and
blinking when showing the match.
Note: For the use of the short form parental guidance is advised.
*'showmode'* *'smd'* *'noshowmode'* *'nosmd'*
'showmode' 'smd' boolean (Vim default: on, Vi default: off)
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.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'sidescroll'* *'ss'*
'sidescroll' 'ss' number (default 0)
global
{not in Vi}
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.
When using a slow terminal set it to a large number or 0. When using
a fast terminal use a small number or 1. Not used for "zh" and "zl"
commands.
*'smartcase'* *'scs'* *'nosmartcase'* *'noscs'*
'smartcase' 'scs' boolean (default off)
global
{not in Vi}
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 return.
NOTE: This option is reset when 'compatible' is set.
*'smartindent'* *'si'* *'nosmartindent'* *'nosi'*
'smartindent' 'si' boolean (default off)
local to buffer
{not in Vi}
{not available when compiled without the
|+smartindent| feature}
Do smart autoindenting when starting a new line. Works for C-like
programs, but can also be used for other languages. 'cindent' does
something like this, works better in most cases, but is more strict,
see |C-indenting|. When 'cindent' is on, setting 'si' has no effect.
Normally 'autoindent' should also be on when using 'smartindent'.
An indent is automatically inserted:
- After a line ending in '{'.
- After a line starting with a keyword from 'cinwords'.
- Before a line starting with '}' (only with the "O" command).
When typing '}' as the first character in a new line, that line is
given the same indent as the matching '{'.
When typing '#' as the first character in a new line, the indent for
that line is removed, the '#' is put in the first column. The indent
is restored for the next line. If you don't want this, use this
mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H.
When using the ">>" command, lines starting with '#' are not shifted
right.
NOTE: 'smartindent' is reset when 'compatible' or 'paste' is set.
*'smarttab'* *'sta'* *'nosmarttab'* *'nosta'*
'smarttab' 'sta' boolean (default off)
global
{not in Vi}
When on, a <Tab> in front of a line inserts blanks according to
'shiftwidth'. 'tabstop' is used in other places.
When off a <Tab> always inserts blanks according to 'tabstop'.
'shiftwidth' is only used for shifting text left or right
|shift-left-right|.
What gets inserted (a Tab or spaces) depends on the 'expandtab'
option. Also see |ins-expandtab|. When 'expandtab' is not set, the
number of spaces minimized by using <Tab>s.
NOTE: This option is reset when 'compatible' is set.
*'softtabstop'* *'sts'*
'softtabstop' 'sts' number (default 0)
local to buffer
{not in Vi}
Number of spaces that a <Tab> counts for while performing editing
operations, like inserting a <Tab> or using <BS>. It "feels" like
<Tab>s are being inserted, while in fact a mix of spaces and <Tab>s is
used. This is useful to keep the 'ts' setting at its standard value
of 8, while being able to edit like it is set to 'sts'. However,
commands like "x" still work on the actual characters.
When 'sts' is zero, this feature is off.
'softtabstop' is set to 0 when the 'paste' option is set.
See also |ins-expandtab|. When 'expandtab' is not set, the number of
spaces minimized by using <Tab>s.
NOTE: This option is set to 0 when 'compatible' is set.
*'splitbelow'* *'sb'* *'nosplitbelow'* *'nosb'*
'splitbelow' 'sb' boolean (default off)
global
{not in Vi}
When on, splitting a window will put the new window below the current
one.
*'startofline'* *'sol'* *'nostartofline'* *'nosol'*
'startofline' 'sol' boolean (default on)
global
{not in Vi}
When on the commands listed below move the cursor to the first
blank of the line. When off the cursor is kept in the same column
(if possible). This applies to the commands: CTRL-D, CTRL-U, CTRL-B,
CTRL-F, "G", "H", "M", "L", , and to the commands "d", "<<" and ">>"
with a linewise operator, with "%" with a count and to buffer changing
commands (CTRL-^, :bnext, :bNext, etc.). Also for an Ex command that
only has a line number, e.g., ":25" or ":+".
In case of buffer changing commands the cursor is placed at the column
where it was the last time the buffer was edited.
NOTE: This option is set when 'compatible' is set.
*'statusline'* *'stl'*
'statusline' 'stl' string (default empty)
global
{not in Vi}
{not available when compiled without the |+statusline|
feature}
When nonempty, this option determines the content of the status line.
Also see |status-line|.
The option consists of printf style '%' items interspersed with
normal text. Each status line item is of the form:
%-0{minwid}.{maxwid}{item}
All fields except the {item} is optional. A single percent sign can
be given as "%%".
Note that the only effect of 'ruler' when this option is set (and
'laststatus' is 2) is controlling the output of |CTRL-G|.
field meaning
- Left justify the item. The default is right justified
when minwid is larger than the length of the item.
0 Leading zeroes in numeric items. Overridden by '-'.
minwid Minimum width of the item, padding as set by '-' & '0'.
maxwid Maximum width of the item. Truncation occurs with a '<'
on the left for text items. Numeric items will be
shifted down to maxwid-2 digits followed by '>'number
where number is the amount of missing digits, much like
an exponential notation.
item A one letter code as described below.
Following is a description of the possible statusline items. The
second character in "item" is the type: N for number, S for string
and F for flags as described below. A - is used if not applicable.
item meaning
f S Path to the file in the buffer, relative to current directory.
F S Full path to the file in the buffer.
t S File name (tail) of file in the buffer.
m F Modified flag, text is " [+].
M F Modified flag, text is ",+".
r F Readonly flag, text is " [RO]".
R F Readonly flag, text is ",RO".
h F Help buffer flag, text is " [help]".
H F Help buffer flag, text is ",HLP".
w F Preview window flag, text is " [Preview]".
W F Preview window flag, text is ",PRV".
y F Type of file in the buffer, e.g., " [vim]". See 'filetype'.
Y F Type of file in the buffer, e.g., ",VIM". See 'filetype'.
{not available when compiled without |+autocmd| feature}
n N Buffer number.
b N Value of byte under cursor.
B N As above, in hexadecimal.
o N Byte number in file of byte under cursor, first byte is 1.
Mnemonic: Offset from start of file (with one added)
{not available when compiled without |+byte_offset| feature}
O N As above, in hexadecimal.
l N Line number.
L N Number of lines in buffer.
c N Column number.
v N Virtual column number.
V N Virtual column number as -{num}. Not displayed if equal to 'c'.
p N Percentage through file in lines as in |CTRL-G|.
P S Percentage through file of displayed window. This is like the
percentage described for 'ruler'. Always 3 in length.
a S Argument list status as in default title. ({current} of {max})
Empty if the argument file count is zero or one.
{ NF Evaluate expression between '{' and '}' and substitute result.
( - Start of item group. Can be used for setting the width and
alignment of a section. Must be followed by %) somewhere.
) - End of item group. No width fields allowed.
< - Where to truncate line if too long. Default is at the start.
No width fields allowed.
= - Separation point between left and right aligned items.
No width fields allowed.
* - Set highlight group to User{N}, where {N} is taken from the
minwid field. eg. %1*. Restore normal highlight with %* or %0*.
The difference between User{N} and StatusLine will be applied
to StatusLineNC for the statusline of non-current windows.
The number N must be between 1 and 9. See |hl-User1..9|
Display of flags are controlled by the following heuristic:
If a flag text starts with comma it is assumed that it wants to
separate itself from anything but preceding plaintext. If it starts
with a space it is assumed that it wants to separate itself from
anything but other flags. That is: A leading comma is removed if the
preceding character stems from plaintext. A leading space is removed
if the preceding character stems from another active flag. This will
make a nice display when flags are used like in the examples below.
When all items in a group becomes an empty string (ie. flags that are
not set) and a minwid is not set for the group, the whole group will
become empty. This will make a group like the following disappear
completely from the statusline when none of the flags are set.
set statusline=...%(\ [%M%R%H]%)...
Beware that an expression is evaluated each and every time the status
line is displayed. The current buffer and current window will be set
temporarily to that of the window (and buffer) whose statusline is
currently being drawn. The expression will evaluate in this context.
The variable "actual_curbuf" is set to the 'bufnr()' number of the
real current buffer.
A result of all digits is regarded a number for display purposes.
Otherwise the result is taken as flag text and applied to the rules
described above.
Watch out for errors in expressions. They may render Vim unusable !
If you are stuck, hold down ':' or 'Q' to get a prompt, then quit and
edit your .vimrc or whatever with "vim -u NONE" to get it right.
Examples:
Display byte count and byte value, modified flag in red.
set statusline=%<%f%=\ [%1*%M%*%n%R%H]\ %-19(%3l,%02c%03V%)%O'%02b'
hi User1 term=inverse,bold cterm=inverse,bold ctermfg=red
Emulate standard status line with 'ruler' set
set statusline=%<%f%h%m%r%=%l,%c%V\ %P
Idem, but add ascii value of char under the cursor (like "ga")
set statusline=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P
Display a ,GZ flag if a compressed file is loaded
set statusline=...%r%{VarExists('b:gzflag','\ [GZ]')}%h...
In the |:autocmd|'s: |let b:gzflag = 1 And: |unlet b:gzflag|||
function VarExists(var, val)
if exists(a:var) | return a:val | else | return '' | endif
endfunction
*'suffixes'* *'su'*
'suffixes' 'su' string (default ".bak,~,.o,.h,.info,.swp,.obj")
global
{not in Vi}
Files with these suffixes get a lower priority when multiple files
match a wildcard. See |suffixes|. Commas can be used to separate the
suffixes. Spaces after the comma are ignored. A dot is also seen as
the start of a suffix. To avoid a dot or comma being recognized as a
separator, precede it with a backslash (see |option-backslash| about
including spaces and backslashes).
See 'wildignore' for completely ignoring files.
The use of |:set+=| and |:set-=| is preferred when adding or removing
suffixes from the list. This avoids problems when a future version
uses another default.
*'swapfile'* *'swf'* *'noswapfile'* *'noswf'*
'swapfile' 'swf' boolean (default on)
local to buffer
{not in Vi}
Use a swapfile for the buffer. This option can be reset when a
swapfile is not wanted for a specific buffer. For example, with
confidential information that even root must not be able to access.
Careful: All text will be in memory. Don't use this for big files.
Recovery will be impossible!
A swapfile will only be present when |'updatecount'| is non-zero and
'swapfile' is set.
When 'swapfile' is reset, the swap file for the current buffer is
immediately deleted. When 'swapfile' is set, and 'updatecount' is
non-zero, a swap file is immediately created.
Also see |swap-file| and |'swapsync'|.
*'swapsync'* *'sws'*
'swapsync' 'sws' string (default "fsync")
global
{not in Vi}
When this option is not empty a swap file is synced to disk after
writing to it. This takes some time, especially on busy unix systems.
When this option is empty parts of the swap file may be in memory and
not written to disk. When the system crashes you may lose more work.
On Unix the system does a sync now and then without Vim asking for it,
so the disadvantage of setting this option off is small. On some
systems the swap file will not be written at all. For a unix system
setting it to "sync" will use the sync() call instead of the default
fsync(), which may work better on some systems.
*'switchbuf'* *'swb'*
'switchbuf' 'swb' string (default "")
global
{not in Vi}
This option controls the behavior when switching between buffers.
Possible values (comma separated list):
useopen If included, jump to the first open window that
contains the specified buffer (if there is one).
Otherwise: Do not examine other windows.
This setting is checked in |quickfix| mode when
jumping to errors (":cc", ":cn", "cp", etc.). It
is also used in all buffer related split commands,
for example ":sbuffer", ":sbnext", or ":sbrewind".
split If included, split the current window before loading
a buffer. Otherwise: do not split, use current window.
Supported in |quickfix| commands that display errors.
*'syntax'* *'syn'*
'syntax' 'syn' string (default emtpy)
local to buffer
{not in Vi}
{not available when compiled without the |+syntax|
feature}
When this option is set, the syntax with this name is loaded, unless
syntax highlighting has been switched off with ":syntax off".
Otherwise this option does not always reflect the current syntax (the
b:current_syntax variable does).
This option is most useful in a modeline, for a file which syntax is
not automatically recognized. Example, for in an IDL file:
/* vim: set syntax=idl : */
To switch off syntax highlighting for the current file, use:
:set syntax=OFF
To switch syntax highlighting on according to the current value of the
'filetype' option:
:set syntax=ON
What actually happens when setting the 'syntax' option is that the
Syntax autocommand event is triggered with the value as argument.
This option is not copied to another buffer, independent of the 's' or
'S' flag in 'cpoptions'.
*'tabstop'* *'ts'*
'tabstop' 'ts' number (default 8)
local to buffer
Number of spaces that a <Tab> in the file counts for. Also see
|:retab| command, and 'softtabstop' option.
Note: Setting 'tabstop' to any other value than 8 can make your file
appear wrong in many places (e.g., when printing it).
There are four main ways to use tabs in Vim:
1. Always keep 'tabstop' at 8, set 'softtabstop' and 'shiftwidth' to 4
(or 3 or whatever you prefer) and use 'noexpandtab'. Then Vim
will use a mix of tabs and spaces, but typing Tab and BS will
behave like a tab appears every 4 (or 3) characters.
2. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use
'expandtab'. This way you will always insert spaces. The
formatting will never be messed up when 'tabstop' is changed.
3. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use a
|modeline| to set these values when editing the file again. Only
works when using Vim to edit the file.
4. Always set 'tabstop' and 'shiftwidth' to the same value, and
'noexpandtab'. This should then work (for initial indents only)
for any tabstop setting that people use. It might be nice to have
tabs after the first non-blank inserted as spaces if you do this
though. Otherwise aligned comments will be wrong when 'tabstop' is
changed.
*'tagbsearch'* *'tbs'* *'notagbsearch'* *'notbs'*
'tagbsearch' 'tbs' boolean (default on)
global
{not in Vi}
When searching for a tag (e.g., for the |:ta| command), Vim can either
use a binary search or a linear search in a tags file. Binary
searching makes searching for a tag a LOT faster, but a linear search
will find more tags if the tags file wasn't properly sorted.
Vim normally assumes that your tags files are sorted, or indicate that
they are not sorted. Only when this is not the case does the
'tagbsearch' option need to be switched off.
When 'tagbsearch' is on, binary searching is first used in the tags
files. In certain situations, Vim will do a linear search instead for
certain files, or retry all files with a linear search. When
'tagbsearch' is off, only a linear search is done.
Linear searching is done anyway, for one file, when Vim finds a line
at the start of the file indicating that it's not sorted:
!_TAG_FILE_SORTED 0 /some command/
[The whitespace before and after the '0' must be a single <Tab>]
When a binary search was done and no match was found in any of the
files listed in 'tags', and 'ignorecase' is set or a pattern is used
instead of a normal tag name, a retry is done with a linear search.
Tags in unsorted tags files, and matches with different case will only
be found in the retry.
When 'tagbsearch' is off, tags searching is slower when a full match
exists, but faster when no full match exists. Tags in unsorted tags
files may only be found with 'tagbsearch' off.
When the tags file is not sorted, or sorted in a wrong way (not on
ASCII byte value), 'tagbsearch' should be off, or the line given above
must be included in the tags file.
This option doesn't affect commands that find all matching tags (e.g.,
command-line completion and ":help").
{Vi: always uses binary search in some versions}
*'taglength'* *'tl'*
'taglength' 'tl' number (default 0)
global
If non-zero, tags are significant up to this number of characters.
*'tagrelative'* *'tr'* *'notagrelative'* *'notr'*
'tagrelative' 'tr' boolean (Vim default: on, Vi default: off)
global
{not in Vi}
If on and using a tag file in another directory, file names in that
tag file are relative to the directory where the tag file is.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'tags'* *'tag'*
'tags' 'tag' string (default "./tags,tags", when compiled with
|+emacs_tags|: "./tags,./TAGS,tags,TAGS")
global
Filenames for the tag command, separated by spaces or commas. To
include a space or comma in a file name, precede it with a backslash
(see |option-backslash| about including spaces and backslashes).
When a file name starts with "./", the '.' is replaced with the path
of the current file. But only when the 'd' flag is not included in
'cpoptions'. Environment variables are expanded |:set_env|. Also see
|tags-option|.
If Vim was compiled with the |+emacs_tags| feature, Emacs-style tag
files are also supported. They are automatically recognized. The
default value becomes "./tags,./TAGS,tags,TAGS". |emacs-tags|
The use of |:set+=| and |:set-=| is preferred when adding or removing
file names from the list. This avoids problems when a future version
uses another default.
{Vi: default is "tags /usr/lib/tags"}
*'tagstack'* *'tgst'* *'notagstack'* *'notgst'*
'tagstack' 'tgst' boolean (default on)
global
{not in all versions of Vi}
When on, the |tagstack| is used normally. When off, a ":tag" or
":tselect" command with an argument will not push the tag onto the
tagstack. A following ":tag" without an argument, a ":pop" command or
any other command that uses the tagstack will use the unmodified
tagstack, but does change the pointer to the active entry.
Resetting this option is useful when using a ":tag" command in a
mapping which should not change the tagstack.
*'term'*
'term' string (default is $TERM, if that fails:
in the GUI: "builtin_gui"
on Amiga: "amiga"
on BeOS: "beos-ansi"
on Mac: "mac-ansi"
on MiNT: "vt52"
on MS-DOS: "pcterm"
on OS/2: "os2ansi"
on Unix: "ansi"
on VMS: "ansi"
on Win 32: "win32")
global
Name of the terminal. Used for choosing the terminal control
characters. Environment variables are expanded |:set_env|.
For example:
:set term=$TERM
See |termcap|.
*'terse'* *'noterse'*
'terse' boolean (default off)
global
When set: Add 's' flag to 'shortmess' option (this makes the message
for a search that hits the start or end of the file not being
displayed). When reset: Remove 's' flag from 'shortmess' option. {Vi
shortens a lot of messages}
*'textauto'* *'ta'* *'notextauto'* *'nota'*
'textauto' 'ta' boolean (Vim default: on, Vi default: off)
global
{not in Vi}
This option is obsolete. Use 'fileformats'.
For backwards compatibility, when 'textauto' is set, 'fileformats' is
set to the default value for the current system. When 'textauto' is
reset, 'fileformats' is made empty.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'textmode'* *'tx'* *'notextmode'* *'notx'*
'textmode' 'tx' boolean (MS-DOS, Win32 and OS/2: default on,
others: default off)
local to buffer
{not in Vi}
This option is obsolete. Use 'fileformat'.
For backwards compatibility, when 'textmode' is set, 'fileformat' is
set to "dos". When 'textmode' is reset, 'fileformat' is set to
"unix".
*'textwidth'* *'tw'*
'textwidth' 'tw' number (default 0)
local to buffer
{not in Vi}
Maximum width of text that is being inserted. A longer line will be
broken after white space to get this width. A zero value disables
this. 'textwidth' is set to 0 when the 'paste' option is set. When
'textwidth' is zero, 'wrapmargin' may be used. See also
'formatoptions' and |ins-textwidth|.
NOTE: This option is set to 0 when 'compatible' is set.
*'tildeop'* *'top'* *'notildeop'* *'notop'*
'tildeop' 'top' boolean (default off)
global
{not in Vi}
When on: The tilde command "~" behaves like an operator.
NOTE: This option is reset when 'compatible' is set.
*'timeout'* *'to'* *'notimeout'* *'noto'*
'timeout' 'to' boolean (default on)
global
*'ttimeout'* *'nottimeout'*
'ttimeout' boolean (default off)
global
{not in Vi}
These two options together determine the behavior when part of a
mapped key sequence or keyboard code has been received:
timeout ttimeout action
off off no time out
on on or off time out on :mappings and key codes
off on time out on key codes
If there is no time out, Vim will wait until either the complete
mapping or key sequence has been received, or it is clear that there
is no mapping or key sequence for the received characters. For
example: if you have mapped "vl" and Vim has received 'v', the next
character is needed to see if the 'v' is followed by an 'l'. With a
time out Vim will wait for about 1 second for the next character to
arrive. After that the already received characters are interpreted
as single characters. The waiting time can be changed with the
'timeoutlen' option.
On slow terminals or very busy systems time out may cause
malfunctioning cursor keys. If both options are off, Vim waits
forever after an entered <Esc> if there are key codes that start
with <Esc>. You will have to type <Esc> twice. If you do not have
problems with key codes, but would like to have :mapped key
sequences not time out in 1 second, set the ttimeout option and
reset the timeout option.
NOTE: 'ttimeout' is reset when 'compatible' is set.
*'timeoutlen'* *'tm'*
'timeoutlen' 'tm' number (default 1000)
global
{not in all versions of Vi}
*'ttimeoutlen'* *'ttm'*
'ttimeoutlen' 'ttm' number (default -1)
global
{not in Vi}
The time in milliseconds that is waited for a key code or mapped key
sequence to complete. Normally only 'timeoutlen' is used and
'ttimeoutlen' is -1. When a different timeout value for key codes is
desired set 'ttimeoutlen' to a non-negative number.
ttimeoutlen mapping delay key code delay
< 0 'timeoutlen' 'timeoutlen'
>= 0 'timeoutlen' 'ttimeoutlen'
The timeout only happens when the 'timeout' and 'ttimeout' options
tell so. A useful setting would be
:set timeout timeoutlen=3000 ttimeoutlen=100
(time out on mapping after three seconds, time out on key codes after
a tenth of a second).
*'title'* *'notitle'*
'title' boolean (default off, on when title can be restored)
global
{not in Vi}
{not available when compiled without the |+title|
feature}
When on, the title of the window will be set to the value of
'titlestring' (if it is not empty), or to "VIM - filename", where
filename is the name of the file currently being edited. Only works
if the terminal supports setting window titles
(currently Amiga console, Win32 console, all GUI versions and
terminals with a non- empty 't_ts' option - these are Unix xterm and
iris-ansi by default, where 't_ts' is taken from the builtin termcap).
*X11*
When Vim was compiled with HAVE_X11 defined, the original title will
be restored if possible. The output of ":version" will include "+X11"
when HAVE_X11 was defined, otherwise it will be "-X11". This also
works for the icon name |'icon'|.
If the title cannot be restored, it is set to the value of 'titleold'.
You might want to restore the title outside of Vim then.
When using an xterm from a remote machine you can use this command:
rsh machine_name xterm -display $DISPLAY &
then the WINDOWID environment variable should be inherited and the
title of the window should change back to what it should be after
exiting Vim.
*'titlelen'*
'titlelen' number (default 85)
global
{not in Vi}
{not available when compiled without the |+title|
feature}
Gives the percentage of 'columns' to use for the length of the window
title. When the title is longer, only the end of the path name is
shown. A '<' character before the path name is used to indicate this.
Using a percentage makes this adapt to the width of the window. But
it won't work perfectly, because the actual number of characters
available also depends on the font used and other things in the title
bar. When 'titlelen' is zero the full path is used. Otherwise,
values from 1 to 30000 percent can be used.
'titlelen' is also used for the 'titlestring' option.
*'titleold'*
'titleold' string (default "Thanks for flying Vim")
global
{not in Vi}
{only available when compiled with the |+title|
feature}
This option will be used for the window title when exiting Vim if the
original title cannot be restored. Only happens if 'title' is on or
'titlestring' is not empty.
*'titlestring'*
'titlestring' string (default "")
global
{not in Vi}
{not available when compiled without the |+title|
feature}
When this option is not empty, it will be used for the title of the
window. This happens only when the 'title' option is on.
Only works if the terminal supports setting window titles (currently
Amiga console, Win32 console, all GUI versions and terminals with a
non-empty 't_ts' option).
When Vim was compiled with HAVE_X11 defined, the original title will
be restored if possible |X11|.
When this option contains printf-style '%' items, they will be
expanded according to the rules used for 'statusline'.
Example:
auto BufEnter * let &titlestring = hostname() . "/" . expand("%:p")
set title titlestring=%<%F%=%l/%L-%P titlelen=70
The value of 'titlelen' is used to align items in the middle or right
of the available space.
Some people prefer to have the file name first:
set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:.:h\")})%)%(\ %a%)
Note the use of "%{ }" and an expression to get the path of the file,
without the file name. The "%( %)" constructs are used to add a
separating space only when needed.
NOTE: Use of special characters in 'titlestring' may cause the display
to be garbled (e.g., when it contains a CR or NL character).
{not available when compiled without the |+statusline| feature}
*'toolbar'* *'tb'*
'toolbar' 'tb' string (default "icons,tooltips")
global
{only for YXXY+GUI_GTK|}
The contents of this option controls various toolbar settings. The
possible values are:
icons Toolbar buttons are shown with icons.
text Toolbar buttons shown with text.
tooltips Tooltips are active for toolbar buttons.
Tooltips refer to the popup help text which appears after the mouse
cursor is placed over a toolbar button for a brief moment.
If you want the toolbar to be shown with icons as well as text, do the
following:
:set tb=icons,text
If none of the strings specified in 'toolbar' are valid of if
'toolbar' is empty, this option is ignored. If you want to disable
the toolbar, you need to set the 'guioptions' option. For example:
:set guioptions-=T
Also see |gui-toolbar|.
*'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'*
'ttybuiltin' 'tbi' boolean (default on)
global
{not in Vi}
When on, the builtin termcaps are searched before the external ones.
When off the builtin termcaps are searched after the external ones.
When this option is changed, you should set the 'term' option next for
the change to take effect, for example:
:set notbi term=$TERM
See also |termcap|.
Rationale: The default for this option is "on", because the builtin
termcap entries are generally better (many systems contain faulty
xterm entries...).
*'ttyfast'* *'tf'* *'nottyfast'* *'notf'*
'ttyfast' 'tf' boolean (default off, on when 'term' is xterm, hpterm,
sun-cmd, screen, rxvt, dtterm or
iris-ansi; also on when running Vim in
a DOS console)
global
{not in Vi}
Indicates a fast terminal connection. More characters will be sent to
the screen for redrawing, instead of using insert/delete line
commands. Improves smoothness of redrawing when there are multiple
windows and the terminal does not support a scrolling region.
Also enables the extra writing of characters at the end of each screen
line for lines that wrap. This helps when using copy/paste with the
mouse in an xterm and other terminals.
*'ttymouse'* *'ttym'*
'ttymouse' 'ttym' string (default depends on 'term')
global
{not in Vi}
{only in Unix, and not in the GUI}
Name of the terminal type for which mouse codes are to be recognized.
Currently these three strings are valid:
*xterm-mouse*
xterm xterm-like mouse handling. The mouse generates
"<Esc>[Mscr", where "scr" is three bytes:
"s" = button state
"c" = column plus 33
"r" = row plus 33
xterm2 Works like "xterm", but with the xterm reporting the
mouse position while the mouse is dragged. This works
much faster and more precise. Your xterm must at
least at patchlevel 88 / XFree 3.3.3 for this to
work. Determine your version with "xterm -version".
*netterm-mouse*
netterm NetTerm mouse handling. The mouse generates
"<Esc>}r,c<CR>", where "r,c" are two decimal numbers
for the row and column.
*dec-mouse*
dec DEC terminal mouse handling. The mouse generates a
rather complex sequence, starting with "<Esc>[".
The mouse handling must be enabled at compile time |+mouse_xterm|
|+mouse_dec| |+mouse_netterm|.
Only "xterm"(2) is really recognized. NetTerm mouse codes are always
recognized, if enabled at compile time. DEC terminal mouse codes
are recognized if enabled at compile time, and 'ttymouse' is not
"xterm".
This option is automatically set to "xterm", when the 'term' option is
set to a name that starts with "xterm", and 'ttymouse' is not "xterm"
or "xterm2" already. The main use of this option is to set it to
"xterm", when the terminal name doesn't start with "xterm", but it can
handle xterm mouse codes.
The "xterm2" value will be set if the xterm version is reported to be
95 of higher. This only works if the t_RV is set to the escape
sequence to request the xterm version number. Otherwise "xterm2" must
be set explicitly.
*'ttyscroll'* *'tsl'*
'ttyscroll' 'tsl' number (default 999)
global
Maximum number of lines to scroll the screen. If there are more lines
to scroll the window is redrawn. For terminals where scrolling is
very slow and redrawing is not slow this can be set to a small number,
e.g., 3, to speed up displaying.
*'ttytype'* *'tty'*
'ttytype' 'tty' string (default from $TERM)
global
Alias for 'term', see above.
*'undolevels'* *'ul'*
'undolevels' 'ul' number (default 100, 1000 for Unix, VMS,
Win32 and OS/2)
global
{not in Vi}
Maximum number of changes that can be undone. Since undo information
is kept in memory, higher numbers will cause more 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
But you can also get Vi compatibility by including the 'u' flag in
'cpoptions', and still be able to use CTRL-R to repeat undo.
Set to a negative number for no undo at all:
set ul=-1
This helps when you run out of memory for a single change.
Also see |undo-two-ways|.
*'updatecount'* *'uc'*
'updatecount' 'uc' number (default: 200)
global
{not in Vi}
After typing this many characters the swap file will be written to
disk. When zero, no swap file will be created at all (see chapter on
recovery |crash-recovery|). 'updatecount' is set to zero by starting
Vim with the "-n" option, see |startup|. When editing in readonly
mode this option will be initialized to 10000.
The swapfile can be disabled per buffer with |'swapfile'|.
When 'updatecount' is set from non-zero to zero, swap files are
created for all buffers that have 'swapfile' set. When 'updatecount'
is set to zero, existing swap files are not deleted.
Also see |'swapsync'|.
*'updatetime'* *'ut'*
'updatetime' 'ut' number (default 4000)
global
{not in Vi}
If this many milliseconds nothing is typed the swap file will be
written to disk (see |crash-recovery|). Also used for the
|CursorHold| autocommand event.
*'verbose'* *'vbs'*
'verbose' 'vbs' number (default 0)
global
{not in Vi}
When bigger than zero, Vim will give messages about what it is doing.
Currently, these messages are given:
>= 1 When a file is ":source"'ed.
>= 1 When the viminfo file is read or written.
>= 8 Files for which a group of autocommands is executed.
>= 9 Every executed autocommand.
>=15 Every executed function line.
This option can also be set with the "-V" argument. See |-V|.
*'viminfo'* *'vi'*
'viminfo' 'vi' string (default "")
global
{not in Vi}
{not available when compiled without the |+viminfo|
feature}
When non-empty, the viminfo file is read upon startup and written
when exiting Vim (see |viminfo-file|). The string should be a comma
separated list of parameters, each consisting of a single character
identifying the particular parameter, followed by a number or string
which specifies the value of that parameter. If a particular
character is left out, then the default value is used for that
parameter. The following is a list of the identifying characters and
the effect of their value.
CHAR VALUE
'' Maximum number of previously edited files for which the marks
are remembered. This parameter must always be included when
'viminfo' is non-empty.
f Whether file marks need to be stored. If zero, file marks ('0
to '9, 'A to 'Z) are not stored. When not present or when
non-zero, they are all stored. '0 is used for the current
cursor position (when exiting or when doing ":wviminfo").
r Removable media. The argument is a string (up to the next
','). This parameter can be given several times. Each
specifies the start of a path for which no marks will be
stored. This is to avoid removable media. For MS-DOS you
could use "ra:,rb:", for Amiga "rdf0:,rdf1:,rdf2:". Case is
ignored. Maximum length of each 'r' argument is 50
characters.
" Maximum number of lines saved for each register. If zero then
registers are not saved. When not included, all lines are
saved. Dont forget to put a backslash before the ", otherwise
it will be recognized as the start of a comment!
: Maximum number of items in the command-line history to be
saved. When not included, the value of 'history' is used.
/ Maximum number of items in the search pattern history to be
saved. If non-zero, then the previous search and substitute
patterns are also saved. When not included, the value of
'history' is used.
h Disable the effect of 'hlsearch' when loading the viminfo
file. When not included, it depends on whether ":nohlsearch"
has been used since the last search command.
@ Maximum number of items in the input-line history to be
saved. When not included, the value of 'history' is used.
n Name of the viminfo file. The name must immediately follow
the 'n'. Must be the last one! If the "-i" argument was
given when starting Vim, that file name overrides the one
given here with 'viminfo'. Environment variables are expanded
when opening the file, not when setting the option.
% When included, save and restore the buffer list. If Vim is
started with a file name argument, the buffer list is not
restored. If Vim is started without a file name argument, the
buffer list is restored from the viminfo file. Buffers
without a file name and buffers for help files are not written
to the viminfo file.
! When included, save and restore global variables that start
with an uppercase letter, and don't contain a lowercase
letter.
Example:
:set viminfo='50,\"1000,:0,n~/vim/viminfo
'50 Marks will be remembered for the last 50 files you
edited.
"1000 Contents of registers (up to 1000 lines each) will be
remembered.
:0 Command-line history will not be saved.
n~/vim/viminfo The name of the file to use is "~/vim/viminfo".
no / Since '/' is not specified, the default will be used,
that is, save all of the search history, and also the
previous search and substitute patterns.
no % The buffer list will not be saved nor read back.
no h 'hlsearch' highlighting will be restored.
*'visualbell'* *'vb'* *'novisualbell'* *'novb'* *beep*
'visualbell' 'vb' boolean (default off)
global
{not in Vi}
Use visual bell instead of beeping. The terminal code to display the
visual bell is given with 't_vb'. When no beep or flash is wanted,
use ":set vb t_vb=".
Note: When the GUI starts, 't_vb' is reset to its default value. You
might want to set it again in your |gvimrc|.
In the GUI, 't_vb' defaults to "<Esc>|f", which inverts the display
for 20 msec. If you want to use a different time, use "<Esc>|40f",
where 40 is the time in msec.
Does not work on the Amiga, you always get a screen flash.
Also see 'errorbells'.
*'warn'* *'nowarn'*
'warn' boolean (default on)
global
Give a warning message when a shell command is used while the buffer
has been changed.
*'weirdinvert'* *'wiv'* *'noweirdinvert'* *'nowiv'*
'weirdinvert' 'wiv' boolean (default off)
global
{not in Vi}
This option has the same effect as the 't_xs' termcap option.
It is provided for backwards compatibility with version 4.x.
Setting 'weirdinvert' has the effect of making 't_xs' non-empty, and
vice versa. Has no effect when the GUI is running.
*'whichwrap'* *'ww'*
'whichwrap' 'ww' string (Vim default: "b,s", Vi default: "")
global
{not in Vi}
Allow specified keys that move the cursor left/right to wrap to the
previous/next line when the cursor is on the first/last character in
the line. Concatenate characters to allow this for these keys:
char key mode
b <BS> Normal and Visual
s <Space> Normal and Visual
h "h" Normal and Visual
l "l" Normal and Visual
< <Left> Normal and Visual
> <Right> Normal and Visual
~ "~" Normal
[ <Left> Insert and Replace
] <Right> Insert and Replace
For example:
:set ww=<,>,[,]
allows wrap only when cursor keys are used.
When the movement keys are used in combination with a delete or change
operator, the <EOL> also counts for a character. This makes "3h"
different from "3dh" when the cursor crosses the end of a line. This
is also true for "x" and "X", because they do the same as "dl" and
"dh". If you use this, you may also want to use the mapping
":map <BS> X" to make backspace delete the character in front of the
cursor.
When 'l' is included, you get a side effect: "yl" on an empty line
will include the <EOL>, so that "p" will insert a new line.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'wildchar'* *'wc'*
'wildchar' 'wc' number (Vim default: <Tab>, Vi default: CTRL-E)
global
{not in Vi}
Character you have to type to start wildcard expansion in the
command-line, as specified with 'wildmode'.
The character is not recognized when used inside a macro. See
'wildcharm' for that.
Although 'wc' is a number option, you can set it to a special key:
:set wc=<Esc>
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'wildcharm'* *'wcm'*
'wildcharm' 'wcm' number (default: none (0))
global
{not in Vi}
'wildcharm' works exactly like 'wildchar', except that it is
recognized when used inside a macro. You can find "spare" command-line
keys suitable for this option by looking at |ex-edit-index|. Normally
you'll never actually type 'wildcharm', just use it in mappings that
automatically invoke completion mode, e.g.:
:set wcm=<C-Z>
:cmap ss so $vim/sessions/*.vim<C-Z>
Then after typing :ss you can use CTRL-P & CTRL-N.
*'wildignore'* *'wig'*
'wildignore' 'wig' string (default "")
global
{not in Vi}
{not available when compiled without the |+wildignore|
feature}
A list of file patterns. A file that matches with one of these
patterns is ignored when completing file or directory names.
The pattern is used like with |:autocmd|, see |autocmd-patterns|.
Also see 'suffixes'.
Example:
:set wildignore=*.o,*.obj
The use of |:set+=| and |:set-=| is preferred when adding or removing
a pattern from the list. This avoids problems when a future version
uses another default.
*'wildmenu'* *'wmnu'* *'nowildmenu'* *'nowmnu'*
'wildmenu' 'wmnu' boolean (default off)
global
{not in Vi}
{not available if compiled without the |+wildmenu|
feature}
When 'wildmenu' is on, command-line completion operates in an enhanced
mode. On pressing 'wildchar' (usually <Tab>) to invoke completion,
the possible matches are shown just above the command line, with the
first match highlighted (overwriting the status line, if there is
one). Keys that show the previous/next match, such as <Tab> or
CTRL-P/CTRL-N, cause the highlight to move to the appropriate match.
When 'wildmode' is used, "wildmenu" mode is used where "full" is
specified. "longest" and "list" do not start "wildmenu" mode.
If there are more matches than can fit in the line, a ">" is shown on
the right and/or a "<" is shown on the left. The status line scrolls
as needed.
The "wildmenu" mode is abandoned when a key is hit that is not used
for selecting a completion.
While the "wildmenu" is active the following keys have special
meanings:
<Left> <Right> - select previous/next match (like CTRL-P/N)
<Down> - in filename/menu name completion: move into a
subdirectory or submenu.
<CR> - in menu completion, when the cursor is just after a
dot: move into a submenu.
<Up> - in filename/menu name completion: move up into
parent directory or parent menu.
This makes the menus accessible from the console |console-menus|.
The "WildMenu" highlighting is used for displaying the current match
|hl-WildMenu|.
*'wildmode'* *'wim'*
'wildmode' 'wim' string (Vim default: "full")
global
{not in Vi}
Completion mode that is used for the character specified with
'wildchar'. It is a comma separated list of up to four parts. Each
part specifies what to do for each consecutive use of 'wildchar. The
first part specifies the behavior for the first use of 'wildchar',
The second part for the second use, etc.
These are the possible values for each part:
"" Complete only the first match.
"full" Complete the next full match. After the last match,
the original string is used and then the first match
again.
"longest" Complete till longest common string. If this doesn't
result in a longer string, use the next part.
"longest:full" Like "longest", but also start 'wildmenu' if it is
enabled.
"list" When more than one match, list all matches.
"list:full" When more than one match, list all matches and
complete first match.
"list:longest" When more than one match, list all matches and
complete till longest common string.
When there is only a single match, it is fully completed in all cases.
Examples:
set wildmode=full
Complete first full match, next match, etc. (the default)
set wildmode=longest,full
Complete longest common string, then each full match.
set wildmode=list:full
List all matches and complete each full match.
set wildmode=list,full
List all matches without completing, then each full match.
set wildmode=longest,list
Complete longest common string, then list alternatives.
*'winaltkeys'* *'wak'*
'winaltkeys' 'wak' string (default "menu")
global
{not in Vi}
{only used in Win32 and Motif GUI; GTK only supports
"yes" and "menu"}
Some GUI versions allow the access to menu entries by using the ALT
key in combination with a character that appears underlined in the
menu. This conflicts with the use of the ALT key for mappings and
entering special characters. This option tells what to do:
no Don't use ALT keys for menus. ALT key combinations can be
mapped, but there is no automatic handling. This can then be
done with the |:simalt| command.
yes ALT key handling is done by the windowing system. ALT key
combinations cannot be mapped.
menu Using ALT in combination with a character that is a menu
shortcut key, will be handled by the windowing system. Other
keys can be mapped.
If the menu is disabled by excluding 'm' from 'guioptions', the ALT
key is never used for the menu.
In the Win32 version, the <F10> key is handled like this too, since
Windows uses it to select a menu.
*'winheight'* *'wh'*
'winheight' 'wh' number (default 1)
global
{not in Vi}
Minimal number of lines for the current window. This is not a hard
minimum, Vim will use less lines if there is not enough room. If the
current window is smaller, its size is increased, at the cost of the
height of other windows. Set it to 999 to make the current window
always fill the screen. Set it to a small number for normal editing.
The height is not adjusted after one of the commands to change the
height of the current window.
'winheight' applies to the current window. Use 'winminheight' to set
the minimal height for other windows.
*'winminheight'* *'wmh'*
'winminheight' 'wmh' number (default 1)
global
{not in Vi}
The minimal height of a window, when it's not the current window.
This is a hard minimum, windows will never become smaller.
When set to zero, windows may be "squashed" to zero lines (i.e. just a
status bar) if necessary. They will return to at least one line when
they become active (since the cursor has to have somewhere to go.)
Use 'winheight' to set the minimal height of the current window.
This option is only checked when making a window smaller. Don't use a
large number, it will cause errors when opening more than a few
windows. A value of 0 to 3 is reasonable.
*'wrap'* *'nowrap'*
'wrap' boolean (default on)
local to window
{not in Vi}
When on, lines longer than the width of the window will wrap and
displaying continues on the next line. When off lines will not wrap
and only part of long lines will be displayed. When the cursor is
moved to a part that is not shown, the screen will scroll horizontally
(also see 'sidescroll' and 'listchars' options and |wrap-off|). If
you want to break long lines, see 'textwidth'.
*'wrapmargin'* *'wm'*
'wrapmargin' 'wm' number (default 0)
local to buffer
Number of characters from the right window border where wrapping
starts. When typing text beyond this limit, an <EOL> will be inserted
and inserting continues on the next line. When 'textwidth' is
non-zero, this option is not used. See also 'formatoptions' and
|ins-textwidth|. {Vi: works differently and less useful}
*'wrapscan'* *'ws'* *'nowrapscan'* *'nows'*
'wrapscan' 'ws' boolean (default on)
global
Searches wrap around the end of the file.
*'write'* *'nowrite'*
'write' boolean (default on)
global
{not in Vi}
Allows writing files. When not set, writing a file is not allowed.
Can be used for a view-only mode, where modifications to the text are
still allowed. Can be reset with the |-m| command line argument.
Filtering text is still possible, even though this requires writing a
temporary file.
*'writeany'* *'wa'* *'nowriteany'* *'nowa'*
'writeany' 'wa' boolean (default off)
global
Allows writing to any file with no need for "!" override.
*'writebackup'* *'wb'* *'nowritebackup'* *'nowb'*
'writebackup' 'wb' boolean (default on with |+writebackup| feature, off
otherwise)
global
{not in Vi}
Make a backup before overwriting a file. The backup is removed after
the file was successfully written, unless the 'backup' option is
also on. Reset this option if your file system is almost full. See
|backup-table| for another explanation.
NOTE: This option is set to the default value when 'compatible' is
set.
*'writedelay'* *'wd'*
'writedelay' 'wd' number (default 0)
global
{not in Vi}
The number of microseconds to wait for each character sent to the
screen. When non-zero, characters are sent to the terminal one by
one. For MS-DOS pcterm this does not work. For debugging purposes.
top - main help file