1 *options.txt* For Vim version 5.8. Last change: 2001 Feb 27
4 VIM REFERENCE MANUAL by Bram Moolenaar
9 1. Setting options |set-option|
10 2. Automatically setting options |auto-setting|
11 3. Saving settings |save-settings|
12 4. Options summary |option-summary|
14 For an overview of options see help.txt |option-list|.
16 Vim has a number of internal variables and switches which can be set to
17 achieve special effects. These options come in three forms:
18 boolean can only be on or off *boolean* *toggle*
19 number has a numeric value
20 string has a string value
22 ==============================================================================
23 1. Setting options *set-option*
26 :se[t] Show all options that differ from their default value.
28 :se[t] all Show all but terminal options.
30 :se[t] termcap Show all terminal options. Note that in the GUI the
31 key codes are not shown, because they are generated
32 interally and can't be changed. Changing the terminal
33 codes in the GUI is not useful either...
35 :se[t] {option}? Show value of {option}.
37 :se[t] {option} Toggle option: set, switch it on.
38 Number option: show value.
39 String option: show value.
41 :se[t] no{option} Toggle option: Reset, switch it off.
44 :se[t] inv{option} Toggle option: Invert value. {not in Vi}
46 :se[t] {option}& Reset option to its default value. {not in Vi}
48 :se[t] all& Set all options, except terminal options, to their
49 default value. The values of 'term', 'lines' and
50 'columns' are not changed. {not in Vi}
52 :se[t] {option}={value} or
53 :se[t] {option}:{value}
54 Set string or number option to {value}.
56 For numeric options the value can be given in decimal,
57 hex (preceded with 0x) or octal (preceded with '0')
58 (hex and octal are only available for machines which
59 have the strtol() function).
60 The old value can be inserted by typing 'wildchar' (by
61 default this is a <Tab> or CTRL-E if 'compatible' is
62 set). See |cmdline-completion|.
63 White space between {option} and '=' is allowed and
64 will be ignored. White space between '=' and {value}
66 See |option-backslash| for using white space and
67 backslashes in {value}.
69 :se[t] {option}+={value} *:set+=*
70 Add the {value} to a number option, or append the
71 {value} to a string option. When the option is a
72 comma separated list, a comma is added, unless the
73 value was empty. There is no check for doubled
74 values. You can avoid this by removing a value first.
76 > set guioptions-=T guioptions+=T
77 Also see |:set-args| above.
79 :se[t] {option}^={value} *:set^=*
80 Multiply the {value} to a number option, or prepend
81 the {value} to a string option. When the option is a
82 comma separated list, a comma is added, unless the
84 Also see |:set-args| above.
86 :se[t] {option}-={value} *:set-=*
87 Subtract the {value} from a number option, or remove
88 the {value} from a string option, if it is there.
89 If the {value} is not found in a string option, there
90 is no error or warning. When the option is a comma
91 separated list, a comma is deleted, unless the option
93 Also see |:set-args| above.
95 :bro[wse] se[t] *:set-browse* *:browse-set* *:opt* *:options*
96 :opt[ions] Open a window for viewing and setting all options.
97 Options are grouped by function.
98 Offers short help for each option. Hit <CR> on the
99 short help to open a help window with more help for
101 Modify the value of the option and hit <CR> on the
102 "set" line to set the new value. For window and
103 buffer specific options, the last accessed window is
104 used to set the option value in, unless this is a help
105 window, in which case the window below help window is
106 used (skipping the option-window).
107 {not available when compiled without the |+eval| or
110 The {option} arguments to ":set" may be repeated. For example:
111 > :set ai nosi sw=3 ts=3
112 If you make an error in one of the arguments, an error message will be given
113 and the following arguments will be ignored.
115 For {option} the form "t_xx" may be used to set a termcap option. This will
116 override the value from the termcap. You can then use it in a mapping. If
117 the "xx" part contains special characters, use the <t_xx> form:
120 The listing from ":set" looks different from Vi. Long string options are put
121 at the end of the list. The number of options is quite large. The output of
122 "set all" probably does not fit on the screen, causing Vim to give the
126 To include white space in a string option value it has to be preceded with a
127 backslash. To include a backslash you have to use two. Effectively this
128 means that the number of backslashes in an option value is halved (rounded
131 > :set tags=tags\ /usr/tags results in "tags /usr/tags"
132 > :set tags=tags\\,file results in "tags\,file"
133 > :set tags=tags\\\ file results in "tags\ file"
135 For MS-DOS and WIN32 backslashes in file names are mostly not removed. More
136 precise: For options that expect a file name (those where environment
137 variables are expanded) a backslash before a normal file name character is not
138 removed. But a backslash before a special character (space, backslash, comma,
139 etc.) is used like explained above.
140 There is one special situation, when the value starts with "\\":
141 > :set dir=\\machine\path results in "\\machine\path"
142 > :set dir=\\\\machine\\path results in "\\machine\path"
143 > :set dir=\\path\\file results in "\\path\file" (wrong!)
144 For the first one the start is kept, but for the second one the backslashes
145 are halved. This makes sure it works both when you expect backslashes to be
146 halved and when you expect the backslashes to be kept. The third gives a
147 result which is probably not what you want. Avoid it.
149 *add-option-flags* *remove-option-flags*
150 Some options are a list of flags. When you want to add a flag to such an
151 option, without changing the existing ones, you can do it like this:
153 Remove a flag from an option like this:
155 This removes the 'a' flag from 'guioptions'.
156 Note that you should add or remove one flag at a time. If 'guioptions' has
157 the value "ab", using "set guioptions-=ba" won't work, because the string "ba"
160 *:set_env* *expand-env* *expand-environment-var*
161 Environment variables in most string options will be expanded. If the
162 environment variable exists the '$' and the following environment variable
163 name is replaced with its value. If it does not exist the '$' and the name
164 are not modified. Any non-id character (not a letter, digit or '_') may
165 follow the environment variable name. That character and what follows is
166 appended to the value of the environment variable. Examples:
167 > :set term=$TERM.new
168 > :set path=/usr/$INCLUDE,$HOME/include,.
171 Using "~" is like using "$HOME", but it is only recognized at the start of an
172 option and after a space or comma.
174 On Unix systems "~user" can be used too. It is replaced by the home directory
175 of user "user". Example:
176 > :set path=~mool/include,/usr/include,.
178 On Unix systems the form "${HOME}" can be used too. The name between {} can
179 contain non-id characters then. Note that if you want to use this for the
180 "gf" command, you need to add the '{' and '}' characters to 'isfname'.
183 The environment variable "$VIM" is used to locate various user files for Vim,
184 such as the user startup script ".vimrc". This depends on the system, see
187 To avoid the need for every user to set the $VIM environment variable, Vim
188 will try to get the value for $VIM in this order:
189 1. The value defined by the $VIM environment variable. You can use this to
190 make Vim look in a specific directory for its support files. Example:
191 > setenv VIM /home/paul/vim
192 2. The path from 'helpfile' is used, unless it contains some environment
193 variable too (the default is "$VIMRUNTIME/doc/help.txt": chicken-egg
194 problem). The file name ("help.txt" or any other) is removed. Then
195 trailing directory names are removed, in this order: "doc", "runtime" and
196 "vim{version}" (e.g., "vim54").
197 3. For MSDOS, Win32 and OS/2 Vim tries to use the directory name of the
198 executable. If it ends in "/src", this is removed. This is useful if you
199 unpacked the .zip file in some directory, and adjusted the search path to
200 find the vim executable. Trailing directory names are removed, in this
201 order: "runtime" and "vim{version}" (e.g., "vim54").
202 4. For Unix the compile-time defined installation directory is used (see the
203 output of ":version").
205 Once Vim has done this once, it will set the $VIM environment variable. To
206 change it later, use a ":let" command like this:
207 > let $VIM = "/home/paul/vim/"
210 The environment variable "$VIMRUNTIME" is used to locate various support
211 files, such as the on-line documentation and files used for syntax
212 highlighting. For example, the main help file is normally
213 "$VIMRUNTIME/doc/help.txt".
214 You don't normally set $VIMRUNTIME youself, but let Vim figure it out. This
215 is the order used to find the value of $VIMRUNTIME:
216 1. If the environment variable $VIMRUNTIME is set, it is used. You can use
217 this when the runtime files are in an unusual location.
218 2. If "$VIM/vim{version}" exists, it is used. {version} is the version
219 number of Vim, without any '-' or '.'. For example: "$VIM/vim54". This is
220 the normal value for $VIMRUNTIME.
221 3. If "$VIM/runtime" exists, it is used.
222 4. The value of $VIM is used. This is for backwards compatibility with older
224 5. When the 'helpfile' option is set and doesn't contain a '$', its value is
225 used, with "doc/help.txt" removed from the end.
227 For Unix, when there is a compiled-in default for $VIMRUNTIME (check the
228 output of ":version"), steps 2, 3 and 4 are skipped, and the compiled-in
229 default is used after step 5. This means that the compiled-in default
230 overrules the value of $VIM. This is useful if $VIM is "/etc" and the runtime
231 files are in "/user/share/vim/vim54".
233 Once Vim has done this once, it will set the $VIMRUNTIME environment variable.
234 To change it later, use a ":let" command like this:
235 > let $VIMRUNTIME = "/home/piet/vim/vim54"
238 Note the maximum length of an expanded option is limited. How much depends on
239 the system, mostly it is something like 256 or 1024 characters.
242 :fix[del] Set the value of 't_kD':
243 't_kb' is 't_kD' becomes ~
247 (CTRL-? is 0177 octal, 0x7f hex) {not in Vi}
249 If your delete key terminal code is wrong, but the
250 code for backspace is alright, you can put this in
253 This works no matter what the actual code for
256 If the backspace key terminal code is wrong you can
258 > :if &term == "termname"
262 Where "^V" is CTRL-V and "<BS>" is the backspace key
263 (don't type four characters!). Replace "termname"
264 with your terminal name.
266 If your <Delete> key sends a strange key sequence (not
267 CTRL-? or CTRL-H) you cannot use ":fixdel". Then use:
268 > :if &term == "termname"
269 > : set t_kD=^V<Delete>
271 Where "^V" is CTRL-V and "<Delete>" is the delete key
272 (don't type eight characters!). Replace "termname"
273 with your terminal name.
276 Note about Linux: By default the backspace key
277 produces CTRL-?, which is wrong. You can fix it by
278 putting this line in your rc.local:
279 > echo "keycode 14 = BackSpace" | loadkeys
282 Note about NetBSD: If your backspace doesn't produce
283 the right code, try this this:
284 > xmodmap -e "keycode 22 = BackSpace"
285 If this works, add this in your .Xmodmap file:
286 > keysym 22 = BackSpace
287 You need to restart for this to take effect.
289 ==============================================================================
290 2. Automatically setting options *auto-setting*
292 Besides changing options with the ":set" command, there are three alternatives
293 to set options automatically for one or more files:
295 1. When starting Vim initializations are read from various places. See
296 |initialization|. Most of them are performed for all editing sessions,
297 and some of them depend on the directory where Vim is started.
298 2. If you start editing a new file, the automatic commands are executed.
299 This can be used to set options for files matching a particular pattern and
300 many other things. See |autocommand|.
301 3. If you start editing a new file, and the 'modeline' option is on, a
302 number of lines at the beginning and end of the file are checked for
303 modelines. This is explained here.
305 *modeline* *vim:* *vi:* *ex:*
306 There are two forms of modelines. The first form:
307 [text]{white}{vi:|vim:|ex:}[white]{options}
309 [text] any text or empty
310 {white} at least one white space (<Space> or <Tab>)
311 {vi:|vim:|ex:} the string "vi:", "vim:" or "ex:"
312 [white] optional white space
313 {options} a list of option settings, separated with white space or ':',
314 where each part between ':' is the argument for a ":set"
320 The second form (this is compatible with some versions of Vi):
322 [text]{white}{vi:|vim:|ex:}[white]set {options}:[text]
324 [text] any text or empty
325 {white} at least one white space (<Space> or <Tab>)
326 {vi:|vim:|ex:} the string "vi:", "vim:" or "ex:"
327 [white] optional white space
328 set the string "set " (note the space)
329 {options} a list of options, separated with white space, which is the
330 argument for a ":set" command
332 [text] any text or empty
335 > /* vim: set ai tw=75: */
337 The white space before {vi:|vim:|ex:} is required. This minimizes the chance
338 that a normal word like "lex:" is caught. There is one exception: "vi:" and
339 "vim:" can also be at the start of the line (for compatibility with version
340 3.0). Using "ex:" at the start of the line will be ignored (this could be
341 short for "example:").
343 The number of lines that are checked can be set with the 'modelines' option.
344 If 'modeline' is off or 'modelines' is 0 no lines are checked.
346 Note that for the first form all of the rest of the line is used, thus a line
349 will give an error message for the trailing "*/". This line is OK:
352 If an error is detected the rest of the line is skipped.
354 If you want to include a ':' in a set command precede it with a '\'. The
355 backslash in front of the ':' will be removed. Example:
356 > /* vi:set dir=c\:\tmp: */
357 This sets the 'dir' option to "c:\tmp". Only a single backslash before the
358 ':' is removed. Thus to include "\:" you have to specify "\\:".
360 No other commands than "set" are supported, for security reasons (somebody
361 might create a Trojan horse text file with modelines).
363 ==============================================================================
364 3. Saving settings *save-settings*
367 :mk[exrc] [file] Write current key mappings and changed options to
368 [file] (default ".exrc" in the current directory),
369 unless it already exists. {not in Vi}
371 :mk[exrc]! [file] Always write current key mappings and changed
372 options to [file] (default ".exrc" in the current
373 directory). {not in Vi}
376 :mkv[imrc][!] [file] Like ":mkexrc", but the default is ".vimrc" in the
377 current directory. The ":version" command is also
378 written to the file. {not in Vi}
381 :mks[ession][!] [file] Like ":mkvimrc", but write commands to the end of the
382 file that reload the files being edited at the time of
383 the command. |session-file|
384 The default file name is "Session.vim".
385 The created file can be loaded with a |:source|
386 command to recreate the current edit session.
387 {not in Vi} {only when compiled with the |+mksession|
390 These commands will write ":map" and ":set" commands to a file, in such a way
391 that when these commands are executed, the current key mappings and options
392 will be set to the same values. The options 'columns', 'endofline',
393 'fileformat', 'key', 'lines', 'modified', 'scroll', 'term', 'textmode',
394 'ttyfast' and 'ttymouse' are not included, because these are terminal or file
395 dependent. Note that the options 'binary', 'paste' and 'readonly' are
396 included, this might not always be what you want.
398 When special keys are used in mappings, The 'cpoptions' option will be
399 temporarily made empty, to avoid the mappings to be misinterpreted. This
400 makes the file incompatible with Vi, but makes sure it can be used with
403 A common method is to use a default ".vimrc" file, make some modifications
404 with ":map" and ":set" commands and write the modified file. First read the
405 default ".vimrc" in with a command like ":source ~piet/.vimrc.Cprogs", change
406 the settings and then save them in the current directory with ":mkvimrc!". If
407 you want to make this file your default .vimrc, move it to your home directory
408 (on Unix), s: (Amiga) or $VIM directory (MS-DOS). You could also use
409 autocommands |autocommand| and/or modelines |modeline|.
411 If you only want to add a single option setting to your vimrc, you can use
413 1. Edit your vimrc file with Vim.
414 2. Play with the option until it's right. E.g., try out different values for
416 3. Append a line to set the value of the option, using the expression register
417 '=' to enter the value. E.g., for the 'guifont' option:
418 > o:set guifont=<C-R>=&guifont<CR><Esc>
419 [<C-R> is a CTRL-R, <CR> is a return, <Esc> is the escape key]
421 Note that when you create a .vimrc file, this can influence the 'compatible'
422 option, which has several side effects. See |'compatible'|.
423 ":mkvimrc", ":mkexrc" and ":mksession" write the command to set or reset the
424 'compatible' option to the output file first, because of these side effects.
427 You can use session files to quickly switch between different projects,
428 automatically loading the files you were last working on in that project.
429 Session files are a nice addition to viminfo-files, which are used to remember
430 information for all sessions together |viminfo-file|.
432 The output of ":mksession" is like ":mkvimrc", but additional commands are
433 added to the file. Which ones depends on the 'sessionoptions' option. The
434 resulting file, when executed with a ":source" command:
435 1. Restores mappings and options, if 'sessionoptions' contains "options".
436 2. Restores global variables that start with an uppercase letter and contain
437 at least one lowercase letter, if 'sessionoptions' contains "globals".
438 3. Unloads all currently loaded buffers.
439 4. Restores the working directory.
440 5. Restores GUI vim window position, if 'sessionoptions' contains "winpos".
441 6. Restores screen height, if 'sessionoptions' contains "resize".
442 7. Reloads the files you were editing, at the lines where you left them. If
443 'sessionoptions' contains "buffers" then all buffers are restored,
444 including hidden and unloaded buffers. Otherwise only buffers in windows
446 8. Restores windows, if 'sessionoptions' contains "winsize".
447 If the Vim window size has been restored or is already the same as in the
448 loaded session, the window sizes are restored exactly. Otherwise, the
449 windows are just given sensible sizes
450 9. If a file exists with the same name as the session file, but ending in
451 "x.vim" (for eXtra), executes that as well. You can use *x.vim files to
452 specify additional settings and actions associated with a given session,
453 such as creating menu items in the GUI version.
455 The full filename of your current session is available in the internal
456 variable "v:this_session". See |this_session-variable|.
458 So an example mapping might be (all one line):
459 > :nmap <S-F1> :wa<Bar>exe "mksession! " . v:this_session<CR>:so $VIM/sessions/
460 which saves the files and session, and starts off the command to load another.
462 ==============================================================================
463 4. Options summary *option-summary*
465 In the list below all the options are mentioned with their full name and with
466 an abbreviation if there is one. Both forms may be used.
468 In this document when a boolean option is "set" that means that ":set option"
469 is entered. When an option is "reset", ":set nooption" is used.
471 For some options there are two default values: The "Vim default", which is
472 used when 'compatible' is not set, and the "Vi default", which is used when
475 Most options are the same in all windows and buffers. There are a few that
476 are specific to how the text is presented in a window. These can be set to a
477 different value in each window. For example the 'list' option can be set in
478 one window and reset in another for the same text, giving both types of view
479 at the same time. There are a few options that are specific to a certain
480 file. These can have a different value for each file or buffer. For example
481 the 'textwidth' option can be 78 for a normal text file and 0 for a C
484 global one option for all buffers and windows
485 local to window each window has its own copy of this option
486 local to buffer each buffer has its own copy of this option
488 When creating a new window the option values from the currently active window
489 are used as a default value for the window-specific options. For the
490 buffer-specific options this depends on the 's' and 'S' flags in the
491 'cpoptions' option. If 's' in included (which is the default) the values for
492 buffer options are copied from the currently active buffer when a buffer is
493 first entered. If 'S' is present the options are copied each time the buffer
494 is entered, this is almost like having global options. If 's' and 'S' are not
495 present, the options are copied from the currently active buffer when the
498 A jump table for the options with a short description can be found at |X_op|.
500 *'aleph'* *'al'* *aleph* *Aleph*
501 'aleph' 'al' number (default 128 for MS-DOS, 224 otherwise)
504 {only available when compiled with the |+rightleft|
506 The ASCII code for the first letter of the Hebrew alphabet. The
507 routine that maps the keyboard in Hebrew mode, both in Insert mode
508 (when hkmap is set) and on the command-line (when hitting CTRL-_)
509 outputs the Hebrew characters in the range [aleph..aleph+26].
510 aleph=128 applies to PC code, and aleph=224 applies to ISO 8859-8.
513 *'allowrevins'* *'ari'* *'noallowrevins'* *'noari'*
514 'allowrevins' 'ari' boolean (default off)
517 {only available when compiled with the |+rightleft|
519 Allow CTRL-_ in Insert and Command-line mode. This is default off, to
520 avoid that users that accidentally type CTRL-_ instead of SHIFT-_ get
521 into reverse Insert mode, and don't know how to get out. See
523 NOTE: This option is reset when 'compatible' is set.
525 *'altkeymap'* *'akm'* *'noaltkeymap'* *'noakm'*
526 'altkeymap' 'akm' boolean (default off)
529 {only available when compiled with the |+farsi|
531 When on, the second language is Farsi. In editing mode CTRL-_ toggles
532 the keyboard map between Farsi and English, when 'allowrevins' set.
534 When off, the keyboard map toggles between Hebrew and English. This
535 is useful to start the vim in native mode i.e. English (left-to-right
536 mode) and have default second language Farsi or Hebrew (right-to-left
537 mode). See |farsi.txt|.
539 *'autoindent'* *'ai'* *'noautoindent'* *'noai'*
540 'autoindent' 'ai' boolean (default off)
542 Copy indent from current line when starting a new line (typing <CR>
543 in Insert mode or when using the "o" or "O" command). If you do not
544 type anything on the new line except <BS> and then type <Esc> or
545 <CR>, the indent is deleted again. When autoindent is on,
546 formatting (with the "gq" command or when you reach 'textwidth' in
547 Insert mode) uses the indentation of the first line. When
548 'smartindent' or 'cindent' is on the indent is changed in specific
549 cases. The 'autoindent' option is reset when the 'paste' option is
550 set. {small difference from Vi: After the indent is deleted when
551 typing <Esc> or <CR>, the cursor position when moving up or down is
552 after the deleted indent; Vi puts the cursor somewhere in the deleted
555 *'autowrite'* *'aw'* *'noautowrite'* *'noaw'*
556 'autowrite' 'aw' boolean (default off)
558 Write the contents of the file, if it has been modified, on each
559 :next, :rewind, :previous, :stop, :suspend, :tag, :!, :make, CTRL-]
560 and CTRL-^ command; and when a CTRL-O, CTRL-I, '{A-Z0-9}, or `{A-Z0-9}
561 command takes one to another file.
563 *'background'* *'bg'*
564 'background' 'bg' string (default "dark" or "light")
567 When set to "dark", Vim will try to use colors that look good on a
568 dark background. When set to "light", Vim will try to use colors that
569 look good on a light background. Any other value is illegal.
570 Vim tries to set the default value according to the terminal used.
571 This will not always be correct.
572 Setting this option does not change the background color, it tells Vim
573 what the backround color looks like. For changing the background
574 color, see |:hi-normal|.
575 When starting the GUI, the default value for 'background' will be
576 "light". When the value is not set in the .gvimrc, and Vim detects
577 that the background is actually quite dark, 'background' is set to
578 "dark". But this happens only AFTER the .gvimrc file has been read
579 (because the window needs to be opened to find the actual background
580 color). To get around this, force the GUI window to be opened by
581 putting a ":gui" command in the .gvimrc file, before where the value
582 of 'background' is used (e.g., before ":syntax on").
583 For the Win32 GUI, setting 'background' before starting the GUI, will
584 change the background and foreground colors to lightgrey on black or
585 black on white. On other systems setting 'background' does not
586 change the foreground or background colors.
587 Normally this option would be set in the .vimrc file. Possibly
588 depending on the terminal name. Example:
589 > if &term == "pcterm"
590 > set background=dark
592 When this option is set, the default settings for the highlight groups
593 will change. To use other settings, place ":highlight" commands AFTER
594 the setting of the 'background' option.
595 This option is also used in the "$VIMRUNTIME/syntax/syntax.vim" file
596 to select the colors for syntax highlighting. After changing this
597 option, you must load syntax.vim again to see the result. This can be
598 done with ":syntax on".
601 'backspace' 'bs' string (default "")
604 Influences the working of <BS>, <Del>, CTRL-W and CTRL-U in Insert
605 mode. This is a list of items, separated by commas. Each item allows
606 a way to backspace over something:
608 indent allow backspacing over autoindent
609 eol allow backspacing over line breaks (join lines)
610 start allow backspacing over the start of insert; CTRL-W and CTRL-U
611 stop once at the start of insert.
613 When the value is empty, Vi compatible backspacing is used.
615 For backwards compatibility with version 5.4 and earlier:
617 0 same as "" (Vi compatible)
618 1 same as "indent,eol"
619 2 same as "indent,eol,start"
621 See |:fixdel| if your <BS> or <Del> key does not do what you want.
622 NOTE: This option is set to "" when 'compatible' is set.
624 *'backup'* *'bk'* *'nobackup'* *'nobk'*
625 'backup' 'bk' boolean (default off)
628 Make a backup before overwriting a file. Leave it around after the
629 file has been successfully written. If you do not want to keep the
630 backup file, but you do want a backup while the file is being
631 written, reset this option and set the 'writebackup' option (this is
632 the default). If you do not want a backup file at all reset both
633 options (use this if your file system is almost full). See the
634 |backup-table| for more explanations.
635 NOTE: This option is reset when 'compatible' is set.
637 *'backupdir'* *'bdir'*
638 'backupdir' 'bdir' string (default for Amiga: ".,t:",
639 for MS-DOS and Win32: ".,c:/tmp,c:/temp"
640 for Unix: ".,~/tmp,~/")
643 List of directories for the backup file, separated with commas.
644 - The backup file will be created in the first directory in the list
645 where this is possible.
646 - Empty means that no backup file will be created ('patchmode' is
648 - A directory "." means to put the backup file in the same directory
650 - A directory starting with "./" (or ".\" for MS-DOS et.al.) means to
651 put the backup file relative to where the edited file is. The
652 leading "." is replaced with the path name of the edited file.
653 ("." inside a directory name has no special meaning).
654 - Spaces after the comma are ignored, other spaces are considered part
655 of the directory name. To have a space at the start of a directory
656 name, precede it with a backslash.
657 - To include a comma in a directory name precede it with a backslash.
658 - A directory name may end in an '/'.
659 - Environment variables are expanded |:set_env|.
660 - Careful with '\' characters, type one before a space, type two to
661 get one in the option (see |option-backslash|), for example:
662 > :set bdir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces
663 - For backwards compatibility with Vim version 3.0 a '>' at the start
664 of the option is removed.
665 See also 'backup' and 'writebackup' options.
666 If you want to hide your backup files on Unix, consider this value:
667 > :set backupdir=./.backup,~/.backup,.,/tmp
668 You must create a ".backup" directory in each directory and in your
669 home directory for this to work properly.
670 The use of |:set+=| and |:set-=| is preferred when adding or removing
671 directories from the list. This avoids problems when a future version
672 uses another default.
674 *'backupext'* *'bex'*
675 'backupext' 'bex' string (default "~", for VMS: "_")
678 String which is appended to a file name to make the name of the
679 backup file. The default is quite unusual, because this avoids
680 accidentally overwriting existing files with a backup file. You might
681 prefer using ".bak", but make sure that you don't have files with
682 ".bak" that you want to keep.
684 *'binary'* *'bin'* *'nobinary'* *'nobin'*
685 'binary' 'bin' boolean (default off)
688 This option should be set before editing a binary file. You can also
689 use the "-b" Vim argument. When this option is switched on a few
690 options will be changed (also when it already was on):
691 'textwidth' will be set to 0
692 'wrapmargin' will be set to 0
693 'modeline' will be off
694 'expandtab' will be off
695 Also, 'fileformat' and 'fileformats' options will not be used, the
696 file is read and written like 'fileformat' was "unix" (a single <NL>
698 NOTE: When you start editing a(nother) file while the 'bin' option is
699 on, settings from autocommands may change the settings again (e.g.,
700 'textwidth'), causing trouble when editing. You might want to set
701 'bin' again when the file has been loaded.
702 The previous values of these options are remembered and restored when
703 'bin' is switched from on to off. Each buffer has its own set of
705 When writing a file the <EOL> for the last line is only written if
706 there was one in the original file (normally Vim appends an <EOL> to
707 the last line if there is none; this would make the file longer). See
708 the 'endofline' option.
710 *'bioskey'* *'biosk'* *'nobioskey'* *'nobiosk'*
711 'bioskey' 'biosk' boolean (default on)
713 {not in Vi} {only for MS-DOS}
714 When on the bios is called to obtain a keyboard character. This works
715 better to detect CTRL-C, but only works for the console. When using a
716 terminal over a serial port reset this option.
717 Also see |'conskey'|.
720 'breakat' 'brk' string (default " ^I!@*-+_;:,./?")
723 {not available when compiled without the |+linebreak|
725 This option lets you choose which characters might cause a line
726 break if 'linebreak' is on.
728 *'browsedir'* *'bsdir'*
729 'browsedir' 'bsdir' string (default for "last")
731 {not in Vi} {only for Motif and Win32 GUI}
732 Which directory to use for the file browser:
733 last Use same directory as with last file browser.
734 buffer Use the directory of the related buffer.
735 current Use the current directory.
737 *'cindent'* *'cin'* *'nocindent'* *'nocin'*
738 'cindent' 'cin' boolean (default off)
741 {not available when compiled without the |+cindent|
743 Enables automatic C program indenting See 'cinkeys' to set the keys
744 that trigger reindenting in insert mode and 'cinoptions' to set your
745 preferred indent style. If 'lisp' is not on and 'equalprg' is empty,
746 the "=" operator indents using this algorithm rather than calling an
747 external program. See |C-indenting|. This option is switched off
748 when 'paste' is set. When you don't like the way 'cindent' works, try
749 the 'smartindent' option.
750 NOTE: This option is reset when 'compatible' is set.
752 'cinkeys' 'cink' string (default "0{,0},:,0#,!^F,o,O,e")
755 {not available when compiled without the |+cindent|
757 A list of keys that, when typed in Insert mode, cause reindenting of
758 the current line. Only happens if 'cindent' is on. See
761 *'cinoptions'* *'cino'*
762 'cinoptions' 'cino' string (default "")
765 {not available when compiled without the |+cindent|
767 The 'cinoptions' affect the way 'cindent' reindents lines in a C
768 program. See |cinoptions-values| for the values of this option, and
769 |C-indenting| for info on C indenting in general.
772 *'cinwords'* *'cinw'*
773 'cinwords' 'cinw' string (default "if,else,while,do,for,switch")
776 {not available when compiled without both the
777 |+cindent| and the |+smartindent| features}
778 These keywords start an extra indent in the next line when
779 'smartindent' or 'cindent' is set. For 'cindent' this is only done at
780 an appropriate place (inside {}).
781 Note that 'ignorecase' isn't used for 'cinwords'. If case doesn't
782 matter, include the keyword both the upper case and lower case:
786 'clipboard' 'cb' string (default "")
789 {only in GUI versions or when the |+xterm_clipboard|
791 This option is a list of comma separated names.
792 These names are recognized:
794 unnamed When included, Vim will use the clipboard register '*'
795 for all yank, delete and put operations which would
796 normally go to the unnamed register. When a register
797 is explictly specified, it will always be used
798 regardless of whether "unnamed" is in 'clipboard' or
799 not. The clipboard register can always be explicitly
800 accessed using the "* notation. Also see
803 autoselect Works like the 'a' flag in 'guioptions': If present,
804 then whenever Visual mode is started, or the Visual
805 area extended, Vim tries to become the owner of the
806 windowing system's global selection or put the
807 selected text on the clipboard. See |guioptions_a|
808 for details. When the GUI is active, the 'a' flag in
809 'guioptions' is used, when the GUI is not active, this
810 "autoselect" flag is used.
813 'cmdheight' 'ch' number (default 1)
816 Number of screen lines to use for the command-line. Helps avoiding
817 |hit-return| prompts.
820 'columns' 'co' number (default 80 or terminal width)
823 Number of columns of the screen. Normally this is set by the terminal
824 initialization and does not have to be set by hand.
825 When Vim is running in the GUI or in a resizable window, setting this
826 option may cause the window size to be changed.
827 When you set this option and Vim is unable to change the physical
828 number of columns of the display, the display may be messed up.
831 'comments' 'com' string (default
832 "s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-")
835 {not available when compiled without the |+comments|
837 A comma separated list of strings that can start a comment line. See
838 |format-comments|. See |option-backslash| about using backslashes to
841 *'compatible'* *'cp'* *'nocompatible'* *'nocp'*
842 'compatible' 'cp' boolean (default on, off when a .vimrc file is found)
845 This option has the effect of making Vim either more Vi-compatible, or
846 make Vim behave in a more useful way.
847 This is a special kind of option, because when it's set or reset,
848 other options are also changed as a side effect. CAREFUL: Setting or
849 resetting this option can have a lot of unexpected effects: Mappings
850 are interpreted in another way, undo behaves differently, etc. If you
851 set this option in your vimrc file, you should probably put it at the
853 By default this option is on and the Vi defaults are used for the
854 options. This default was chosen for those people who want to use Vim
855 just like Vi, and don't even (want to) know about the 'compatible'
857 When a ".vimrc" file is found while Vim is starting up, this option is
858 switched off, and all options that have not been modified will be set
859 to the Vim defaults. Effectively, this means that when a ".vimrc"
860 file exists, Vim will use the Vim defaults, otherwise it will use the
861 Vi defaults. (Note: This doesn't happen for the system-wide vimrc
862 file). Also see |compatible-default|.
863 You can also set this option with the "-C" argument, and reset it with
864 "-N". See |-C| and |-N|.
865 Switching this option off makes the Vim defaults be used for options
866 that have a different Vi and Vim default value. See the options
867 marked with a '+' below. Other options are not modified.
868 At the moment this option is set, several other options will be set
869 or reset to make Vim as Vi-compatible as possible. See the table
870 below. This can be used if you want to revert to Vi compatible
872 See also 'cpoptions'.
874 option + set value effect ~
876 'allowrevins' off no CTRL-_ command
877 'backspace' "" normal backspace
878 'backup' off no backup file
879 'cindent' off no C code indentation
880 'cpoptions' + (all flags) Vi-compatible flags
881 'cscopetag' off don't use cscope for ":tag"
882 'cscopetagorder' 0 see |cscopetagorder|
883 'cscopeverbose' off see |cscopeverbose|
884 'digraph' off no digraphs
885 'esckeys' + off no <Esc>-keys in Insert mode
886 'expandtab' off tabs not expanded to spaces
887 'fileformats' + "" no automatic file format detection,
888 "dos,unix" except for DOS, Windows and OS/2
889 'formatoptions' + "vt" Vi compatible formatting
890 'gdefault' off no default 'g' flag for ":s"
891 'history' + 0 no commandline history
892 'hkmap' off no Hebrew keyboard mapping
893 'hkmapp' off no phonetic Hebrew keyboard mapping
894 'hlsearch' off no highlighting of search matches
895 'incsearch' off no incremental searching
896 'insertmode' off do not start in Insert mode
897 'iskeyword' + "@,48-57,_" keywords contain alphanumeric
899 'joinspaces' on insert 2 spaces after period
900 'modeline' + off no modelines
901 'more' + off no pauses in listings
902 'revins' off no reverse insert
904 'scrolljump' 1 no jump scroll
905 'scrolloff' 0 no scroll offset
906 'shiftround' off indent not rounded to shiftwidth
907 'shortmess' + "" no shortening of messages
908 'showcmd' + off command characters not shown
909 'showmode' + off current mode not shown
910 'smartcase' off no automatic ignore case switch
911 'smartindent' off no smart indentation
912 'smarttab' off no smart tab size
913 'softtabstop' 0 tabs are always 'tabstop' positions
914 'startofline' on goto startofline with some commands
915 'tagrelative' + off tag file names are not relative
916 'textauto' + off no automatic textmode detection
917 'textwidth' 0 no automatic line wrap
918 'tildeop' off tilde is not an operator
919 'ttimeout' off no terminal timeout
920 'whichwrap' + "" left-right movements don't wrap
921 'wildchar' + CTRL-E only when the current value is <Tab>
922 use CTRL-E for cmdline completion
923 'writebackup' on or off depends on +writebackup feature
926 'complete' 'cpt' string (default: ".,w,b,u,t,i")
929 This option specifies how keyword completion |ins-completion| works
930 when CTRL-P or CTRL-N are used. It indicates the type of completion
931 and the places to scan. It is a comma separated list of flags:
932 . scan the current buffer ('wrapscan' is ignored)
933 w scan buffers from other windows
934 b scan other loaded buffers
935 u scan the unloaded buffers
936 k scan the files given with the 'dictionary' option
937 k[dict] scan the file [dict]. Several "k" flags can be given,
938 patterns are valid too. For example:
939 > :set cpt=k/usr/dict/*,k~/spanish
940 i scan current and included files
941 d scan current and included files for defined name or macro
946 Unloaded buffers are not loaded, thus their autocmds |:autocmd| are
947 not executed, this may lead to unexpected completions from some files
948 (gzipped files for example)
950 The default is ".,w,b,u,t,i", which means to scan:
951 1. the current buffer
952 2. buffers in other windows
953 3. other loaded buffers
958 As you can see, CTRL-N and CTRL-P can be used to do any 'iskeyword'-
959 based expansion (eg dictionary |i_CTRL-X_CTRL-K|, included patterns
960 |i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions)
962 *'confirm'* *'cf'* *'noconfirm'* *'nocf'*
963 'confirm' 'cf' boolean (default off)
966 When 'confirm' is on, certain operations that would normally
967 fail because of unsaved changes to a buffer, e.g. ":q" and ":e",
968 instead raise a |dialog| asking if you wish to save the current
969 file(s). You can still use a ! to unconditionally |abandon| a buffer.
970 If 'confirm' is off you can still activate confirmation for one
971 command only (this is most useful in mappings) with the |:confirm|
973 Also see the |confirm()| function and the 'v' flag in 'guioptions'.
975 *'conskey'* *'consk'* *'noconskey'* *'noconsk'*
976 'conskey' 'consk' boolean (default off)
978 {not in Vi} {only for MS-DOS}
979 When on direct console I/O is used to obtain a keyboard character.
980 This should work in most cases. Also see |'bioskey'|. Together,
981 three methods of console input are available:
982 'conskey' 'bioskey' action ~
983 on on or off direct console input
987 *'cpoptions'* *'cpo'*
988 'cpoptions' 'cpo' string (Vim default: "aABceFs",
989 Vi default: all flags)
992 A sequence of single character flags. When a character is present
993 this indicates vi-compatible behavior. This is used for things where
994 not being vi-compatible is mostly or sometimes preferred.
995 'cpoptions' stands for "compatible-options".
996 Commas can be added for readability.
997 To avoid problems with flags that are added in the future, use the
998 "+=" and "-=" feature of ":set" |add-option-flags|.
999 NOTE: This option is set to the Vi default value when 'compatible' is
1000 set and to the Vim default value when 'compatible' is reset.
1002 contains behaviour ~
1003 a When included, a ":read" command with a file name
1004 argument will set the alternate file name for the
1006 A When included, a ":write" command with a file name
1007 argument will set the alternate file name for the
1009 b "\|" in a ":map" command is recognized as the end of
1010 the map command. The '\' is included in the mapping,
1011 the text after the '|' is interpreted as the next
1012 command. Use a CTRL-V instead of a backslash to
1013 include the '|' in the mapping. Applies to all
1014 mapping, abbreviation, menu and autocmd commands.
1016 B A backslash has no special meaning in mappings,
1017 abbreviations and the "to" part of the menu commands.
1018 Remove this flag to be able to use a backslash like a
1019 CTRL-V. For example, the command ":map X \<Esc>"
1020 results in X being mapped to:
1021 'B' included: "\^[" (^[ is a real <Esc>)
1022 'B' excluded: "<Esc>" (5 characters)
1023 ('<' excluded in both cases)
1024 C Do not concatenate sourced lines that start with a
1025 backslash. See |line-continuation|.
1026 < Disable the recognition of special key codes in |<>|
1027 form in mappings, abbreviations, and the "to" part of
1028 menu commands. For example, the command
1029 ":map X <Tab>" results in X being mapped to:
1030 '<' included: "<Tab>" (5 characters)
1031 '<' excluded: "^I" (^I is a real <Tab>)
1032 Also see the 'k' flag below.
1033 c Searching continues at the end of any match at the
1034 cursor position. When not present searching continues
1035 one character from the cursor position. With 'c'
1036 "abababababab" only gets three matches when repeating
1037 "/abab", without 'c' there are five matches.
1038 d Using "./" in the 'tags' option doesn't mean to use
1039 the tags file relative to the current file, but the
1040 tags file in the current directory.
1041 e When executing a register with ":@r", always add a
1042 <CR> to the last line, also when the register is not
1043 linewise. If this flag is not present, the register
1044 is not linewise and the last line does not end in a
1045 <CR>, then the last line is put on the command-line
1046 and can be edited before hitting <CR>.
1047 E It is an error when using "y", "d", "c", "g~", "gu" or
1048 "gU" on an Empty region. The operators only work when
1049 at least one character is to be operate on. Example:
1050 This makes "y0" fail in the first column.
1051 f When included, a ":read" command with a file name
1052 argument will set the file name for the current buffer,
1053 if the current buffer doesn't have a file name yet.
1054 F When included, a ":write" command with a file name
1055 argument will set the file name for the current
1056 buffer, if the current buffer doesn't have a file name
1058 j When joining lines, only add two spaces after a '.',
1059 not after '!' or '?'. Also see 'joinspaces'.
1060 J A |sentence| has to be followed by two spaces after
1061 the '.', '!' or '?'. A <Tab> is not recognized as
1063 k Disable the recognition of raw key codes in
1064 mappings, abbreviations, and the "to" part of menu
1065 commands. For example, if <Key> sends ^[OA (where ^[
1066 is <Esc>), the command ":map X ^[OA" results in X
1068 'k' included: "^[OA" (3 characters)
1069 'k' excluded: "<Key>" (one key code)
1070 Also see the '<' flag above.
1071 K Don't wait for a key code to complete when it is
1072 halfway a mapping. This breaks mapping <F1><F1> when
1073 only part of the second <F1> has been read. It
1074 enables cancelling the mapping by typing <F1><Esc>.
1075 l Backslash in a [] range in a search pattern is taken
1076 literally, only "\]" is special See |/[]|
1077 'l' included: "/[ \t]" finds <Space>, '\' and 't'
1078 'l' excluded: "/[ \t]" finds <Space> and <Tab>
1079 L When the 'list' option is set, 'wrapmargin',
1080 'textwidth' and Virtual replace mode (see |gR|) count
1081 a <Tab> as two characters, instead of the normal
1082 behavior of a <Tab>.
1083 m When included, a showmatch will always wait half a
1084 second. When not included, a showmatch will wait half
1085 a second or until a character is typed. |'showmatch'|
1086 o Line offset to search command is not remembered for
1088 O Don't complain if a file is being overwritten, even
1089 when it didn't exist when editing it. This is a
1090 protection agains a file unexpectedly created by
1091 someone else. Vi didn't complain about this.
1092 p Vi compatible Lisp indenting. When not present, a
1093 slightly better algorithm is used.
1094 r Redo ("." command) uses "/" to repeat a search
1095 command, instead of the actually used search string.
1096 s Set buffer options when entering the buffer for the
1097 first time. This is like it is in Vim version 3.0.
1098 And it is the default. If not present the options are
1099 set when the buffer is created.
1100 S Set buffer options always when entering a buffer
1101 (except 'readonly', 'fileformat', 'filetype' and
1102 'syntax'). This is the (most) Vi compatible setting.
1103 The options are set to the values in the current
1104 buffer. When you change an option and go to another
1105 buffer, the value is copied. Effectively makes the
1106 buffer options global to all buffers.
1108 's' 'S' copy buffer options
1109 no no when buffer created
1110 yes no when buffer first entered (default)
1111 X yes each time when buffer entered (vi comp.)
1113 t Search pattern for the tag command is remembered for
1114 "n" command. Otherwise Vim only puts the pattern in
1115 the history for search pattern, but doesn't change the
1116 last used search pattern.
1117 u Undo is Vi compatible. See |undo-two-ways|.
1118 w When using "cw" on a blank character, only change one
1119 character and not all blanks until the start of the
1121 W Don't overwrite a readonly file. When omitted, ":w!"
1122 overwrites a readonly file, if possible.
1123 x <Esc> on the command-line executes the command-line.
1124 The default in Vim is to abandon the command-line,
1125 because <Esc> normally aborts a command. |c_<Esc>|
1126 y A yank command can be redone with ".".
1127 $ When making a change to one line, don't redisplay the
1128 line, but put a '$' at the end of the changed text.
1129 The changed text will be overwritten when you type the
1130 new text. The line is redisplayed if you type any
1131 command that moves the cursor from the insertion
1133 ! When redoing a filter command, use the last used
1134 external command, whatever it was. Otherwise the last
1135 used -filter- command is used.
1136 * Use ":*" in the same way as ":@". When not included,
1137 ":*" is an alias for ":'<,'>", select the Visual area.
1138 % Vi-compatible matching is done for the "%" command.
1139 Does not recognize "#if", "#endif", etc.
1140 Does not recognize "/*" and "*/".
1141 Parens inside single and double quotes are also
1142 counted, causing a string that contains a paren to
1143 disturb the matching. For example, in a line like
1144 "if (strcmp("foo(", s))" the first paren does not
1145 match the last one. When this flag is not included,
1146 parens inside single and double quotes are treated
1147 specially. When matching a paren outside of quotes,
1148 everything inside quotes is ignored. When matching a
1149 paren inside quotes, it will find the matching one (if
1150 there is one). This works very well for C programs.
1152 *'cscopeprg'* *'csprg'*
1153 'cscopeprg' 'csprg' string (default "cscope")
1155 {not available when compiled without the |+cscope|
1158 Specifies the command to execute cscope. See |cscopeprg|.
1159 When this option is set from a |modeline|, while the 'secure' option
1160 is set, you will get a warning message.
1162 *'cscopetag'* *'cst'* *'nocscopetag'* *'nocst'*
1163 'cscopetag' 'cst' boolean (default off)
1165 {not available when compiled without the |+cscope|
1168 Use cscope for tag commands. See |cscope-options|.
1169 NOTE: This option is reset when 'compatible' is set.
1171 *'cscopetagorder'* *'csto'*
1172 'cscopetagorder' 'csto' number (default 0)
1174 {not available when compiled without the |+cscope|
1177 Determines the order in which ":cstag" performs a search. See
1179 NOTE: This option is set to 0 when 'compatible' is set.
1181 *'cscopeverbose'* *'csverb'*
1182 *'nocscopeverbose'* *'nocsverb'*
1183 'cscopeverbose' 'csverb' boolean (default off)
1185 {not available when compiled without the |+cscope|
1188 Give messages when adding a cscope database. See |cscopeverbose|.
1189 NOTE: This option is reset when 'compatible' is set.
1192 'define' 'def' string (default "^#\s*define")
1195 Pattern to be used to find a macro definition. It is a search
1196 pattern, just like for the "/" command. This option is used for the
1197 commands like "[i" and "[d" |include-search|. The 'isident' option is
1198 used to recognize the identifier name after the match. See
1199 |option-backslash| about inserting backslashes to include a space or
1201 The default value is for C programs. For C++ this value would be
1202 useful, to include const type declarations:
1203 > ^\(#\s*define\|[a-z]*\s*const\s*[a-z]*\)
1204 When using the ":set" command, you need to double the backslashes!
1206 *'dictionary'* *'dict'*
1207 'dictionary' 'dict' string (default "")
1210 List of file names, separated by commas, that are used to lookup words
1211 for keyword completion commands |i_CTRL-X_CTRL-K|. Each file should
1212 contain a list of words. This can be one word per line, or several
1213 words per line, separated by non-keyword characters (white space is
1215 To include a comma in a file name precede it with a backslash. Spaces
1216 after a comma are ignored, otherwise spaces are included in the file
1217 name. See |option-backslash| about using backslashes.
1218 Where to find a list of words?
1219 - On FreeBSD, there is the file "/usr/share/dict/words".
1220 - In the Simtel archive, look in the "msdos/linguist" directory.
1221 - In "miscfiles" of the GNU collection.
1222 The use of |:set+=| and |:set-=| is preferred when adding or removing
1223 directories from the list. This avoids problems when a future version
1224 uses another default.
1226 *'digraph'* *'dg'* *'nodigraph'* *'nodg'*
1227 'digraph' 'dg' boolean (default off)
1230 {not available when compiled without the |+digraphs|
1232 Enable the entering of digraphs in Insert mode with {char1} <BS>
1233 {char2}. See |digraphs|.
1234 NOTE: This option is reset when 'compatible' is set.
1236 *'directory'* *'dir'*
1237 'directory' 'dir' string (default for Amiga: ".,t:",
1238 for MS-DOS and Win32: ".,c:\tmp,c:\temp"
1239 for Unix: ".,~/tmp,/var/tmp,/tmp")
1241 List of directory names for the swap file, separated with commas.
1242 - The swap file will be created in the first directory where this is
1244 - Empty means that no swap file will be used (recovery is
1246 - A directory "." means to put the swap file in the same directory as
1247 the edited file. On Unix, a dot is prepended to the file name, so
1248 it doesn't show in a directory listing.
1249 - A directory starting with "./" (or ".\" for MS-DOS et.al.) means to
1250 put the swap file relative to where the edited file is. The leading
1251 "." is replaced with the path name of the edited file.
1252 - For Unix and Win32, if a directory ends in two path separators, the
1253 swap file name will be built from the complete path to the file
1254 with all path separators substituted to percent '%' signs. This will
1255 ensure file name uniqueness in the preserve directory.
1256 - Spaces after the comma are ignored, other spaces are considered part
1257 of the directory name. To have a space at the start of a directory
1258 name, precede it with a backslash.
1259 - To include a comma in a directory name precede it with a backslash.
1260 - A directory name may end in an ':' or '/'.
1261 - Environment variables are expanded |:set_env|.
1262 - Careful with '\' characters, type one before a space, type two to
1263 get one in the option (see |option-backslash|), for example:
1264 > :set dir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces
1265 - For backwards compatibility with Vim version 3.0 a '>' at the start
1266 of the option is removed.
1267 Using "." first in the list is recommended. This means that editing
1268 the same file twice will result in a warning. Using "/tmp" on Unix is
1269 discouraged: When the system crashes you lose the swap file.
1270 "/var/tmp" is often not cleared when rebooting, thus is a better
1271 choice than "/tmp". But it can contain a lot of files, your swap
1272 files get lost in the crowd. That is why a "tmp" directory in your
1273 home directory is tried first.
1274 The use of |:set+=| and |:set-=| is preferred when adding or removing
1275 directories from the list. This avoids problems when a future version
1276 uses another default.
1277 {Vi: directory to put temp file in, defaults to "/tmp"}
1280 'display' 'dy' string (default "")
1283 Change the way text is displayed. This is comma separated list of
1284 flags. Currently only one is supported:
1285 lastline When included, as much as possible of the last line
1286 in a window will be displayed. When not included, a
1287 last line that doesn't fit is replaced with "@" lines.
1289 *'ed'* *'edcompatible'* *'noed'* *'noedcompatible'*
1290 'edcompatible' 'ed' boolean (default off)
1292 Makes the 'g' and 'c' flags of the ":substitute" command to be
1293 toggled each time the flag is given. See |complex-change|. See
1294 also 'gdefault' option.
1295 Switching this option on is discouraged!
1297 *'endofline'* *'eol'* *'noendofline'* *'noeol'*
1298 'endofline' 'eol' boolean (default on)
1301 When writing a file and this option is off and the 'binary' option
1302 is on, no <EOL> will be written for the last line in the file. This
1303 option is automatically set when starting to edit a new file, unless
1304 the file does not have an <EOL> for the last line in the file, in
1305 which case it is reset. Normally you don't have to set or reset this
1306 option. When 'binary' is off the value is not used when writing the
1307 file. When 'binary' is on it is used to remember the presence of a
1308 <EOL> for the last line in the file, so that when you write the file
1309 the situation from the original file can be kept. But you can change
1312 *'equalalways'* *'ea'* *'noequalalways'* *'noea'*
1313 'equalalways' 'ea' boolean (default on)
1316 When on, all the windows are automatically made the same size after
1317 splitting or closing a window. When off, splitting a window will
1318 reduce the size of the current window and leave the other windows the
1319 same. When closing a window the extra lines are given to the window
1323 'equalprg' 'ep' string (default "")
1326 External program to use for "=" command. When this option is empty
1327 the internal formatting functions are used ('lisp' or 'cindent').
1328 Environment variables are expanded |:set_env|. See |option-backslash|
1329 about including spaces and backslashes.
1330 When this option is set from a |modeline|, while the 'secure' option
1331 is set, you will get a warning message.
1333 *'errorbells'* *'eb'* *'noerrorbells'* *'noeb'*
1334 'errorbells' 'eb' boolean (default off)
1336 Ring the bell (beep or screen flash) for error messages. This only
1337 makes a difference for error messages, the bell will be used always
1338 for a lot of errors without a message (e.g., hitting <Esc> in Normal
1339 mode). See 'visualbell' on how to make the bell behave like a beep,
1340 screen flash or do nothing.
1342 *'errorfile'* *'ef'*
1343 'errorfile' 'ef' string (Amiga default: "AztecC.Err",
1344 others: "errors.err")
1347 {not available when compiled without the |+quickfix|
1349 Name of the errorfile for the QuickFix mode (see |:cf|).
1350 When the "-q" command-line argument is used, 'errorfile' is set to the
1351 following argument. See |-q|.
1352 NOT used for the ":make" command. See 'makeef' for that.
1353 Environment variables are expanded |:set_env|.
1354 See |option-backslash| about including spaces and backslashes.
1356 *'errorformat'* *'efm'*
1357 'errorformat' 'efm' string (default is very long)
1360 {not available when compiled without the |+quickfix|
1362 Scanf-like description of the format for the lines in the error file
1363 (see |errorformat|).
1365 *'esckeys'* *'ek'* *'noesckeys'* *'noek'*
1366 'esckeys' 'ek' boolean (Vim default: on, Vi default: off)
1369 Function keys that start with an <Esc> are recognized in Insert
1370 mode. When this option is off, the cursor and function keys cannot be
1371 used in Insert mode if they start with an <Esc>. The advantage of
1372 this is that the single <Esc> is recognized immediately, instead of
1373 after one second. Instead of resetting this option, you might want to
1374 try changing the values for 'timeoutlen' and 'ttimeoutlen'. Note that
1375 when 'esckeys' is off, you can still map anything, but the cursor keys
1376 won't work by default.
1377 NOTE: This option is set to the Vi default value when 'compatible' is
1378 set and to the Vim default value when 'compatible' is reset.
1380 *'eventignore'* *'ei'*
1381 'eventignore' 'ei' string (default "")
1384 A list of autocommand event names, which are to be ignored.
1385 When set to "all", all autocommand events are ignored, autocommands
1386 will not be executed.
1387 Otherwise this is a comma separated list of event names. Example:
1388 > :set ei=WinEnter,WinLeave
1390 *'expandtab'* *'et'* *'noexpandtab'* *'noet'*
1391 'expandtab' 'et' boolean (default off)
1394 In Insert mode: Use the appropriate number of spaces to insert a
1395 <Tab>. Spaces are used in indents with the '>' and '<' commands and
1396 when 'autoindent' is on. To insert a real tab when 'expandtab' is
1397 on, use CTRL-V<Tab>. See also |:retab| and |ins-expandtab|.
1398 NOTE: This option is reset when 'compatible' is set.
1400 *'exrc'* *'ex'* *'noexrc'* *'noex'*
1401 'exrc' 'ex' boolean (default off)
1404 Enables the reading of .vimrc, .exrc and .gvimrc in the current
1405 directory. If you switch this option on you should also consider
1406 setting the 'secure' option (see |initialization|). Using a local
1407 .exrc, .vimrc or .gvimrc is a potential security leak, use with care!
1408 also see |.vimrc| and |gui-init|.
1409 This option cannot be set from a |modeline|.
1411 *'fileencoding'* *'fe'*
1412 'fileencoding' 'fe' string (default: "ansi")
1414 {only available when compiled with the |+multi_byte|
1417 Enables editing of alternative encoded files, for example shift-JIS or
1418 Unicode. When you set this option, it fires of a 'FileEncoding'
1419 autocommand so you can set up fonts if necessary.
1423 Possible values are:
1424 ansi default setting, good for most Western languages
1425 unicode (to be implemented>
1426 japan set to use shift-JIS (Windows CP 932) encoding
1427 korea set to use Korean DBCS
1428 prc use simplified Chinese encoding
1429 taiwan use traditional Chinese encoding
1430 hebrew (to be implemented)
1431 farsi (to be implemented)
1433 This lets you view, for example, a Japanese S-JIS encoded file
1434 (provided you have a suitable font). The DBCS characters are treated
1435 as a unit, i.e. you cursor past them or delete them, etc as a unit,
1436 rather than deleting half a character.
1438 *'fileformat'* *'ff'*
1439 'fileformat' 'ff' string (DOS, Win32, OS/2 default: "dos",
1440 Unix default: "unix",
1441 Macintosh default: "mac")
1444 This gives the <EOL> of the current buffer, which is used for
1445 reading/writing the buffer from/to a file:
1449 When "dos" is used, CTRL-Z at the end of a file is ignored.
1450 See |file-formats| and |file-read|.
1451 When 'binary' is set, the value of 'fileformat' is ignored, file I/O
1452 works like it was set to "unix'.
1453 This option is set automatically when starting to edit a file and
1454 'fileformats' is not empty and 'binary' is off.
1455 When this option is set, after starting to edit a file, the 'modified'
1456 option is set, because the file would be different when written.
1457 For backwards compatibility: When this option is set to "dos",
1458 'textmode' is set, otherwise 'textmode' is reset.
1460 *'fileformats'* *'ffs'*
1461 'fileformats' 'ffs' string (Vim+Vi DOS, Win32, OS/2 default: "dos,unix",
1462 Vim Unix default: "unix,dos",
1463 Vim Mac default: "mac,unix,dos",
1464 Vi others default: "")
1467 This gives the end-of-line (<EOL>) formats that will be tried. It is
1468 used when starting to edit a new buffer and when reading a file into
1470 - When empty, the format defined with 'fileformat' will be used
1471 always. It is not set automatically.
1472 - When set to one name, that format will be used whenever a new buffer
1473 is opened. 'fileformat' is set accordingly for that buffer. The
1474 'fileformats' name will be used when a file is read into an existing
1475 buffer, no matter what 'fileformat' for that buffer is set to.
1476 - When more than one name is present, separated by commas, automatic
1477 <EOL> detection will be done when reading a file. When starting to
1478 edit a file, a check is done for the <EOL>:
1479 1. If all lines end in <CR><NL>, and 'fileformats' includes "dos",
1480 'fileformat' is set to "dos".
1481 2. If a <NL> is found and 'fileformats' includes "unix, 'fileformat'
1482 is set to "unix". Note that when a <NL> is found without a
1483 preceding <CR>, "unix" is preferred over "dos".
1484 3. If 'fileformats' includes "mac", 'fileformat' is set to "mac".
1485 This means that "mac" is only chosen when "unix" is not present,
1486 or when no <NL> is found in the file, and when "dos" is not
1487 present, or no <CR><NL> is present in the file.
1488 Also if "unix" was first chosen, but the first <CR> is before
1489 the first <NL> and there appears to be more <CR>'s than <NL>'s in
1490 the file, then 'fileformat' is set to "mac".
1491 4. If 'fileformat' is still not set, the first name from
1492 'fileformats' is used.
1493 When reading a file into an existing buffer, the same is done, but
1494 this happens like 'fileformat' has been set appropriately for that
1495 file only, the option is not changed.
1496 When 'binary' is set, the value of 'fileformats' is not used.
1498 For systems with a Dos-like <EOL> (<CR><NL>), when reading files that
1499 are ":source"ed and for vimrc files, automatic <EOL> detection may be
1501 - When 'fileformats' is empty, there is no automatic detection. Dos
1502 format will be used.
1503 - When 'fileformats' is set to one or more names, automatic detection
1504 is done. This is based on the first <NL> in the file: If there is a
1505 <CR> in front of it, Dos format is used, otherwise Unix format is
1507 Also see |file-formats|.
1508 For backwards compatibility: When this option is set to an empty
1509 string or one format (no comma is included), 'textauto' is reset,
1510 otherwise 'textauto' is set.
1511 NOTE: This option is set to the Vi default value when 'compatible' is
1512 set and to the Vim default value when 'compatible' is reset.
1515 'filetype' 'ft' string (default: "")
1518 {not available when compiled without the |+autocmd|
1520 When this option is set, the FileType autocommand event is triggered.
1521 All autocommands that match with the value of this option will be
1522 executed. Thus the value of 'filetype' is used in place of the file
1524 Otherwise this option does not always reflect the current file type.
1525 This option is normally set when the file type is detected. To enable
1526 this use the ":filetype on" command. |:filetype|
1527 Setting this option to a different value is most useful in a modeline,
1528 for a file for which the file type is not automatically recognized.
1529 Example, for in an IDL file:
1530 > /* vim: set filetype=idl : */
1531 |FileType| |autocmd-filetypes|
1532 Do not confuse this option with 'osfiletype', which is for the file
1533 type that is actually stored with the file.
1534 This option is not copied to another buffer, independent of the 's' or
1535 'S' flag in 'cpoptions'.
1537 *'fkmap'* *'fk'* *'nofkmap'* *'nofk'*
1538 'fkmap' 'fk' boolean (default off)
1541 {only available when compiled with the |+rightleft|
1543 When on, the keyboard is mapped for the Farsi character set.
1544 Normally you would set 'allowrevins' and use CTRL-_ in insert mode to
1545 toggle this option |i_CTRL-_|. See |farsi.txt|.
1547 *'formatoptions'* *'fo'*
1548 'formatoptions' 'fo' string (Vim default: "tcq", Vi default: "vt")
1551 This is a sequence of letters which describes how automatic
1552 formatting is to be done. See |fo-table|. When the 'paste' option is
1553 on, no formatting is done (like 'formatoptions' is empty). Commas can
1554 be inserted for readability.
1555 To avoid problems with flags that are added in the future, use the
1556 "+=" and "-=" feature of ":set" |add-option-flags|.
1557 NOTE: This option is set to the Vi default value when 'compatible' is
1558 set and to the Vim default value when 'compatible' is reset.
1560 *'formatprg'* *'fp'*
1561 'formatprg' 'fp' string (default "")
1564 The name of an external program that will be used to format the lines
1565 selected with the "gq" command. The program must take the input on
1566 stdin and produce the output on stdout. The Unix program "fmt" is
1567 such a program. If this option is an empty string, the internal
1568 format function will be used |C-indenting|. Environment variables are
1569 expanded |:set_env|. See |option-backslash| about including spaces
1571 When this option is set from a |modeline|, while the 'secure' option
1572 is set, you will get a warning message.
1574 *'gdefault'* *'gd'* *'nogdefault'* *'nogd'*
1575 'gdefault' 'gd' boolean (default off)
1578 When on, the ":substitute" flag 'g' is default on. This means that
1579 all matches in a line are substituted instead of one. When a 'g' flag
1580 is given to a ":substitute" command, this will toggle the substitution
1581 of all or one match. See |complex-change|.
1583 command 'gdefault' on 'gdefault' off ~
1584 :s/// subst. all subst. one
1585 :s///g subst. one subst. all
1586 :s///gg subst. all subst. one
1588 NOTE: This option is reset when 'compatible' is set.
1590 *'grepformat'* *'gfm'*
1591 'grepformat' 'gfm' string (default "%f:%l%m,%f %l%m")
1594 Format to recognize for the ":grep" command output.
1595 This is a scanf-like string that uses the same format as the
1596 'errorformat' option: see |errorformat|.
1599 'grepprg' 'gp' string (default "grep -n", Win32: "findstr /n")
1602 Program to use for the ":grep" command. This option may contain '%'
1603 and '#' characters, which are expanded like when used in a command-
1604 line. The placeholder "$*" is allowed to specify where the arguments
1605 will be included. Environment variables are expanded |:set_env|. See
1606 |option-backslash| about including spaces and backslashes.
1608 See also the section |:make_makeprg|, since most of the comments there
1609 apply equally to 'grepprg'.
1610 When this option is set from a |modeline|, while the 'secure' option
1611 is set, you will get a warning message.
1613 *'guicursor'* *'gcr'*
1614 'guicursor' 'gcr' string (default "n-v-c:block-Cursor,ve:ver35-Cursor,
1615 o:hor50-Cursor,i-ci:ver25-Cursor,
1616 r-cr:hor20-Cursor,sm:block-Cursor
1617 -blinkwait175-blinkoff150-blinkon175")
1620 {only available when compiled with GUI enabled, and
1621 for MSDOS and Win32 console}
1622 This option tells Vim what the cursor should look like in different
1623 modes. The option is a comma separated list of parts. Each part
1624 consist of a mode-list and an argument-list:
1625 mode-list:argument-list,mode-list:argument-list,..
1626 The mode-list is a dash separated list of these modes:
1629 ve Visual mode with 'selection' "exclusive" (same as 'v',
1631 o Operator-pending mode
1634 c Command-line Normal (append) mode
1635 ci Command-line Insert mode
1636 cr Command-line Replace mode
1637 sm showmatch in Insert mode
1639 The argument-list is a dash separated list of these arguments:
1640 hor{N} horizontal bar, {N} percent of the character height
1641 ver{N} vertical bar, {N} percent of the character width
1642 block block cursor, fills the whole character
1643 [only one of the above three should be present]
1644 blinkwait{N} *cursor-blinking*
1647 blink times for cursor: blinkwait is the delay before
1648 the cursor starts blinking, blinkon is the time that
1649 the cursor is shown and blinkoff is the time that the
1650 cursor is not shown. The times are in msec. When one
1651 of the numbers is zero, there is no blinking. The
1652 default is: "blinkwait700-blinkon400-blinkoff250".
1653 These numbers are used for a missing entry. This
1654 means that blinking is enabled by default. To switch
1655 blinking off you can use "blinkon0". The cursor only
1656 blinks when Vim is waiting for input, not while
1657 executing a command.
1658 To make the cursor blink in an xterm, see
1661 a highlight group name, that sets the color and font
1664 n-c-v:block-nCursor in Normal, Command-line and Visual mode, use a
1665 block cursor with colors from the "nCursor"
1667 i-ci:ver30-iCursor-blinkwait300-blinkon200-blinkoff150
1668 In Insert and Command-line Insert mode, use a
1669 30% vertical bar cursor with colors from the
1670 "iCursor" highlight group. Blink a bit
1673 The 'a' mode is different. It will set the given argument-list for
1674 all modes. It does not reset anything to defaults. This can be used
1675 to do a common setting for all modes. For example, to switch off
1676 blinking: "a:blinkon0"
1678 Examples of cursor highlighting:
1679 > :highlight Cursor gui=reverse guifg=NONE guibg=NONE
1680 > :highlight Cursor gui=NONE guifg=bg guibg=fg
1682 In an MSDOS or Win32 console, only the height of the cursor can be
1683 changed. This can be done by specifying a block cursor, or a
1684 percentage for a vertical or horizontal cursor.
1687 'guifont' 'gfn' string (default "")
1690 {only available when compiled with GUI enabled}
1691 This is a list of fonts which will be used for the GUI version of Vim.
1692 In its simplest form the value is just one font name. When
1693 the font cannot be found you will get an error message. To try other
1694 font names a list can be specified, font names separated with commas.
1695 The first valid font is used.
1696 Spaces after a comma are ignored. To include a comma in a font name
1697 precede it with a backslash. Setting an option requires an extra
1698 backslash before a space and a backslash. See also
1699 |option-backslash|. For example:
1700 > :set guifont=Screen15,\ 7x13,font\\,with\\,commas
1701 will make vim try to use the font "Screen15" first, and if it fails it
1702 will try to use "7x13" and then "font,with,commas" instead.
1703 Note that the fonts must be mono-spaced (all characters have the same
1705 To preview a font on X11, you might be able to use the "xfontsel"
1706 program. The "xlsfonts" program gives a list of all available fonts.
1707 For Win32 and GTK only:
1709 will bring up a font requester, where you can pick the font you want.
1710 If none of the fonts can be loaded, vim will keep the current setting.
1711 If an empty font list is given, vim will try using other resource
1712 settings (for X, it will use the Vim.font resource), and finally it
1713 will try some builtin default which should always be there ("7x13" in
1714 the case of X). The font names given should be "normal" fonts. Vim
1715 will try to find the related bold and italic fonts.
1717 - takes these options in the font name:
1718 hXX - height is XX (points)
1719 wXX - width is XX (points)
1724 Use a ':' to separate the options.
1725 - A '_' can be used in the place of a space, so you don't need to use
1726 backslashes to escape the spaces.
1728 > :set guifont=courier_new:h12:w5:b
1729 Have a look at <http://nova.bsuvc.bsu.edu/prn/monofont/> for
1730 mono-spaced fonts and comments on them.
1731 See also |font-sizes|.
1733 *'guiheadroom'* *'ghr'*
1734 'guiheadroom' 'ghr' number (default 50)
1736 {not in Vi} {only for GTK and X11 GUI}
1737 The number of pixels subtracted from the screen height when fitting
1738 the GUI window on the screen. Set this before the GUI is started,
1739 e.g., in your |gvimrc| file. When zero, the whole screen height will
1740 be used by the window. When positive, the specified number of pixel
1741 lines will be left for window decorations and other items on the
1742 screen. Set it to a negative value to allow windows taller than the
1745 *'guifontset'* *'gfs'*
1746 'guifontset' 'gfs' string (default "")
1749 {only available when compiled with GUI enabled and
1750 with the |+xfontset| feature}
1751 When not empty, specifies two fonts to be used. The first one for
1752 normal english, the second one for your special language. See
1755 *'guioptions'* *'go'*
1756 'guioptions' 'go' string (default "agimrtT" (Win32 and GTK),
1757 "agimrt" (Unix) or "gmrt")
1760 {only available when compiled with GUI enabled}
1761 This option only has an effect in the GUI version of vim. It is a
1762 sequence of letters which describes what components and options of the
1764 To avoid problems with flags that are added in the future, use the
1765 "+=" and "-=" feature of ":set" |add-option-flags|.
1767 Valid letters are as follows:
1769 'a' Autoselect: If present, then whenever VISUAL mode is started,
1770 or the Visual area extended, Vim tries to become the owner of
1771 the windowing system's global selection. This means that the
1772 Visually highlighted text is available for pasting into other
1773 applications as well as into Vim itself. When the Visual mode
1774 ends, possibly due to an operation on the text, or when an
1775 application wants to paste the selection, the highlighted text
1776 is automatically yanked into the "* selection register.
1777 Thus the selection is still available for pasting into other
1778 applications after the VISUAL mode has ended.
1779 If not present, then Vim won't become the owner of the
1780 windowing system's global selection unless explicitly told to
1781 by a yank or delete operation for the "* register.
1783 'f' Foreground: Don't use fork() to detach the GUI from the shell
1784 where it was started. Use this for programs that wait for the
1785 editor to finish (e.g., an e-mail program). Alternatively you
1786 can use "gvim -f" or ":gui -f" to start the GUI in the
1787 foreground. |gui-fork|
1788 Note: Set this option in the vimrc file. The forking may have
1789 happened already when the gvimrc file is read.
1791 'i' Use a Vim icon. For GTK with KDE it is used in the left-upper
1792 corner of the window. It's black&white on non-GTK, because of
1793 limitations of X11. For a color icon, see |X11-icon|.
1795 'm' Menu bar is present.
1796 'M' The system menu "$VIMRUNTIME/menu.vim" is not sourced. Note
1797 that this flag must be added in the .vimrc file. When the
1798 .gvimrc file is sourced the system menu has already been
1800 'g' Grey menu items: Make menu items that are not active grey. If
1801 'g' is not included inactive menu items are not shown at all.
1802 Exception: Athena will always use grey menu items.
1804 't' Include tearoff menu items. Currently only works for Win32,
1805 GTK+, and Motif 1.2 GUI.
1806 'T' Include Toolbar. Currently only in Win32 and GTK+ GUI.
1808 'r' Right-hand scrollbar is present when 'r' is included.
1809 'l' Left-hand scrollbar is present when 'l' is included.
1810 'b' Bottom (horizontal) scrollbar is present when 'b' is included.
1812 And yes, you may even have scrollbars on the left AND the right if
1813 you really want to :-). See |gui-scrollbars| for more information.
1815 'v' Use a vertical button layout for dialogs. When not included,
1816 a horizontal layout is preferred, but when it doesn't fit a
1817 vertical layout is used anyway.
1818 'p' Use Pointer callbacks for X11 GUI. This is required for some
1819 window managers. If the cursor is not blinking or hollow at
1820 the right moment, try adding this flag. This must be done
1821 before starting the GUI. Set it in your gvimrc. Adding or
1822 removing it after the GUI has started has no effect.
1824 *'guipty'* *'noguipty'*
1825 'guipty' boolean (default on)
1828 {only available when compiled with GUI enabled}
1829 Only in the GUI: If on, an attempt is made to open a pseudo-tty for
1830 I/O to/from shell commands. See |gui-pty|.
1833 'helpfile' 'hf' string (default (MSDOS) "$VIMRUNTIME\doc\help.txt"
1834 (others) "$VIMRUNTIME/doc/help.txt")
1837 Name of the help file. All help files should be placed together in
1838 one directory. Environment variables are expanded |:set_env|. For
1839 example: "$VIMRUNTIME/doc/help.txt". If $VIMRUNTIME is not set, $VIM
1840 is also tried. Also see |$VIMRUNTIME| and |option-backslash|
1841 about including spaces and backslashes.
1843 *'helpheight'* *'hh'*
1844 'helpheight' 'hh' number (default 20)
1847 Minimal initial height of the help window when it is opened with the
1848 ":help" command. The initial height of the help window is half of the
1849 current window, or (when the 'ea' option is on) the same as other
1850 windows. When the height is less than 'helpheight', the height is
1851 set to 'helpheight'. Set to zero to disable.
1853 *'hidden'* *'hid'* *'nohidden'* *'nohid'*
1854 'hidden' 'hid' boolean (default off)
1857 When off a buffer is unloaded when it is |abandon|ed. When on a
1858 buffer becomes hidden when it is |abandon|ed. If the buffer is still
1859 displayed in another window, it does not become hidden, of course.
1860 The commands that move through the buffer list sometimes make a buffer
1861 hidden although the 'hidden' option is off: When the buffer is
1862 modified, 'autowrite' is off or writing is not possible, and the '!'
1863 flag was used. See also |windows.txt|.
1864 WARNING: It's easy to forget that you have changes in hidden buffers.
1865 Think twice when using ":q!" or ":qa!".
1867 *'highlight'* *'hl'*
1868 'highlight' 'hl' string (default (as a single string):
1869 "8:SpecialKey,@:NonText,d:Directory,
1870 e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,
1871 M:ModeMsg,n:LineNr,r:Question,
1872 s:StatusLine,S:StatusLineNC,t:Title,
1873 v:Visual,w:WarningMsg,W:WildMenu")
1876 This option can be used to set highlighting mode for various
1877 occasions. It is a comma separated list of character pairs. The
1878 first character in a pair gives the occasion, the second the mode to
1879 use for that occasion. The occasions are:
1880 |hl-SpecialKey| 8 Meta and special keys listed with ":map"
1881 |hl-NonText| @ '~' and '@' at the end of the window and
1882 characters from 'showbreak'
1883 |hl-Directory| d directories in CTRL-D listing and other special
1885 |hl-ErrorMsg| e error messages
1886 h (obsolete, ignored)
1887 |hl-IncSearch| i 'incsearch' highlighting
1888 |hl-Search| l last search pattern highlighting (see 'hlsearch')
1889 |hl-MoreMsg| m |more-prompt|
1890 |hl-ModeMsg| M Mode (e.g., "-- INSERT --")
1891 |hl-LineNr| n line number for ":number" and ":#" commands
1892 |hl-Question| r |hit-return| prompt and yes/no questions
1893 |hl-StatusLine| s status line of current window |status-line|
1894 |hl-StatusLineNC| S status lines of not-current windows
1895 |hl-Title| t Titles for output from ":set all", ":autocmd" etc.
1896 |hl-Visual| v Visual mode
1897 |hl-VisualNOS| V Visual mode when Vim does is "Not Owning the
1898 Selection" Only X11 Gui's |gui-x11| and
1900 |hl-WarningMsg| w warning messages
1901 |hl-WildMenu| W wildcard matches displayed for 'wildmenu'
1903 The display modes are:
1904 r reverse (termcap entry "mr" and "me")
1905 i italic (termcap entry "ZH" and "ZR")
1906 b bold (termcap entry "md" and "me")
1907 s standout (termcap entry "so" and "se")
1908 u underline (termcap entry "us" and "ue")
1911 : use a highlight group
1912 The default is used for occasions that are not included.
1913 If you want to change what the display modes do, see |dos-colors|
1915 When using the ':' display mode, this must be followed by the name of
1916 a highlight group. A highlight group can be used to define any type
1917 of highlighting, including using color. See |:highlight| on how to
1918 define one. The default uses a different group for each occasion.
1919 See |highlight-default| for the default highlight groups.
1921 *'hlsearch'* *'hls'* *'nohlsearch'* *'nohls'*
1922 'hlsearch' 'hls' boolean (default off)
1925 {not available when compiled without the
1926 |+extra_search| feature}
1927 When there is a previous search pattern, highlight all its matches.
1928 The type of highlighting used can be set with the 'l' occasion in the
1929 'highlight' option. This uses the "Search" highlight group by
1930 default. Note that only the matching text is highlighted, any offsets
1932 See also: 'incsearch'.
1933 When you get bored looking at the highlighted matches, you can turn it
1934 off with |:nohlsearch|. As soon as you use a search command, the
1935 highlighting comes back.
1936 NOTE: This option is reset when 'compatible' is set.
1939 'history' 'hi' number (Vim default: 20, Vi default: 0)
1942 A history of ":" commands, and a history of previous search patterns
1943 are remembered. This option decides how many entries may be stored in
1944 each of these histories (see |cmdline-editing|).
1945 NOTE: This option is set to the Vi default value when 'compatible' is
1946 set and to the Vim default value when 'compatible' is reset.
1948 *'hkmap'* *'hk'* *'nohkmap'* *'nohk'*
1949 'hkmap' 'hk' boolean (default off)
1952 {only available when compiled with the |+rightleft|
1954 When on, the keyboard is mapped for the Hebrew character set.
1955 Normally you would set 'allowrevins' and use CTRL-_ in insert mode to
1956 toggle this option. See |rightleft.txt|.
1957 NOTE: This option is reset when 'compatible' is set.
1959 *'hkmapp'* *'hkp'* *'nohkmapp'* *'nohkp'*
1960 'hkmapp' 'hkp' boolean (default off)
1963 {only available when compiled with the |+rightleft|
1965 When on, phonetic keyboard mapping is used. 'hkmap' must also be on.
1966 This is useful if you have a non-Hebrew keyboard.
1967 See |rightleft.txt|.
1968 NOTE: This option is reset when 'compatible' is set.
1971 'icon' boolean (default off, on when title can be restored)
1974 {not available when compiled without the |+title|
1976 When on, the icon text of the window will be set to the value of
1977 'iconstring' (if it is not empty), or to the name of the file
1978 currently being edited. Only the last part of the name is used.
1979 Overridden by the 'iconstring' option.
1980 Only works if the terminal supports setting window icons (currently
1981 only X11 GUI and terminals with a non-empty 't_IS' option - these are
1982 Unix xterm and iris-ansi by default, where 't_IS' is taken from the
1984 When Vim was compiled with HAVE_X11 defined, the original icon will be
1985 restored if possible |X11|. See |X11-icon| for changing the icon on
1989 'iconstring' string (default "")
1992 {not available when compiled without the |+title|
1994 When this option is not empty, it will be used for the icon text of
1995 the window. This happens only when the 'icon' option is on.
1996 Only works if the terminal supports setting window icon text
1997 (currently only X11 GUI and terminals with a non-empty 't_IS' option).
1998 Does not work for MS Windows.
1999 When Vim was compiled with HAVE_X11 defined, the original icon will be
2000 restored if possible |X11|.
2001 When this option contains printf-style '%' items, they will be
2002 expanded according to the rules used for 'statusline'. See
2003 'titlestring' for example settings.
2004 {not available when compiled without the |+statusline| feature}
2006 *'ignorecase'* *'ic'* *'noignorecase'* *'noic'*
2007 'ignorecase' 'ic' boolean (default off)
2009 Ignore case in search patterns. Also used when searching in the tags
2010 file. Also see 'smartcase'.
2013 'include' 'inc' string (default "^#\s*include")
2016 Pattern to be used to find an include command. It is a search
2017 pattern, just like for the "/" command (See |pattern|). The default
2018 value is for C programs. This option is used for the commands "[i",
2019 "]I", "[d", etc.. The 'isfname' option is used to recognize the file
2020 name that comes after the matched pattern. See |option-backslash|
2021 about including spaces and backslashes.
2023 *'incsearch'* *'is'* *'noincsearch'* *'nois'*
2024 'incsearch' 'is' boolean (default off)
2027 {not available when compiled without the
2028 |+extra_search| feature}
2029 While typing a search pattern, show immediately where the so far
2030 typed pattern matches. The matched string is highlighted. If the
2031 pattern is invalid or not found, nothing is shown. The screen will
2032 be updated often, this is only useful on fast terminals. Note that
2033 the match will be shown, but the cursor is not actually positioned
2034 there. You still need to finish the search command with <CR> to move
2035 the cursor. The highlighting can be set with the 'i' flag in
2036 'highlight'. See also: 'hlsearch'.
2037 NOTE: This option is reset when 'compatible' is set.
2039 *'infercase'* *'inf'* *'noinfercase'* *'noinf'*
2040 'infercase' 'inf' boolean (default off)
2043 When doing keyword completion in insert mode |ins-completion|, and
2044 'ignorecase' is also on, the case of the match is adjusted. If the
2045 typed text contains a lowercase letter where the match has an upper
2046 case letter, the completed part is made lower case. If the typed text
2047 has no lower case letters and the match has a lower case letter where
2048 the typed text has an upper case letter, and there is a letter before
2049 it, the completed part is made uppercase.
2051 *'insertmode'* *'im'* *'noinsertmode'* *'noim'*
2052 'insertmode' 'im' boolean (default off)
2055 Makes Vim work in a way that Insert mode is the default mode. Useful
2056 if you want to use Vim as a modeless editor.
2057 These Insert mode commands will be useful:
2058 - Use the cursor keys to move around.
2059 - Use CTRL-O to execute one Normal mode command |i_CTRL-O|). When
2060 this is a mapping, it is executed as if 'insertmode' was off.
2061 Normal mode remains active until the mapping is finished.
2063 - Use CTRL-L to execute a number of Normal mode commands, then use
2064 <Esc> to get back to Insert mode.
2066 These items change when 'insertmode' is set:
2067 - when starting to edit of a file, Vim goes to Insert mode.
2068 - <Esc> in Insert mode is a no-op and beeps.
2069 - <Esc> in Normal mode makes Vim go to Insert mode.
2070 - CTRL-L in Insert mode is a command, it is not inserted.
2071 - CTRL-Z in Insert mode suspends Vim, see |CTRL-Z|. *i_CTRL-Z*
2072 However, when <Esc> is used inside a mapping, it behaves like
2073 'insertmode' was not set. This was done to be able to use the same
2074 mappings with 'insertmode' set or not set.
2076 NOTE: This option is reset when 'compatible' is set.
2079 'isfname' 'isf' string (default for MS-DOS, Win32 and OS/2:
2080 "@,48-57,/,.,-,_,+,,,$,:,!,\"
2081 for AMIGA: "@,48-57,/,.,-,_,+,,,$,:"
2082 otherwise: "@,48-57,/,.,-,_,+,,,$,~")
2085 The characters given by this option are included in file names and
2086 path names. Filenames are used for commands like "gf", "[i" and in
2087 the tags file. It is also used for "\f" in a |pattern|.
2088 Besides the characters in this option characters that are defined by
2089 the C function isalpha() are also always included (this depends on the
2090 character set and "locale").
2092 Note that on systems using a backslash as path separator, Vim tries to
2093 do its best to make it work as you would expect. That is a bit
2094 tricky, since Vi originally used the backslash to escape special
2095 characters. Vim on will not remove a backslash in front of a normal
2096 file name character on these systems, but it will on Unix and alikes.
2098 The format of this option is a list of parts, separated with commas.
2099 Each part can be a single character number or a range. A range is two
2100 character numbers with '-' in between. A character number can be a
2101 decimal number between 0 and 255 or the ASCII character itself (does
2102 not work for digits). Example:
2103 "_,-,128-140,#-43" (include '_' and '-' and the range
2104 128 to 140 and '#' to 43)
2105 If a part starts with '^', the following character number or range
2106 will be excluded from the option. The option is interpreted from left
2107 to right. Put the excluded character after the range where it is
2108 included. To include '^' itself use it as the last character of the
2109 option or the end of a range. Example:
2110 "^a-z,#,^" (exclude 'a' to 'z', include '#' and '^')
2111 If the character is '@', all characters where isalpha() returns TRUE
2112 are included. Normally these are the characters a to z and A to Z,
2113 plus accented characters. To include '@' itself use "@-@". Examples:
2114 "@,^a-z" All alphabetic characters, excluding lower
2116 "a-z,A-Z,@-@" All letters plus the '@' character.
2117 A comma can be included by using it where a character number is
2119 "48-57,,,_" Digits, command and underscore.
2120 A comma can be excluded by prepending a '^'. Example:
2121 " -~,^,,9" All characters from space to '~', excluding
2123 See |option-backslash| about including spaces and backslashes.
2126 'isident' 'isi' string (default for MS-DOS, Win32 and OS/2:
2127 "@,48-57,_,128-167,224-235"
2128 otherwise: "@,48-57,_,192-255")
2131 The characters given by this option are included in identifiers.
2132 Identifiers are used in recognizing environment variables and after a
2133 match of the 'define' option. It is also used for "\i" in a
2134 |pattern|. See 'isfname' for a description of the format of this
2136 Careful: If you change this option, it might break expanding
2137 environment variables. E.g., when '/' is included and Vim tries to
2138 expand "$HOME/.viminfo". Maybe you should change 'iskeyword' instead.
2140 *'iskeyword'* *'isk'*
2141 'iskeyword' 'isk' string (Vim default for MS-DOS and Win32:
2142 "@,48-57,_,128-167,224-235"
2143 otherwise: "@,48-57,_,192-255"
2144 Vi default: "@,48-57,_")
2147 Keywords are used in searching and recognizing with many commands:
2148 "w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See
2149 'isfname' for a description of the format of this option. For C
2150 programs you could use "a-z,A-Z,48-57,_,.,-,>".
2151 For a help file it is set to all non-blank printable characters except
2152 '*', '"' and '|' (so that CTRL-] on a command finds the help for that
2154 When the 'lisp' option is on the '-' character is always included.
2155 NOTE: This option is set to the Vi default value when 'compatible' is
2156 set and to the Vim default value when 'compatible' is reset.
2159 'isprint' 'isp' string (default for MS-DOS, Win32, OS/2 and Macintosh:
2160 "@,~-255"; otherwise: "@,161-255")
2163 The characters given by this option are displayed directly on the
2164 screen. It is also used for "\p" in a |pattern|. The characters from
2165 space (ascii 32) to '~' (ascii 126) are always displayed directly,
2166 even when they are not included in 'isprint' or excluded. See
2167 'isfname' for a description of the format of this option.
2168 Non-printable characters are displayed with two characters:
2170 32 - 126 always single characters
2172 128 - 159 "~@" - "~_"
2173 160 - 254 "| " - "|~"
2176 *'joinspaces'* *'js'* *'nojoinspaces'* *'nojs'*
2177 'joinspaces' 'js' boolean (default on)
2180 Insert two spaces after a '.', '?' and '!' with a join command.
2181 When 'cpoptions' includes the 'j' flag, only do this after a '.'.
2182 Otherwise only one space is inserted.
2183 NOTE: This option is set when 'compatible' is set.
2186 'key' string (default "")
2189 The key that is used for encrypting and decrypting the current buffer.
2191 Careful: Do not set the key value by hand, someone might see the typed
2192 key. Use the |:X| command. But you can make 'key' empty:
2194 It is not possible to get the value of this option with ":set key" or
2195 "echo &key". This is to avoid showing it to someone who shouldn't
2196 know. It also means you cannot see it yourself once you have set it,
2197 be careful not to make a typing error!
2200 'keymodel' 'km' string (default "")
2203 List of comma separated words, which enable special things that keys
2204 can do. These values can be used:
2205 startsel Using a shifted special key starts selection (either
2206 Select mode or Visual mode, depending on "key" being
2207 present in 'selectmode').
2208 stopsel Using a not-shifted special key stops selection.
2209 Special keys in this context are the cursor keys, <End>, <Home>,
2210 <PageUp> and <PageDown>.
2211 The 'keymodel' option is set by the |:behave| command.
2213 *'keywordprg'* *'kp'*
2214 'keywordprg' 'kp' string (default "man" or "man -s", DOS: "",
2215 OS/2: "view /", VMS: "help")
2218 Program to use for the |K| command. Environment variables are
2219 expanded |:set_env|. When empty ":help" is used.
2220 When "man" is used, Vim will automatically translate a count for the
2221 "K" command to a section number. Also for "man -s", in which case the
2222 "-s" is removed when there is no count.
2223 See |option-backslash| about including spaces and backslashes.
2225 > :set keywordprg=man\ -s
2226 When this option is set from a |modeline|, while the 'secure' option
2227 is set, you will get a warning message.
2229 *'langmap'* *'lmap'*
2230 'langmap' 'lmap' string (default "")
2233 {only available when compiled with the |+langmap|
2235 This option allows support for keyboards that have a mode for a
2236 special language. The idea is that when you are typing text in Insert
2237 mode your keyboard is switched in the special language mode, you get
2238 different key codes for the special characters. When in command mode
2239 the 'langmap' option takes care of translating these special
2240 characters to the original meaning of the key. This means you don't
2241 have to change the keyboard mode to be able to execute normal mode
2244 Example (for greek): *greek*
2245 > :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
2246 Example (exchanges meaning of z and y for commands):
2247 > :set langmap=zy,yz,ZY,YZ
2249 The 'langmap' option is a list of parts, separated with commas. Each
2250 part can be in one of two forms:
2251 1. A list of pairs. Each pair is a "from" character immediately
2252 followed by the "to" character. Examples: "aA", "aAbBcC".
2253 2. A list of "from" characters, a semi-colon and a list of "to"
2254 characters. Example: "abc;ABC"
2255 Example: "aA,fgh;FGH,cCdDeE"
2256 Special characters need to be preceded with a backslash. These are
2257 ";", ',' and backslash itself.
2259 This will allow you to activate vim actions without having to switch
2260 back and forth between the languages. Your language characters will
2261 be understood as normal vim English characters (according to the
2262 langmap mappings) in the following cases:
2263 o Normal/Visual mode (commands, buffer/register names, user mappings)
2264 o Insert/Replace Mode: Register names after CTRL-R
2265 o Insert/Replace Mode: Mappings
2266 Characters entered in Command-line mode will NOT be affected by
2267 this option. Note that this option can be changed at any time
2268 allowing to switch between mappings for different languages/encodings.
2269 Use a mapping to avoid having to type it each time!
2271 *'laststatus'* *'ls'*
2272 'laststatus' 'ls' number (default 1)
2275 The value of this option influences when the last window will have a
2278 1: only if there are at least two windows
2280 The screen looks nicer with a status line if you have several
2281 windows, but it takes another screen line. |status-line|
2283 *'lazyredraw'* *'lz'* *'nolazyredraw'* *'nolz'*
2284 'lazyredraw' 'lz' boolean (default off)
2287 When this option is set, the screen will not be redrawn while
2288 executing macros, registers and other commands that have not been
2291 *'linebreak'* *'lbr'* *'nolinebreak'* *'nolbr'*
2292 'linebreak' 'lbr' boolean (default off)
2295 {not available when compiled without the |+linebreak|
2297 If on Vim will wrap long lines at a character in 'breakat' rather
2298 than at the last character that fits on the screen. Unlike
2299 'wrapmargin' and 'textwidth', this does not insert <EOL>s in the file,
2300 it only affects the way the file is displayed, not its contents. The
2301 value of 'showbreak' is used to put in front of wrapped lines. This
2302 option is not used when the 'wrap' option is off. Note that <Tab>
2303 characters after an <EOL> are mostly not displayed correctly.
2306 'lines' number (default 24 or terminal height)
2308 Number of lines in the display. Normally you don't need to set this.
2309 That is done automatically by the terminal initialization code.
2310 When Vim is running in the GUI or in a resizable window, setting this
2311 option may cause the window size to be changed.
2312 When you set this option and Vim is unable to change the physical
2313 number of lines of the display, the display may be messed up.
2316 'lisp' boolean (default off)
2318 {not available when compiled without the |+lispindent|
2320 Lisp mode: When a return is typed in insert mode set the indent for
2321 the next line to Lisp standards (well, sort of). Also happens with
2322 "cc" or "S". 'autoindent' must also be on for this to work. The 'p'
2323 flag in 'cpoptions' changes the method of indenting: Vi compatible or
2325 The '-' character is included in keyword characters. Redefines the
2326 "=" operator to use this same indentation algorithm rather than
2327 calling an external program if 'equalprg' is empty. This option is
2328 reset when 'paste' is set. {Vi: Does it a little bit differently}
2331 'list' boolean (default off)
2333 List mode: Show tabs as CTRL-I, show end of line with $. Useful to
2334 see the difference between tabs and spaces and for trailing blanks.
2335 Note that this will also affect formatting (set with 'textwidth' or
2336 'wrapmargin') when 'cpoptions' includes 'L'. See 'listchars' for
2337 changing the way tabs are displayed.
2339 *'listchars'* *'lcs'*
2340 'listchars' 'lcs' string (default "eol:$")
2343 Strings to use in 'list' mode. It is a comma separated list of string
2345 eol:c Character to show at the end of each line. When
2346 omitted, there is no extra character at the end of the
2348 tab:xy Two characters to be used to show a Tab. The first
2349 char is used once. The second char is repeated to
2350 fill the space that the Tab normally occupies.
2351 "tab:>-" will show a Tab that takes four spaces as
2352 ">---". When omitted, a Tab is show as ^I.
2353 trail:c Character to show for trailing spaces. When omitted,
2354 trailing spaces are blank.
2355 extends:c Character to show in the last column, when 'wrap' is
2356 off and the line continues beyond the right of the
2358 The characters ':' and ',' cannot be used.
2360 > :set lcs=tab:>-,trail:-
2361 > :set lcs=tab:>-,eol:<
2362 The "NonText" highlighting will be used for these characters.
2364 *'magic'* *'nomagic'*
2365 'magic' boolean (default on)
2367 Changes the special characters that can be used in search patterns.
2368 See |pattern|. NOTE: To avoid portability problems with using
2369 patterns, always keep this option at the default "on".
2372 'makeef' 'mef' string (Amiga default: "t:vim##.Err",
2373 Unix: "/tmp/vim##.err",
2374 others: "vim##.err")
2377 {not available when compiled without the |+quickfix|
2379 Name of the errorfile for the |:make| command (see |:make_makeprg|)
2380 and the |:grep| command.
2381 When "##" is included, it is replaced by a number to make the name
2382 unique. This makes sure that the ":make" command doesn't overwrite an
2384 NOT used for the ":cf" command. See 'errorfile' for that.
2385 Environment variables are expanded |:set_env|.
2386 See |option-backslash| about including spaces and backslashes.
2389 'makeprg' 'mp' string (default "make")
2392 Program to use for the ":make" command. See |:make_makeprg|. This
2393 option may contain '%' and '#' characters, which are expanded like
2394 when used in a command-line. Environment variables are expanded
2395 |:set_env|. See |option-backslash| about including spaces and
2396 backslashes. Note that a '|' must be escaped twice: once for ":set"
2397 and once for the interpretation of a command. When you use a filter
2398 called "myfilter" do it like this:
2399 > :set makeprg=gmake\ \\\|\ myfilter
2400 The placeholder "$*" can be given (even multiple times) to specify
2401 where the arguments will be included, for example:
2402 > :set makeprg=latex\ \\\\nonstopmode\ \\\\input\\{$*}
2403 When this option is set from a |modeline|, while the 'secure' option
2404 is set, you will get a warning message.
2406 *'matchpairs'* *'mps'*
2407 'matchpairs' 'mps' string (default "(:),{:},[:]")
2410 Characters that form pairs. The |%| command jumps from one to the
2411 other. Currently only single character pairs are allowed, and they
2412 must be different. The characters must be separated by a colon. The
2413 pairs must be separated by a comma. Example for including '<' and '>'
2416 A more exotic example, to jump between the '=' and ';' in an
2417 assignment, useful for languages like C and Java:
2418 > au FileType c,cpp,java set mps+==:;
2420 *'matchtime'* *'mat'*
2421 'matchtime' 'mat' number (default 5)
2424 Tenths of a second to show the matching paren, when 'showmatch' is
2425 set. Note that this is not in milliseconds, like other options that
2426 set a time. This is to be compatible with Nvi.
2428 *'maxfuncdepth'* *'mfd'*
2429 'maxfuncdepth' 'mfd' number (default 100)
2432 Maximum depth of function calls for user functions. This normally
2433 catches endless recursion. When using a recursive function with
2434 more depth, set 'maxfuncdepth' to a bigger number. But this will use
2435 more memory, there is the danger of failing when memory is exhausted.
2436 See also |:function|.
2438 *'maxmapdepth'* *'mmd'*
2439 'maxmapdepth' 'mmd' number (default 1000)
2442 Maximum number of times a mapping is done without resulting in a
2443 character to be used. This normally catches endless mappings, like
2444 ":map x y" with ":map y x". It still does not catch ":map g wg",
2445 because the 'w' is used before the next mapping is done. See also
2449 'maxmem' 'mm' number (default 512)
2452 Maximum amount of memory (in Kbyte) to use for one buffer. When this
2453 limit is reached allocating extra memory for a buffer will cause
2454 other memory to be freed. Maximum value 2000000. Use this to work
2455 without a limit. Also see 'maxmemtot'.
2457 *'maxmemtot'* *'mmt'*
2458 'maxmemtot' 'mmt' number (default 2048, or half the amount of memory
2462 Maximum amount of memory (in Kbyte) to use for all buffers together.
2463 Maximum value 2000000. Use this to work without a limit. Also see
2466 *'modeline'* *'ml'* *'nomodeline'* *'noml'*
2467 'modeline' 'ml' boolean (Vim default: on, Vi default: off)
2469 *'modelines'* *'mls'*
2470 'modelines' 'mls' number (default 5)
2473 If 'modeline' is on 'modelines' gives the number of lines that is
2474 checked for set commands. If 'modeline' is off or 'modelines' is zero
2475 no lines are checked. See |modeline|.
2476 NOTE: 'modeline' is set to the Vi default value when 'compatible' is
2477 set and to the Vim default value when 'compatible' is reset.
2479 *'modified'* *'mod'* *'nomodified'* *'nomod'*
2480 'modified' 'mod' boolean (default off)
2483 When on the buffer is considered to be modified. This option is set
2484 by every command that makes a change to the buffer. Only the undo
2485 command may reset it, when all changes have been undone.
2488 'more' boolean (Vim default: on, Vi default: off)
2491 When on, listings pause when the whole screen is filled. You will get
2492 the |more-prompt|. When this option is off there are no pauses, the
2493 listing continues until finished.
2494 NOTE: This option is set to the Vi default value when 'compatible' is
2495 set and to the Vim default value when 'compatible' is reset.
2498 'mouse' string (default "", "a" for GUI, MS-DOS and Win32)
2501 Enable the use of the mouse. Only works for certain terminals
2502 (xterm, MS-DOS, Win32 |win32-mouse| and Linux console with gpm). For
2503 using the mouse in the GUI, see |gui-mouse|.
2504 The mouse can be enabled for different modes:
2509 h all previous modes when editing a help file
2510 a all previous modes
2511 r for |hit-return| and |more-prompt| prompt
2512 Normally you would enable the mouse in all four modes with:
2514 When the mouse is not enabled, the GUI will still use the mouse for
2515 modeless selection. This doesn't move the text cursor.
2517 See |mouse-using|. Also see |'clipboard'|.
2519 Note: When enabling the mouse in an xterm, GUI copy/paste will be used
2520 if there is access to an X-server. The xterm copy/paste can still be
2521 used by keeping the shift key pressed. The GUI copy/paste only works
2522 in Normal, Visual and Insert mode. This setting is suggested to allow
2523 normal xterm selection in Command-line mode:
2525 Also see the 'clipboard' option.
2527 *'mousefocus'* *'mousef'* *'nomousefocus'* *'nomousef'*
2528 'mousefocus' 'mousef' boolean (default off)
2531 {only works in the GUI}
2532 The window that the mouse pointer is on is automatically activated.
2533 When changing the window layout or window focus in another way, the
2534 mouse pointer is moved to the window with keyboard focus. Off is the
2535 default because it makes using the pull down menus a little goofy, as
2536 a pointer transit may activate a window unintentionally.
2538 *'mousehide'* *'mh'* *'nomousehide'* *'nomh'*
2539 'mousehide' 'mh' boolean (default off)
2542 {only works in the GUI}
2543 When on, the mouse pointer is hidden when characters are typed.
2544 The mouse pointer is restored when the mouse is moved.
2546 *'mousemodel'* *'mousem'*
2547 'mousemodel' 'mousem' string (default "extend", "popup" for MS-DOS and Win32)
2550 Sets the model to use for the mouse. The name mostly specifies what
2551 the right mouse button is used for:
2552 extend Right mouse button extends a selection. This works
2554 popup Right mouse button pops up a menu. The shifted left
2555 mouse button extends a selection. This works like
2556 with Microsoft Windows
2557 popup_setpos Like "popup", but the cursor will be moved to the
2558 position where the mouse was clicked, and thus the
2559 selected operation will act upon the clicked object.
2560 If clicking inside a selection, that selection will
2561 be acted upon, ie. no cursor move. This implies of
2562 course, that right clicking outside a selection will
2564 Overview of what button does what for each model:
2565 mouse extend popup(_setpos) ~
2566 left click place cursor place cursor
2567 left drag start selection start selection
2568 shift-left search word extend selection
2569 right click extend selection popup menu (place cursor)
2570 right drag extend selection -
2571 middle click paste paste
2573 In the "popup" model the right mouse button produces a pop-up menu.
2574 You need to define this first, see |popup-menu|.
2576 Note that you can further refine the meaning of buttons with mappings.
2577 See |gui-mouse-mapping|. But mappings are NOT used for modeless
2578 selection (because that's handled in the GUI code directly).
2580 The 'mousemodel' option is set by the |:behave| command.
2582 *'mousetime'* *'mouset'*
2583 'mousetime' 'mouset' number (default 500)
2586 Only for GUI, MS-DOS, Win32 and Unix with xterm. Defines the maximum
2587 time in msec between two mouse clicks for the second click to be
2588 recognized as a multi click.
2590 *'nrformats'* *'nf'*
2591 'nrformats' 'nf' string (default "octal,hex")
2594 This defines what bases Vim will consider for numbers when using the
2595 CTRL-A and CTRL-X commands for adding to and subtracting from a number
2596 respectively; see |CTRL-A| for more info on these commands.
2597 If "octal" is included, numbers that start with a zero will be
2598 considered to be octal. Example: Using CTRL-A on "007" results in
2600 If "hex" is included, numbers starting with "0x" or "0X" will be
2601 considered to be hexadecimal. Example: Using CTRL-X on "0x100"
2603 Numbers which simply begin with a digit in the range 1-9 are always
2604 considered decimal. This also happens for numbers that are not
2605 recognized as octal or hex.
2607 *'number'* *'nu'* *'nonumber'* *'nonu'*
2608 'number' 'nu' boolean (default off)
2610 Print the line number in front of each line. Tip: If you don't like
2611 wrapping lines to mix with the line numbers, set the 'showbreak'
2612 option to eight spaces:
2613 :set showbreak=\ \ \ \ \ \ \ \
2614 See |hl-LineNr| for the highlighting used for the number.
2616 *'osfiletype'* *'oft'*
2617 'osfiletype' 'oft' string (RISC OS default: "Text",
2621 {only available when compiled with the |+osfiletype|
2623 Some operating systems store extra information about files besides
2624 name, datastamp and permissions. This option contains the extra
2625 information, the nature of which will vary between systems.
2626 The value of this option is usually set when the file is loaded, and
2627 use to set the file type when file is written.
2628 It can affect the pattern matching of the automatic commands.
2629 |autocmd-osfiletypes|
2631 *'paragraphs'* *'para'*
2632 'paragraphs' 'para' string (default "IPLPPPQPP LIpplpipbp")
2634 Specifies the nroff macros that separate paragraphs. These are pairs
2635 of two letters (see |object-motions|).
2637 *'paste'* *'nopaste'*
2638 'paste' boolean (default off)
2641 Put Vim in Paste mode. This is useful if you want to cut or copy
2642 some text from one window and paste it in Vim. This will avoid
2644 Setting this option is useful when using Vim in a terminal, where Vim
2645 cannot distinguish between typed text and pasted text. In the GUI, Vim
2646 knows about pasting and will mostly do the right thing without 'paste'
2647 being set. Also in a terminal where Vim handles the mouse clicks
2649 When the 'paste' option is switched on (also when it was already on):
2650 - mapping in Insert mode and Command-line mode is disabled
2651 - abbreviations are disabled
2652 - 'textwidth' is set to 0
2653 - 'wrapmargin' is set to 0
2654 - 'autoindent' is reset
2655 - 'smartindent' is reset
2656 - 'cindent' is reset
2657 - 'softtabstop' is set to 0
2661 - 'showmatch' is reset
2662 - 'formatoptions' is used like it is empty
2663 NOTE: When you start editing another file while the 'paste' option is
2664 on, settings from the modelines or autocommands may change the
2665 settings again, causing trouble when pasting text. You might want to
2666 set the 'paste' option again.
2667 When the 'paste' option is reset the mentioned options are restored to
2668 the value before the moment 'paste' was switched from off to on.
2669 Resetting 'paste' before ever setting it does not have any effect.
2670 Since mapping doesn't work while 'paste' is active, you need to use
2671 the 'pastetoggle' option to toggle the 'paste' option with some key.
2673 *'pastetoggle'* *'pt'*
2674 'pastetoggle' 'pt' string (default "")
2677 When non-empty, specifies the key sequence that toggles the 'paste'
2678 option. This is like specifying a mapping:
2679 > map {keys} :set invpaste<CR>
2680 Where {keys} is the value of 'pastetoggle'.
2681 The difference is that it will work even when 'paste' is set.
2682 'pastetoggle' works in Insert mode and Normal mode, but not in
2684 Mappings are checked first, thus overrule 'pastetoggle'. However,
2685 when 'paste' is on mappings are ignored in Insert mode, thus you can do
2687 > map <F10> :set paste<CR>
2688 > map <F11> :set nopaste<CR>
2689 > imap <F10> <C-O>:set paste<CR>
2691 > set pastetoggle=<F11>
2692 This will make <F10> start paste mode and <F11> stop paste mode.
2693 Note that typing <F10> in paste mode inserts "<F10>", since in paste
2694 mode everything is inserted literally, except the 'pasttoggle' key
2697 *'patchmode'* *'pm'*
2698 'patchmode' 'pm' string (default "")
2701 When non-empty the oldest version of a file is kept. This can be used
2702 to keep the original version of a file if you are changing files in a
2703 source distribution. Only the first time that a file is edited a copy
2704 of the original file will be kept. The name of the copy is the name
2705 of the original file with the string in the 'patchmode' option
2706 appended. This option should start with a dot. Use a string like
2707 ".org". 'backupdir' must not be empty for this to work (Detail: The
2708 backup file is renamed to the patchmode file after the new file has
2709 been successfully written, that's why it must be possible to write a
2710 backup file). If there was no file to be backed up, an empty file is
2714 'path' 'pa' string (default on Unix: ".,/usr/include,,"
2715 on OS/2: ".,/emx/include,,"
2716 other systems: ".,,")
2719 This is a list of directories which will be searched when using the
2720 |gf|, [f, ]f, ^Wf, |:find| and other commands, provided that the file
2721 being searched for has a relative path (not starting with '/'). The
2722 directories in the 'path' option may be relative or absolute.
2723 - Use commas to separate directory names:
2724 > :set path=.,/usr/local/include,/usr/include
2725 - Spaces can also be used to separate directory names (for backwards
2726 compatibility with version 3.0). To have a space in a directory
2727 name, precede it with an extra backslash, and escape the space:
2728 > :set path=.,/dir/with\\\ space
2729 - To include a comma in a directory name precede it with an extra
2731 > :set path=.,/dir/with\\,comma
2732 - To search relative to the directory of the current file, use:
2734 - To search in the current directory use an empty string between two
2737 - A directory name may end in a ':' or '/'.
2738 - Environment variables are expanded |:set_env|.
2739 - Use wildcards to specify directories more freely, e.g.,
2740 > :set path=/usr/include/*
2741 means all subdirectories in /usr/include (but not /usr/include
2743 - Use '**' if you want the whole subtree to be searched:
2744 > :set path=/home/user_x/src/**
2745 means search in the whole subtree under "/home/usr_x/src". (to avoid
2746 endless recursion, the depth is restricted to 100 levels)
2747 - Give wildcards and recursions in any order:
2748 > :set path=/**/include/**
2749 specifies a path with at least one directory /include/ in it.
2750 - The set of allowed wildcards and the possible usage depend on the
2751 operating system, but /etc/*/etc and /etc/**/etc work on any
2753 - Careful with '\' characters, type two to get one in the option:
2754 > :set path=.,c:\\include
2755 Or just use '/' instead:
2756 > :set path=.,c:/include
2757 Don't forget "." or files won't even be found in the same directory as
2759 The maximum length is limited. How much depends on the system, mostly
2760 it is something like 256 or 1024 characters.
2761 You can check if all the include files are found, using the value of
2762 'path', see |:checkpath|.
2763 The use of |:set+=| and |:set-=| is preferred when adding or removing
2764 directories from the list. This avoids problems when a future version
2765 uses another default. To remove the current directory use:
2767 To add the current directory use:
2769 To use an environment variable, you probably need to replace the
2770 separator. Here is an example to append $INCL, in which directory
2771 names are separated with a semi-colon:
2772 > let &path = &path . "," . substitute($INCL, ';', ',', 'g')
2773 Replace the ';' with a ':' or whatever separator is used. Note that
2774 this doesn't work when $INCL contains a comma or white space.
2776 *'previewheight'* *'pvh'*
2777 'previewheight' 'pvh' number (default 12)
2780 Default height for a preview window. Used for |:ptag| and associated
2781 commands. Used for |CTRL-W_}| when no count is given.
2783 *'readonly'* *'ro'* *'noreadonly'* *'noro'*
2784 'readonly' 'ro' boolean (default off)
2787 If on, writes fail unless you use a '!'. Protects you from
2788 accidentally overwriting a file. Default on when Vim is started
2789 in read-only mode ("vim -R") or when the executable is called "view".
2790 {not in Vi:} When using the ":view" command the 'readonly' option is
2791 set for the newly edited buffer. When using ":w!" the 'readonly'
2792 option is reset for the current buffer.
2794 *'remap'* *'noremap'*
2795 'remap' boolean (default on)
2797 Allows for mappings to work recursively. If you do not want this for
2798 a single entry, use the :noremap[!] command.
2801 'report' number (default 2)
2803 Threshold for reporting number of lines changed. When the number of
2804 changed lines is more than 'report' a message will be given for most
2805 ":" commands. For the ":substitute" command the number of
2806 substitutions is used instead of the number of lines.
2808 *'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
2809 'restorescreen' 'rs' boolean (default on)
2811 {not in Vi} {Windows 95/NT version only}
2812 When set, the screen contents is restored when exiting Vim. This also
2813 happens when executing external commands.
2815 For non-Windows Vim: You can set or reset the 't_ti' and 't_te'
2816 options in your .vimrc. To disable restoring:
2818 To enable restoring (for an xterm):
2819 set t_ti=^[7^[[r^[[?47h t_te=^[[?47l^[8
2820 (Where ^[ is an <Esc>, type CTRL-V <Esc> to insert it)
2822 *'revins'* *'ri'* *'norevins'* *'nori'*
2823 'revins' 'ri' boolean (default off)
2826 {only available when compiled with the |+rightleft|
2828 Inserting characters in Insert mode will work backwards. See "typing
2829 backwards" |ins-reverse|. This option can be toggled with the CTRL-_
2830 command in Insert mode, when 'allowrevins' is set.
2831 NOTE: This option is reset when 'compatible' or 'paste' is set.
2833 *'rightleft'* *'rl'* *'norightleft'* *'norl'*
2834 'rightleft' 'rl' boolean (default off)
2837 {only available when compiled with the |+rightleft|
2839 When on, display orientation becomes right-to-left, i.e., character
2840 that are stored in the file appear from the right to the left. Using
2841 this option, it is possible to edit files for languages that are
2842 written from the right to the left such as Hebrew and Arabic. This
2843 option is per window, so it is possible to edit mixed files
2844 simultaneously, or to view the same file in both ways (this is
2845 sometimes useful when editing Hebrew TeX--XeT files). See
2848 *'ruler'* *'ru'* *'noruler'* *'noru'*
2849 'ruler' 'ru' boolean (default off)
2852 {not available when compiled without the
2853 |+cmdline_info| feature}
2854 Show the line and column number of the cursor position, separated by a
2855 comma. When there is room, the relative position of the displayed
2856 text in the file is shown on the far right:
2857 Top first line is visible
2858 Bot last line is visible
2859 All first and last line are visible
2860 45% relative position in the file
2861 If 'rulerformat' is set, it will determine the contents of the ruler.
2862 Each window has its own ruler. If a window has a status line, the
2863 ruler is shown there. Otherwise it is shown in the last line of the
2864 screen. If the statusline is given by 'statusline' (ie. not empty),
2865 this option takes precedence over 'ruler' and 'rulerformat'
2866 If there are characters in the line that take two positions on the
2867 screen, both the "real" column and the screen column are shown,
2868 separated with a dash.
2869 For an empty line "0-1" is shown.
2870 For an empty buffer the line number will also be zero: "0,0-1".
2871 This option is reset when the 'paste' option is set.
2872 If you don't want to see the ruler all the time but want to know where
2873 you are, use "g CTRL-G" |g_CTRL-G|.
2874 NOTE: This option is reset when 'compatible' is set.
2876 *'rulerformat'* *'ruf'*
2877 'rulerformat' 'ruf' string (default empty)
2880 {not available when compiled without the |+statusline|
2882 The format of this option, is like that of 'statusline'. When it is
2883 not empty it determines the content of the ruler string. If the
2884 option has a leading "%{wid}(", then {wid} determines the width of the
2885 ruler. The default ruler width is 17 characters.
2888 'scroll' 'scr' number (default 'lines' / 2)
2890 Number of lines to scroll with CTRL-U and CTRL-D commands. Will be
2891 set to half the number of lines in the window when the window size
2892 changes. If you give a count to the CTRL-U or CTRL-D command it will
2893 be used as the new value for 'scroll'. Reset to 'lines' / 2 with
2894 ":set scroll=0". {Vi is a bit different: 'scroll' gives the number
2895 of screen lines instead of file lines, makes a difference when lines
2898 *'scrollbind'* *'scb'* *'noscrollbind'* *'noscb'*
2899 'scrollbind' 'scb' boolean (default off)
2902 {not available when compiled without the |+scrollbind|
2904 See also |scroll-binding|. When this option is set, the current
2905 window scrolls as other scrollbind windows (windows that also have
2906 this option set) scroll. This option is useful for viewing the
2907 differences between two versions of a file. See |'scrollopt'| for
2908 options that determine how this option should be interpreted.
2910 *'scrolljump'* *'sj'*
2911 'scrolljump' 'sj' number (default 1)
2914 Minimal number of lines to scroll when the cursor gets off the
2915 screen (e.g., with "j"). Not used for scroll commands (e.g., CTRL-E,
2916 CTRL-D). Useful if your terminal scrolls very slowly.
2917 NOTE: This option is set to 1 when 'compatible' is set.
2919 *'scrolloff'* *'so'*
2920 'scrolloff' 'so' number (default 0)
2923 Minimal number of screen lines to keep above and below the cursor.
2924 This will make some context visible around where you are working. If
2925 you set it to a very large value (999) the cursor line will always be
2926 in the middle of the window (except at the start or end of the file or
2927 when long lines wrap).
2928 NOTE: This option is set to 0 when 'compatible' is set.
2930 *'scrollopt'* *'sbo'*
2931 'scrollopt' 'sbo' string (default "ver,jump")
2933 {not available when compiled without the |+scrollbind|
2936 This is a comma-separated list of words that specifies how
2937 'scrollbind' windows should behave.
2938 The following words are available:
2939 ver Bind vertical scrolling for 'scrollbind' windows
2940 hor Bind horizontal scrolling for 'scrollbind' windows
2941 jump Applies to the offset between two windows for vertical
2942 scrolling. This offset is the difference in the first
2943 displayed line of the bound windows. When moving
2944 around in a window, another 'scrollbind' window may
2945 reach a position before the start or after the end of
2946 the buffer. The offset is not changed though, when
2947 moving back the 'scrollbind' window will try to scroll
2948 to the desired position when possible.
2949 When now making that window the current one, two
2950 things can be done with the relative offset:
2951 1. When "jump" is not included, the relative offset is
2952 adjusted for the scroll position in the new current
2953 window. When going back to the other window, the
2954 the new relative offset will be used.
2955 2. When "jump" is included, the other windows are
2956 scrolled to keep the same relative offset. When
2957 going back to the other window, it still uses the
2958 same relative offset.
2959 Also see |scroll-binding|.
2961 *'sections'* *'sect'*
2962 'sections' 'sect' string (default "SHNHH HUnhsh")
2964 Specifies the nroff macros that separate sections. These are pairs of
2965 two letters (See |object-motions|). The default makes a section start
2966 at the nroff macros ".SH", ".NH", ".H", ".HU", ".nh" and ".sh".
2968 *'secure'* *'nosecure'*
2969 'secure' boolean (default off)
2972 When on, ":autocmd", shell and write commands are not allowed in
2973 ".vimrc" and ".exrc" in the current directory and map commands are
2974 displayed. Switch it off only if you know that you will not run into
2975 problems, or when the 'exrc' option is off. On Unix this option is
2976 only used if the ".vimrc" or ".exrc" is not owned by you. This can be
2977 dangerous if the systems allows users to do a "chown". You better set
2978 'secure' at the end of your ~/.vimrc then.
2979 This option cannot be set from a |modeline|.
2981 *'selection'* *'sel'*
2982 'selection' 'sel' string (default "inclusive")
2985 This option defines the behavior of the selection. It is only used
2986 in Visual and Select mode.
2988 value past line inclusive ~
2992 "past line" means that the cursor is allowed to be positioned one
2993 character past the line.
2994 "inclusive" means that the last character of the selection is included
2995 in an operation. For example, when "x" is used to delete the
2998 The 'selection' option is set by the |:behave| command.
3000 *'selectmode'* *'slm'*
3001 'selectmode' 'slm' string (default "")
3004 This is a comma separated list of words, which specifies when to start
3005 Select mode instead of Visual mode, when a selection is started.
3007 mouse when using the mouse
3008 key when using shifted special keys
3009 cmd when using "v", "V" or CTRL-V
3011 The 'selectmode' option is set by the |:behave| command.
3013 *'sessionoptions'* *'ssop'*
3014 'sessionoptions' 'ssop' string (default "buffers,winsize,options,help,blank")
3017 Changes the effect of the |:mksession| command. It is a comma
3018 separated list of words. Each word enables saving and restoring
3020 word save and restore ~
3021 buffers hidden and unloaded buffers, not just those in windows
3022 globals global variables that start with an uppercase letter
3023 and contain at least one lowercase letter.
3024 help the help window
3026 options options and mappings
3027 winpos position of the GUI vim window
3028 resize size of the screen: 'lines' and 'columns'
3029 winsize window sizes (where possible)
3030 slash backslashes in file names replaced with forward
3032 unix with Unix end-of-line format (single <NL>), even when
3035 "slash" and "unix" are useful on Windows when sharing session files
3036 with Unix. The Unix version of Vim cannot source dos format scripts,
3037 but the Windows version of Vim can source unix format scripts.
3040 'shell' 'sh' string (default $SHELL or "sh",
3041 MS-DOS and Win32: "command",
3044 Name of the shell to use for ! and :! commands. When changing the
3045 value also check the 'shelltype', 'shellpipe', 'shellslash' and
3046 'shellredir' options.
3047 It is allowed to give an argument to the command, e.g. "csh -f".
3048 See |option-backslash| about including spaces and backslashes.
3049 Environment variables are expanded |:set_env|.
3050 For Dos 32 bits (DJGPP), you can set the $DJSYSFLAGS environment
3051 variable to change the way external commands are executed. See the
3052 libc.inf file of DJGPP.
3053 If the name of the shell contains a space, you might need to enclose
3054 it in quotes. Example:
3055 > :set shell=\"c:\program\ files\unix\sh.exe\"\ -f
3056 Note the backslash before each quote (to avoid starting a comment) and
3057 each space (to avoid ending the option value). Also note that the
3058 "-f" is not inside the quotes, because it is not part of the command
3059 name. And Vim automagically recognizes the backslashes that are path
3061 Under MS-Windows, when the executable ends in ".com" it must be
3062 included. Thus setting the shell to "command.com" or "4dos.com"
3063 works, but "command" and "4dos" do not work for all commands (e.g.,
3065 For unknown reasons, when using "4dos.com" the current directory is
3066 changed to "C:\". To avoid this set 'shell' like this:
3067 > :set shell=command.com\ /c\ 4dos
3068 The 'shell' option cannot be set from a |modeline|.
3070 *'shellcmdflag'* *'shcf'*
3071 'shellcmdflag' 'shcf' string (default: "-c", MS-DOS and Win32, when 'shell'
3072 does not contain "sh" somewhere: "/c")
3075 Flag passed to the shell to execute "!" and ":!" commands; e.g.,
3076 "bash.exe -c ls" or "command.com /c dir". For the MS-DOS-like
3077 systems, the default is set according to the value of 'shell', to
3078 reduce the need to set this option by the user. It's not used for
3079 OS/2 (EMX figures this out itself). See |option-backslash| about
3080 including spaces and backslashes. See |dos-shell|.
3081 This option cannot be set from a |modeline|.
3083 *'shellpipe'* *'sp'*
3084 'shellpipe' 'sp' string (default ">", "| tee", "|& tee" or "2>&1| tee")
3087 {not available when compiled without the |+quickfix|
3089 String to be used to put the output of the ":make" command in the
3090 error file. See also |:make_makeprg|. See |option-backslash| about
3091 including spaces and backslashes.
3092 For the Amiga and MS-DOS the default is ">". The output is directly
3093 saved in a file and not echoed to the screen.
3094 For Unix the default it "| tee". The stdout of the compiler is saved
3095 in a file and echoed to the screen. If the 'shell' option is "csh" or
3096 "tcsh" after initializations, the default becomes "|& tee". If the
3097 'shell' option is "sh", "ksh", "zsh" or "bash" the default becomes
3098 "2>&1| tee". This means that stderr is also included.
3099 The initialization of this option is done after reading the ".vimrc"
3100 and the other initializations, so that when the 'shell' option is set
3101 there, the 'shellpipe' option changes automatically, unless it was
3102 explicitly set before.
3103 When 'shellpipe' is set to an empty string, no redirection of the
3104 ":make" output will be done. This is useful if you use a 'makeprg'
3105 that writes to 'makeef' by itself. If you want no piping, but do
3106 want to include the 'makeef', set 'shellpipe' to a single space.
3107 Don't forget to precede the space with a backslash: ":set sp=\ ".
3108 In the future pipes may be used for filtering and this option will
3109 become obsolete (at least for Unix).
3110 This option cannot be set from a |modeline|.
3112 *'shellquote'* *'shq'*
3113 'shellquote' 'shq' string (default: ""; MS-DOS and Win32, when 'shell'
3114 contains "sh" somewhere: "\"")
3117 Quoting character(s), put around the command passed to the shell, for
3118 the "!" and ":!" commands. The redirection is kept outside of the
3119 quoting. See 'shellxquote' to include the redirection. It's
3120 probably not useful to set both options.
3121 This is an empty string by default. Only known to be useful for
3122 third-party shells on MS-DOS-like systems, such as the MKS Korn Shell
3123 or bash, where it should be "\"". The default is adjusted according
3124 the value of 'shell', to reduce the need to set this option by the
3125 user. See |dos-shell|.
3126 This option cannot be set from a |modeline|.
3128 *'shellredir'* *'srr'*
3129 'shellredir' 'srr' string (default ">", ">&" or ">%s 2>&1")
3132 String to be used to put the output of a filter command in a temporary
3133 file. See also |:!|. See |option-backslash| about including spaces
3135 The name of the temporary file can be represented by "%s" if necessary
3136 (the file name is appended automatically if no %s appears in the value
3138 The default is ">". For Unix, if the 'shell' option is "csh", "tcsh"
3139 or "zsh" during initializations, the default becomes ">&". If the
3140 'shell' option is "sh", "ksh" or "bash" the default becomes
3141 ">%s 2>&1". This means that stderr is also included.
3142 The initialization of this option is done after reading the ".vimrc"
3143 and the other initializations, so that when the 'shell' option is set
3144 there, the 'shellredir' option changes automatically unless it was
3145 explicitly set before.
3146 In the future pipes may be used for filtering and this option will
3147 become obsolete (at least for Unix).
3148 This option cannot be set from a |modeline|.
3150 *'shellslash'* *'ssl'* *'noshellslash'* *'nossl'*
3151 'shellslash' 'ssl' boolean (default off)
3153 {not in Vi} {only for MSDOS, MS-Windows and OS/2}
3154 When set, a forward slash is used when expanding file names. This is
3155 useful when a Unix-like shell is used instead of command.com or
3156 cmd.exe. Backward slashes can still be typed, but they are changed to
3157 forward slashes by Vim.
3158 Note that setting or resetting this option has no effect for existing
3159 file names, thus this option needs to be set before opening any file
3160 for best results. This might change in the future.
3162 *'shelltype'* *'st'*
3163 'shelltype' 'st' number (default 0)
3165 {not in Vi} {only for the Amiga}
3166 On the Amiga this option influences the way how the commands work
3168 0 and 1: always use the shell
3169 2 and 3: use the shell only to filter lines
3170 4 and 5: use shell only for ':sh' command
3171 When not using the shell, the command is executed directly.
3173 0 and 2: use "shell 'shellcmdflag' cmd" to start external commands
3174 1 and 3: use "shell cmd" to start external commands
3176 *'shellxquote'* *'sxq'*
3177 'shellxquote' 'sxq' string (default: "";
3178 for Win32, when 'shell' contains "sh"
3180 for Unix, when using system(): "\"")
3183 Quoting character(s), put around the command passed to the shell, for
3184 the "!" and ":!" commands. Includes the redirection. See
3185 'shellquote' to exclude the redirection. It's probably not useful
3186 to set both options.
3187 This is an empty string by default. Known to be useful for
3188 third-party shells when using the Win32 version, such as the MKS Korn
3189 Shell or bash, where it should be "\"". The default is adjusted
3190 according the value of 'shell', to reduce the need to set this option
3191 by the user. See |dos-shell|.
3192 This option cannot be set from a |modeline|.
3194 *'shiftround'* *'sr'* *'noshiftround'* *'nosr'*
3195 'shiftround' 'sr' boolean (default off)
3198 Round indent to multiple of 'shiftwidth'. Applies to > and <
3199 commands. CTRL-T and CTRL-D in Insert mode always round the indent to
3200 a multiple of 'shiftwidth' (this is Vi compatible).
3201 NOTE: This option is reset when 'compatible' is set.
3203 *'shiftwidth'* *'sw'*
3204 'shiftwidth' 'sw' number (default 8)
3206 Number of spaces to use for each step of (auto)indent. Used for
3207 |'cindent'|, |>>|, |<<|, etc.
3209 *'shortmess'* *'shm'*
3210 'shortmess' 'shm' string (Vim default "filnxtToO", Vi default: "")
3213 This option helps to avoid all the |hit-return| prompts caused by file
3214 messages, for example with CTRL-G, and to avoid some other messages.
3215 It is a list of flags:
3216 flag meaning when present ~
3217 f use "(3 of 5)" instead of "(file 3 of 5)"
3218 i use "[noeol]" instead of "[Incomplete last line]"
3219 l use "999L, 888C" instead of "999 lines, 888 characters"
3220 m use "[+]" instead of "[Modified]"
3221 n use "[New]" instead of "[New File]"
3222 r use "[RO]" instead of "[readonly]"
3223 w use "[w]" instead of "written" for file write message.
3224 x use "[dos]" instead of "[dos format]", "[unix]" instead of
3225 "[unix format]" and "[mac]" instead of "[mac format]".
3226 a all of the above abbreviations
3228 o overwrite message for writing a file with subsequent message
3229 for reading a file (useful for ":wn" or when 'autowrite' on)
3230 O message for reading a file overwrites any previous message.
3231 Also for quickfix message (e.g., ":cn").
3232 s don't give "search hit BOTTOM, continuing at TOP" or "search
3233 hit TOP, continuing at BOTTOM" messages
3234 t truncate file message at the start if it is too long to fit
3235 on the command-line, "<" will appear in the left most column.
3237 T truncate other messages in the middle if they are too long to
3238 fit on the command line. "..." will appear in the middle.
3240 W don't give "written" or "[w]" when writing a file
3241 A don't give the "ATTENTION" message when an existing swap file
3243 I don't give the intro message when starting Vim |:intro|.
3245 This gives you the opportunity to avoid that a change between buffers
3246 requires you to hit return, but still gives as useful a message as
3247 possible for the space available. To get the whole message that you
3248 would have got with 'shm' empty, use ":file!"
3250 shm= No abbreviation of message.
3251 shm=a Abbreviation, but no loss of information.
3252 shm=at Abbreviation, and truncate message when necessary.
3254 NOTE: This option is set to the Vi default value when 'compatible' is
3255 set and to the Vim default value when 'compatible' is reset.
3257 *'shortname'* *'sn'* *'noshortname'* *'nosn'*
3258 'shortname' 'sn' boolean (default off)
3260 {not in Vi, not in MS-DOS versions}
3261 Filenames are assumed to be 8 characters plus one extension of 3
3262 characters. Multiple dots in file names are not allowed. When this
3263 option is on, dots in file names are replaced with underscores when
3264 adding an extension (".~" or ".swp"). This option is not available
3265 for MS-DOS, because then it would always be on. This option is useful
3266 when editing files on an MS-DOS compatible filesystem, e.g., messydos
3267 or crossdos. When running the Win32 GUI version under Win32s, this
3268 option is always on by default.
3270 *'showbreak'* *'sbr'*
3271 'showbreak' 'sbr' string (default "")
3274 {not available when compiled without the |+linebreak|
3276 String to put at the start of lines that have been wrapped. Useful
3277 values are "> " or "+++ ". Only printable characters are allowed,
3278 excluding <Tab> and comma (in a future version the comma might be used
3279 to separate the part that is shown at the end and at the start of a
3280 line). The characters are highlighted according to the '@' flag in
3283 *'showcmd'* *'sc'* *'noshowcmd'* *'nosc'*
3284 'showcmd' 'sc' boolean (Vim default: on, off for Unix, Vi default:
3288 {not available when compiled without the
3289 |+cmdline_info| feature}
3290 Show (partial) command in status line. Set this option off if your
3292 NOTE: This option is set to the Vi default value when 'compatible' is
3293 set and to the Vim default value when 'compatible' is reset.
3295 *'showfulltag'* *'sft'* *'noshowfulltag'* *'nosft'*
3296 'showfulltag' 'sft' boolean (default off)
3299 When completing a word in insert mode (see |ins-completion|) from the
3300 tags file, show both the tag name and a tidied-up form of the search
3301 pattern (if there is one) as possible matches. Thus, if you have
3302 matched a C function, you can see a template for what arguments are
3303 required (coding style permitting).
3305 *'showmatch'* *'sm'* *'noshowmatch'* *'nosm'*
3306 'showmatch' 'sm' boolean (default off)
3308 When a bracket is inserted, briefly jump to the matching one. The
3309 jump is only done if the match can be seen on the screen. The time to
3310 show the match can be set with 'matchtime'.
3311 A Beep is given if there is no match (no matter if the match can be
3312 seen or not). This option is reset when the 'paste' option is set.
3313 When the 'm' flag is not included in 'cpoptions', typing a character
3314 will immediately move the cursor back to where it belongs.
3315 See the "sm" field in 'guicursor' for setting the cursor shape and
3316 blinking when showing the match.
3317 Note: For the use of the short form parental guidance is advised.
3319 *'showmode'* *'smd'* *'noshowmode'* *'nosmd'*
3320 'showmode' 'smd' boolean (Vim default: on, Vi default: off)
3322 If in Insert, Replace or Visual mode put a message on the last line.
3323 Use the 'M' flag in 'highlight' to set the type of highlighting for
3325 NOTE: This option is set to the Vi default value when 'compatible' is
3326 set and to the Vim default value when 'compatible' is reset.
3328 *'sidescroll'* *'ss'*
3329 'sidescroll' 'ss' number (default 0)
3332 The minimal number of columns to scroll horizontally. Used only when
3333 the 'wrap' option is off and the cursor is moved off of the screen.
3334 When it is zero the cursor will be put in the middle of the screen.
3335 When using a slow terminal set it to a large number or 0. When using
3336 a fast terminal use a small number or 1. Not used for "zh" and "zl"
3339 *'smartcase'* *'scs'* *'nosmartcase'* *'noscs'*
3340 'smartcase' 'scs' boolean (default off)
3343 Override the 'ignorecase' option if the search pattern contains upper
3344 case characters. Only used when the search pattern is typed and
3345 'ignorecase' option is on. Used for the commands "/", "?", "n", "N",
3346 ":g" and ":s". Not used for "*", "#", "gd", tag search, etc.. After
3347 "*" and "#" you can make 'smartcase' used by doing a "/" command,
3348 recalling the search pattern from history and hitting return.
3349 NOTE: This option is reset when 'compatible' is set.
3351 *'smartindent'* *'si'* *'nosmartindent'* *'nosi'*
3352 'smartindent' 'si' boolean (default off)
3355 {not available when compiled without the
3356 |+smartindent| feature}
3357 Do smart autoindenting when starting a new line. Works for C-like
3358 programs, but can also be used for other languages. 'cindent' does
3359 something like this, works better in most cases, but is more strict,
3360 see |C-indenting|. When 'cindent' is on, setting 'si' has no effect.
3361 Normally 'autoindent' should also be on when using 'smartindent'.
3362 An indent is automatically inserted:
3363 - After a line ending in '{'.
3364 - After a line starting with a keyword from 'cinwords'.
3365 - Before a line starting with '}' (only with the "O" command).
3366 When typing '}' as the first character in a new line, that line is
3367 given the same indent as the matching '{'.
3368 When typing '#' as the first character in a new line, the indent for
3369 that line is removed, the '#' is put in the first column. The indent
3370 is restored for the next line. If you don't want this, use this
3371 mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H.
3372 When using the ">>" command, lines starting with '#' are not shifted
3374 NOTE: 'smartindent' is reset when 'compatible' or 'paste' is set.
3376 *'smarttab'* *'sta'* *'nosmarttab'* *'nosta'*
3377 'smarttab' 'sta' boolean (default off)
3380 When on, a <Tab> in front of a line inserts blanks according to
3381 'shiftwidth'. 'tabstop' is used in other places.
3382 When off a <Tab> always inserts blanks according to 'tabstop'.
3383 'shiftwidth' is only used for shifting text left or right
3385 What gets inserted (a Tab or spaces) depends on the 'expandtab'
3386 option. Also see |ins-expandtab|. When 'expandtab' is not set, the
3387 number of spaces minimized by using <Tab>s.
3388 NOTE: This option is reset when 'compatible' is set.
3390 *'softtabstop'* *'sts'*
3391 'softtabstop' 'sts' number (default 0)
3394 Number of spaces that a <Tab> counts for while performing editing
3395 operations, like inserting a <Tab> or using <BS>. It "feels" like
3396 <Tab>s are being inserted, while in fact a mix of spaces and <Tab>s is
3397 used. This is useful to keep the 'ts' setting at its standard value
3398 of 8, while being able to edit like it is set to 'sts'. However,
3399 commands like "x" still work on the actual characters.
3400 When 'sts' is zero, this feature is off.
3401 'softtabstop' is set to 0 when the 'paste' option is set.
3402 See also |ins-expandtab|. When 'expandtab' is not set, the number of
3403 spaces minimized by using <Tab>s.
3404 NOTE: This option is set to 0 when 'compatible' is set.
3406 *'splitbelow'* *'sb'* *'nosplitbelow'* *'nosb'*
3407 'splitbelow' 'sb' boolean (default off)
3410 When on, splitting a window will put the new window below the current
3413 *'startofline'* *'sol'* *'nostartofline'* *'nosol'*
3414 'startofline' 'sol' boolean (default on)
3417 When on the commands listed below move the cursor to the first
3418 blank of the line. When off the cursor is kept in the same column
3419 (if possible). This applies to the commands: CTRL-D, CTRL-U, CTRL-B,
3420 CTRL-F, "G", "H", "M", "L", , and to the commands "d", "<<" and ">>"
3421 with a linewise operator, with "%" with a count and to buffer changing
3422 commands (CTRL-^, :bnext, :bNext, etc.). Also for an Ex command that
3423 only has a line number, e.g., ":25" or ":+".
3424 In case of buffer changing commands the cursor is placed at the column
3425 where it was the last time the buffer was edited.
3426 NOTE: This option is set when 'compatible' is set.
3428 *'statusline'* *'stl'*
3429 'statusline' 'stl' string (default empty)
3432 {not available when compiled without the |+statusline|
3434 When nonempty, this option determines the content of the status line.
3435 Also see |status-line|.
3437 The option consists of printf style '%' items interspersed with
3438 normal text. Each status line item is of the form:
3439 %-0{minwid}.{maxwid}{item}
3440 All fields except the {item} is optional. A single percent sign can
3443 Note that the only effect of 'ruler' when this option is set (and
3444 'laststatus' is 2) is controlling the output of |CTRL-G|.
3447 - Left justify the item. The default is right justified
3448 when minwid is larger than the length of the item.
3449 0 Leading zeroes in numeric items. Overridden by '-'.
3450 minwid Minimum width of the item, padding as set by '-' & '0'.
3451 maxwid Maximum width of the item. Truncation occurs with a '<'
3452 on the left for text items. Numeric items will be
3453 shifted down to maxwid-2 digits followed by '>'number
3454 where number is the amount of missing digits, much like
3455 an exponential notation.
3456 item A one letter code as described below.
3458 Following is a description of the possible statusline items. The
3459 second character in "item" is the type: N for number, S for string
3460 and F for flags as described below. A - is used if not applicable.
3463 f S Path to the file in the buffer, relative to current directory.
3464 F S Full path to the file in the buffer.
3465 t S File name (tail) of file in the buffer.
3466 m F Modified flag, text is " [+].
3467 M F Modified flag, text is ",+".
3468 r F Readonly flag, text is " [RO]".
3469 R F Readonly flag, text is ",RO".
3470 h F Help buffer flag, text is " [help]".
3471 H F Help buffer flag, text is ",HLP".
3472 w F Preview window flag, text is " [Preview]".
3473 W F Preview window flag, text is ",PRV".
3474 y F Type of file in the buffer, e.g., " [vim]". See 'filetype'.
3475 Y F Type of file in the buffer, e.g., ",VIM". See 'filetype'.
3476 {not available when compiled without |+autocmd| feature}
3478 b N Value of byte under cursor.
3479 B N As above, in hexadecimal.
3480 o N Byte number in file of byte under cursor, first byte is 1.
3481 Mnemonic: Offset from start of file (with one added)
3482 {not available when compiled without |+byte_offset| feature}
3483 O N As above, in hexadecimal.
3485 L N Number of lines in buffer.
3487 v N Virtual column number.
3488 V N Virtual column number as -{num}. Not displayed if equal to 'c'.
3489 p N Percentage through file in lines as in |CTRL-G|.
3490 P S Percentage through file of displayed window. This is like the
3491 percentage described for 'ruler'. Always 3 in length.
3492 a S Argument list status as in default title. ({current} of {max})
3493 Empty if the argument file count is zero or one.
3494 { NF Evaluate expression between '{' and '}' and substitute result.
3495 ( - Start of item group. Can be used for setting the width and
3496 alignment of a section. Must be followed by %) somewhere.
3497 ) - End of item group. No width fields allowed.
3498 < - Where to truncate line if too long. Default is at the start.
3499 No width fields allowed.
3500 = - Separation point between left and right aligned items.
3501 No width fields allowed.
3502 * - Set highlight group to User{N}, where {N} is taken from the
3503 minwid field. eg. %1*. Restore normal highlight with %* or %0*.
3504 The difference between User{N} and StatusLine will be applied
3505 to StatusLineNC for the statusline of non-current windows.
3506 The number N must be between 1 and 9. See |hl-User1..9|
3508 Display of flags are controlled by the following heuristic:
3509 If a flag text starts with comma it is assumed that it wants to
3510 separate itself from anything but preceding plaintext. If it starts
3511 with a space it is assumed that it wants to separate itself from
3512 anything but other flags. That is: A leading comma is removed if the
3513 preceding character stems from plaintext. A leading space is removed
3514 if the preceding character stems from another active flag. This will
3515 make a nice display when flags are used like in the examples below.
3517 When all items in a group becomes an empty string (ie. flags that are
3518 not set) and a minwid is not set for the group, the whole group will
3519 become empty. This will make a group like the following disappear
3520 completely from the statusline when none of the flags are set.
3521 > set statusline=...%(\ [%M%R%H]%)...
3523 Beware that an expression is evaluated each and every time the status
3524 line is displayed. The current buffer and current window will be set
3525 temporarily to that of the window (and buffer) whose statusline is
3526 currently being drawn. The expression will evaluate in this context.
3527 The variable "actual_curbuf" is set to the 'bufnr()' number of the
3528 real current buffer.
3530 A result of all digits is regarded a number for display purposes.
3531 Otherwise the result is taken as flag text and applied to the rules
3534 Watch out for errors in expressions. They may render Vim unusable !
3535 If you are stuck, hold down ':' or 'Q' to get a prompt, then quit and
3536 edit your .vimrc or whatever with "vim -u NONE" to get it right.
3539 Display byte count and byte value, modified flag in red.
3540 > set statusline=%<%f%=\ [%1*%M%*%n%R%H]\ %-19(%3l,%02c%03V%)%O'%02b'
3541 > hi User1 term=inverse,bold cterm=inverse,bold ctermfg=red
3542 Emulate standard status line with 'ruler' set
3543 > set statusline=%<%f%h%m%r%=%l,%c%V\ %P
3544 Idem, but add ascii value of char under the cursor (like "ga")
3545 > set statusline=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P
3546 Display a ,GZ flag if a compressed file is loaded
3547 > set statusline=...%r%{VarExists('b:gzflag','\ [GZ]')}%h...
3548 In the |:autocmd|'s: |let b:gzflag = 1 And: |unlet b:gzflag
3549 > function VarExists(var, val)
3550 > if exists(a:var) | return a:val | else | return '' | endif
3554 'suffixes' 'su' string (default ".bak,~,.o,.h,.info,.swp,.obj")
3557 Files with these suffixes get a lower priority when multiple files
3558 match a wildcard. See |suffixes|. Commas can be used to separate the
3559 suffixes. Spaces after the comma are ignored. A dot is also seen as
3560 the start of a suffix. To avoid a dot or comma being recognized as a
3561 separator, precede it with a backslash (see |option-backslash| about
3562 including spaces and backslashes).
3563 See 'wildignore' for completely ignoring files.
3564 The use of |:set+=| and |:set-=| is preferred when adding or removing
3565 suffixes from the list. This avoids problems when a future version
3566 uses another default.
3568 *'swapfile'* *'swf'* *'noswapfile'* *'noswf'*
3569 'swapfile' 'swf' boolean (default on)
3572 Use a swapfile for the buffer. This option can be reset when a
3573 swapfile is not wanted for a specific buffer. For example, with
3574 confidential information that even root must not be able to access.
3575 Careful: All text will be in memory. Don't use this for big files.
3576 Recovery will be impossible!
3577 A swapfile will only be present when |'updatecount'| is non-zero and
3579 When 'swapfile' is reset, the swap file for the current buffer is
3580 immediately deleted. When 'swapfile' is set, and 'updatecount' is
3581 non-zero, a swap file is immediately created.
3582 Also see |swap-file| and |'swapsync'|.
3584 *'swapsync'* *'sws'*
3585 'swapsync' 'sws' string (default "fsync")
3588 When this option is not empty a swap file is synced to disk after
3589 writing to it. This takes some time, especially on busy unix systems.
3590 When this option is empty parts of the swap file may be in memory and
3591 not written to disk. When the system crashes you may lose more work.
3592 On Unix the system does a sync now and then without Vim asking for it,
3593 so the disadvantage of setting this option off is small. On some
3594 systems the swap file will not be written at all. For a unix system
3595 setting it to "sync" will use the sync() call instead of the default
3596 fsync(), which may work better on some systems.
3598 *'switchbuf'* *'swb'*
3599 'switchbuf' 'swb' string (default "")
3602 This option controls the behavior when switching between buffers.
3603 Possible values (comma separated list):
3604 useopen If included, jump to the first open window that
3605 contains the specified buffer (if there is one).
3606 Otherwise: Do not examine other windows.
3607 This setting is checked in |quickfix| mode when
3608 jumping to errors (":cc", ":cn", "cp", etc.). It
3609 is also used in all buffer related split commands,
3610 for example ":sbuffer", ":sbnext", or ":sbrewind".
3611 split If included, split the current window before loading
3612 a buffer. Otherwise: do not split, use current window.
3613 Supported in |quickfix| commands that display errors.
3616 'syntax' 'syn' string (default emtpy)
3619 {not available when compiled without the |+syntax|
3621 When this option is set, the syntax with this name is loaded, unless
3622 syntax highlighting has been switched off with ":syntax off".
3623 Otherwise this option does not always reflect the current syntax (the
3624 b:current_syntax variable does).
3625 This option is most useful in a modeline, for a file which syntax is
3626 not automatically recognized. Example, for in an IDL file:
3627 > /* vim: set syntax=idl : */
3628 To switch off syntax highlighting for the current file, use:
3630 To switch syntax highlighting on according to the current value of the
3633 What actually happens when setting the 'syntax' option is that the
3634 Syntax autocommand event is triggered with the value as argument.
3635 This option is not copied to another buffer, independent of the 's' or
3636 'S' flag in 'cpoptions'.
3639 'tabstop' 'ts' number (default 8)
3641 Number of spaces that a <Tab> in the file counts for. Also see
3642 |:retab| command, and 'softtabstop' option.
3644 Note: Setting 'tabstop' to any other value than 8 can make your file
3645 appear wrong in many places (e.g., when printing it).
3647 There are four main ways to use tabs in Vim:
3648 1. Always keep 'tabstop' at 8, set 'softtabstop' and 'shiftwidth' to 4
3649 (or 3 or whatever you prefer) and use 'noexpandtab'. Then Vim
3650 will use a mix of tabs and spaces, but typing Tab and BS will
3651 behave like a tab appears every 4 (or 3) characters.
3652 2. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use
3653 'expandtab'. This way you will always insert spaces. The
3654 formatting will never be messed up when 'tabstop' is changed.
3655 3. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use a
3656 |modeline| to set these values when editing the file again. Only
3657 works when using Vim to edit the file.
3658 4. Always set 'tabstop' and 'shiftwidth' to the same value, and
3659 'noexpandtab'. This should then work (for initial indents only)
3660 for any tabstop setting that people use. It might be nice to have
3661 tabs after the first non-blank inserted as spaces if you do this
3662 though. Otherwise aligned comments will be wrong when 'tabstop' is
3665 *'tagbsearch'* *'tbs'* *'notagbsearch'* *'notbs'*
3666 'tagbsearch' 'tbs' boolean (default on)
3669 When searching for a tag (e.g., for the |:ta| command), Vim can either
3670 use a binary search or a linear search in a tags file. Binary
3671 searching makes searching for a tag a LOT faster, but a linear search
3672 will find more tags if the tags file wasn't properly sorted.
3673 Vim normally assumes that your tags files are sorted, or indicate that
3674 they are not sorted. Only when this is not the case does the
3675 'tagbsearch' option need to be switched off.
3677 When 'tagbsearch' is on, binary searching is first used in the tags
3678 files. In certain situations, Vim will do a linear search instead for
3679 certain files, or retry all files with a linear search. When
3680 'tagbsearch' is off, only a linear search is done.
3682 Linear searching is done anyway, for one file, when Vim finds a line
3683 at the start of the file indicating that it's not sorted:
3684 > !_TAG_FILE_SORTED 0 /some command/
3685 [The whitespace before and after the '0' must be a single <Tab>]
3687 When a binary search was done and no match was found in any of the
3688 files listed in 'tags', and 'ignorecase' is set or a pattern is used
3689 instead of a normal tag name, a retry is done with a linear search.
3690 Tags in unsorted tags files, and matches with different case will only
3691 be found in the retry.
3693 When 'tagbsearch' is off, tags searching is slower when a full match
3694 exists, but faster when no full match exists. Tags in unsorted tags
3695 files may only be found with 'tagbsearch' off.
3696 When the tags file is not sorted, or sorted in a wrong way (not on
3697 ASCII byte value), 'tagbsearch' should be off, or the line given above
3698 must be included in the tags file.
3699 This option doesn't affect commands that find all matching tags (e.g.,
3700 command-line completion and ":help").
3701 {Vi: always uses binary search in some versions}
3703 *'taglength'* *'tl'*
3704 'taglength' 'tl' number (default 0)
3706 If non-zero, tags are significant up to this number of characters.
3708 *'tagrelative'* *'tr'* *'notagrelative'* *'notr'*
3709 'tagrelative' 'tr' boolean (Vim default: on, Vi default: off)
3712 If on and using a tag file in another directory, file names in that
3713 tag file are relative to the directory where the tag file is.
3714 NOTE: This option is set to the Vi default value when 'compatible' is
3715 set and to the Vim default value when 'compatible' is reset.
3718 'tags' 'tag' string (default "./tags,tags", when compiled with
3719 |+emacs_tags|: "./tags,./TAGS,tags,TAGS")
3721 Filenames for the tag command, separated by spaces or commas. To
3722 include a space or comma in a file name, precede it with a backslash
3723 (see |option-backslash| about including spaces and backslashes).
3724 When a file name starts with "./", the '.' is replaced with the path
3725 of the current file. But only when the 'd' flag is not included in
3726 'cpoptions'. Environment variables are expanded |:set_env|. Also see
3728 If Vim was compiled with the |+emacs_tags| feature, Emacs-style tag
3729 files are also supported. They are automatically recognized. The
3730 default value becomes "./tags,./TAGS,tags,TAGS". |emacs-tags|
3731 The use of |:set+=| and |:set-=| is preferred when adding or removing
3732 file names from the list. This avoids problems when a future version
3733 uses another default.
3734 {Vi: default is "tags /usr/lib/tags"}
3736 *'tagstack'* *'tgst'* *'notagstack'* *'notgst'*
3737 'tagstack' 'tgst' boolean (default on)
3739 {not in all versions of Vi}
3740 When on, the |tagstack| is used normally. When off, a ":tag" or
3741 ":tselect" command with an argument will not push the tag onto the
3742 tagstack. A following ":tag" without an argument, a ":pop" command or
3743 any other command that uses the tagstack will use the unmodified
3744 tagstack, but does change the pointer to the active entry.
3745 Resetting this option is useful when using a ":tag" command in a
3746 mapping which should not change the tagstack.
3749 'term' string (default is $TERM, if that fails:
3750 in the GUI: "builtin_gui"
3752 on BeOS: "beos-ansi"
3761 Name of the terminal. Used for choosing the terminal control
3762 characters. Environment variables are expanded |:set_env|.
3767 *'terse'* *'noterse'*
3768 'terse' boolean (default off)
3770 When set: Add 's' flag to 'shortmess' option (this makes the message
3771 for a search that hits the start or end of the file not being
3772 displayed). When reset: Remove 's' flag from 'shortmess' option. {Vi
3773 shortens a lot of messages}
3775 *'textauto'* *'ta'* *'notextauto'* *'nota'*
3776 'textauto' 'ta' boolean (Vim default: on, Vi default: off)
3779 This option is obsolete. Use 'fileformats'.
3780 For backwards compatibility, when 'textauto' is set, 'fileformats' is
3781 set to the default value for the current system. When 'textauto' is
3782 reset, 'fileformats' is made empty.
3783 NOTE: This option is set to the Vi default value when 'compatible' is
3784 set and to the Vim default value when 'compatible' is reset.
3786 *'textmode'* *'tx'* *'notextmode'* *'notx'*
3787 'textmode' 'tx' boolean (MS-DOS, Win32 and OS/2: default on,
3788 others: default off)
3791 This option is obsolete. Use 'fileformat'.
3792 For backwards compatibility, when 'textmode' is set, 'fileformat' is
3793 set to "dos". When 'textmode' is reset, 'fileformat' is set to
3796 *'textwidth'* *'tw'*
3797 'textwidth' 'tw' number (default 0)
3800 Maximum width of text that is being inserted. A longer line will be
3801 broken after white space to get this width. A zero value disables
3802 this. 'textwidth' is set to 0 when the 'paste' option is set. When
3803 'textwidth' is zero, 'wrapmargin' may be used. See also
3804 'formatoptions' and |ins-textwidth|.
3805 NOTE: This option is set to 0 when 'compatible' is set.
3807 *'tildeop'* *'top'* *'notildeop'* *'notop'*
3808 'tildeop' 'top' boolean (default off)
3811 When on: The tilde command "~" behaves like an operator.
3812 NOTE: This option is reset when 'compatible' is set.
3814 *'timeout'* *'to'* *'notimeout'* *'noto'*
3815 'timeout' 'to' boolean (default on)
3817 *'ttimeout'* *'nottimeout'*
3818 'ttimeout' boolean (default off)
3821 These two options together determine the behavior when part of a
3822 mapped key sequence or keyboard code has been received:
3824 timeout ttimeout action ~
3826 on on or off time out on :mappings and key codes
3827 off on time out on key codes
3829 If there is no time out, Vim will wait until either the complete
3830 mapping or key sequence has been received, or it is clear that there
3831 is no mapping or key sequence for the received characters. For
3832 example: if you have mapped "vl" and Vim has received 'v', the next
3833 character is needed to see if the 'v' is followed by an 'l'. With a
3834 time out Vim will wait for about 1 second for the next character to
3835 arrive. After that the already received characters are interpreted
3836 as single characters. The waiting time can be changed with the
3837 'timeoutlen' option.
3838 On slow terminals or very busy systems time out may cause
3839 malfunctioning cursor keys. If both options are off, Vim waits
3840 forever after an entered <Esc> if there are key codes that start
3841 with <Esc>. You will have to type <Esc> twice. If you do not have
3842 problems with key codes, but would like to have :mapped key
3843 sequences not time out in 1 second, set the ttimeout option and
3844 reset the timeout option.
3846 NOTE: 'ttimeout' is reset when 'compatible' is set.
3848 *'timeoutlen'* *'tm'*
3849 'timeoutlen' 'tm' number (default 1000)
3851 {not in all versions of Vi}
3852 *'ttimeoutlen'* *'ttm'*
3853 'ttimeoutlen' 'ttm' number (default -1)
3856 The time in milliseconds that is waited for a key code or mapped key
3857 sequence to complete. Normally only 'timeoutlen' is used and
3858 'ttimeoutlen' is -1. When a different timeout value for key codes is
3859 desired set 'ttimeoutlen' to a non-negative number.
3861 ttimeoutlen mapping delay key code delay ~
3862 < 0 'timeoutlen' 'timeoutlen'
3863 >= 0 'timeoutlen' 'ttimeoutlen'
3865 The timeout only happens when the 'timeout' and 'ttimeout' options
3866 tell so. A useful setting would be
3867 :set timeout timeoutlen=3000 ttimeoutlen=100
3868 (time out on mapping after three seconds, time out on key codes after
3869 a tenth of a second).
3871 *'title'* *'notitle'*
3872 'title' boolean (default off, on when title can be restored)
3875 {not available when compiled without the |+title|
3877 When on, the title of the window will be set to the value of
3878 'titlestring' (if it is not empty), or to "VIM - filename", where
3879 filename is the name of the file currently being edited. Only works
3880 if the terminal supports setting window titles
3881 (currently Amiga console, Win32 console, all GUI versions and
3882 terminals with a non- empty 't_ts' option - these are Unix xterm and
3883 iris-ansi by default, where 't_ts' is taken from the builtin termcap).
3885 When Vim was compiled with HAVE_X11 defined, the original title will
3886 be restored if possible. The output of ":version" will include "+X11"
3887 when HAVE_X11 was defined, otherwise it will be "-X11". This also
3888 works for the icon name |'icon'|.
3889 If the title cannot be restored, it is set to the value of 'titleold'.
3890 You might want to restore the title outside of Vim then.
3891 When using an xterm from a remote machine you can use this command:
3892 rsh machine_name xterm -display $DISPLAY &
3893 then the WINDOWID environment variable should be inherited and the
3894 title of the window should change back to what it should be after
3898 'titlelen' number (default 85)
3901 {not available when compiled without the |+title|
3903 Gives the percentage of 'columns' to use for the length of the window
3904 title. When the title is longer, only the end of the path name is
3905 shown. A '<' character before the path name is used to indicate this.
3906 Using a percentage makes this adapt to the width of the window. But
3907 it won't work perfectly, because the actual number of characters
3908 available also depends on the font used and other things in the title
3909 bar. When 'titlelen' is zero the full path is used. Otherwise,
3910 values from 1 to 30000 percent can be used.
3911 'titlelen' is also used for the 'titlestring' option.
3914 'titleold' string (default "Thanks for flying Vim")
3917 {only available when compiled with the |+title|
3919 This option will be used for the window title when exiting Vim if the
3920 original title cannot be restored. Only happens if 'title' is on or
3921 'titlestring' is not empty.
3923 'titlestring' string (default "")
3926 {not available when compiled without the |+title|
3928 When this option is not empty, it will be used for the title of the
3929 window. This happens only when the 'title' option is on.
3930 Only works if the terminal supports setting window titles (currently
3931 Amiga console, Win32 console, all GUI versions and terminals with a
3932 non-empty 't_ts' option).
3933 When Vim was compiled with HAVE_X11 defined, the original title will
3934 be restored if possible |X11|.
3935 When this option contains printf-style '%' items, they will be
3936 expanded according to the rules used for 'statusline'.
3938 > auto BufEnter * let &titlestring = hostname() . "/" . expand("%:p")
3939 > set title titlestring=%<%F%=%l/%L-%P titlelen=70
3940 The value of 'titlelen' is used to align items in the middle or right
3941 of the available space.
3942 Some people prefer to have the file name first:
3943 > set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:.:h\")})%)%(\ %a%)
3944 Note the use of "%{ }" and an expression to get the path of the file,
3945 without the file name. The "%( %)" constructs are used to add a
3946 separating space only when needed.
3947 NOTE: Use of special characters in 'titlestring' may cause the display
3948 to be garbled (e.g., when it contains a CR or NL character).
3949 {not available when compiled without the |+statusline| feature}
3952 'toolbar' 'tb' string (default "icons,tooltips")
3954 {only for |+GUI_GTK|}
3955 The contents of this option controls various toolbar settings. The
3956 possible values are:
3957 icons Toolbar buttons are shown with icons.
3958 text Toolbar buttons shown with text.
3959 tooltips Tooltips are active for toolbar buttons.
3960 Tooltips refer to the popup help text which appears after the mouse
3961 cursor is placed over a toolbar button for a brief moment.
3963 If you want the toolbar to be shown with icons as well as text, do the
3965 > :set tb=icons,text
3966 If none of the strings specified in 'toolbar' are valid of if
3967 'toolbar' is empty, this option is ignored. If you want to disable
3968 the toolbar, you need to set the 'guioptions' option. For example:
3969 > :set guioptions-=T
3970 Also see |gui-toolbar|.
3972 *'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'*
3973 'ttybuiltin' 'tbi' boolean (default on)
3976 When on, the builtin termcaps are searched before the external ones.
3977 When off the builtin termcaps are searched after the external ones.
3978 When this option is changed, you should set the 'term' option next for
3979 the change to take effect, for example:
3980 > :set notbi term=$TERM
3982 Rationale: The default for this option is "on", because the builtin
3983 termcap entries are generally better (many systems contain faulty
3986 *'ttyfast'* *'tf'* *'nottyfast'* *'notf'*
3987 'ttyfast' 'tf' boolean (default off, on when 'term' is xterm, hpterm,
3988 sun-cmd, screen, rxvt, dtterm or
3989 iris-ansi; also on when running Vim in
3993 Indicates a fast terminal connection. More characters will be sent to
3994 the screen for redrawing, instead of using insert/delete line
3995 commands. Improves smoothness of redrawing when there are multiple
3996 windows and the terminal does not support a scrolling region.
3997 Also enables the extra writing of characters at the end of each screen
3998 line for lines that wrap. This helps when using copy/paste with the
3999 mouse in an xterm and other terminals.
4001 *'ttymouse'* *'ttym'*
4002 'ttymouse' 'ttym' string (default depends on 'term')
4005 {only in Unix, and not in the GUI}
4006 Name of the terminal type for which mouse codes are to be recognized.
4007 Currently these three strings are valid:
4009 xterm xterm-like mouse handling. The mouse generates
4010 "<Esc>[Mscr", where "scr" is three bytes:
4012 "c" = column plus 33
4014 xterm2 Works like "xterm", but with the xterm reporting the
4015 mouse position while the mouse is dragged. This works
4016 much faster and more precise. Your xterm must at
4017 least at patchlevel 88 / XFree 3.3.3 for this to
4018 work. Determine your version with "xterm -version".
4020 netterm NetTerm mouse handling. The mouse generates
4021 "<Esc>}r,c<CR>", where "r,c" are two decimal numbers
4022 for the row and column.
4024 dec DEC terminal mouse handling. The mouse generates a
4025 rather complex sequence, starting with "<Esc>[".
4027 The mouse handling must be enabled at compile time |+mouse_xterm|
4028 |+mouse_dec| |+mouse_netterm|.
4029 Only "xterm"(2) is really recognized. NetTerm mouse codes are always
4030 recognized, if enabled at compile time. DEC terminal mouse codes
4031 are recognized if enabled at compile time, and 'ttymouse' is not
4033 This option is automatically set to "xterm", when the 'term' option is
4034 set to a name that starts with "xterm", and 'ttymouse' is not "xterm"
4035 or "xterm2" already. The main use of this option is to set it to
4036 "xterm", when the terminal name doesn't start with "xterm", but it can
4037 handle xterm mouse codes.
4038 The "xterm2" value will be set if the xterm version is reported to be
4039 95 of higher. This only works if the t_RV is set to the escape
4040 sequence to request the xterm version number. Otherwise "xterm2" must
4043 *'ttyscroll'* *'tsl'*
4044 'ttyscroll' 'tsl' number (default 999)
4046 Maximum number of lines to scroll the screen. If there are more lines
4047 to scroll the window is redrawn. For terminals where scrolling is
4048 very slow and redrawing is not slow this can be set to a small number,
4049 e.g., 3, to speed up displaying.
4052 'ttytype' 'tty' string (default from $TERM)
4054 Alias for 'term', see above.
4056 *'undolevels'* *'ul'*
4057 'undolevels' 'ul' number (default 100, 1000 for Unix, VMS,
4061 Maximum number of changes that can be undone. Since undo information
4062 is kept in memory, higher numbers will cause more more memory to be
4063 used (nevertheless, a single change can use an unlimited amount of
4065 Set to 0 for Vi compatibility: One level of undo and "u" undoes
4068 But you can also get Vi compatibility by including the 'u' flag in
4069 'cpoptions', and still be able to use CTRL-R to repeat undo.
4070 Set to a negative number for no undo at all:
4072 This helps when you run out of memory for a single change.
4073 Also see |undo-two-ways|.
4075 *'updatecount'* *'uc'*
4076 'updatecount' 'uc' number (default: 200)
4079 After typing this many characters the swap file will be written to
4080 disk. When zero, no swap file will be created at all (see chapter on
4081 recovery |crash-recovery|). 'updatecount' is set to zero by starting
4082 Vim with the "-n" option, see |startup|. When editing in readonly
4083 mode this option will be initialized to 10000.
4084 The swapfile can be disabled per buffer with |'swapfile'|.
4085 When 'updatecount' is set from non-zero to zero, swap files are
4086 created for all buffers that have 'swapfile' set. When 'updatecount'
4087 is set to zero, existing swap files are not deleted.
4088 Also see |'swapsync'|.
4090 *'updatetime'* *'ut'*
4091 'updatetime' 'ut' number (default 4000)
4094 If this many milliseconds nothing is typed the swap file will be
4095 written to disk (see |crash-recovery|). Also used for the
4096 |CursorHold| autocommand event.
4099 'verbose' 'vbs' number (default 0)
4102 When bigger than zero, Vim will give messages about what it is doing.
4103 Currently, these messages are given:
4104 >= 1 When a file is ":source"'ed.
4105 >= 1 When the viminfo file is read or written.
4106 >= 8 Files for which a group of autocommands is executed.
4107 >= 9 Every executed autocommand.
4108 >=15 Every executed function line.
4110 This option can also be set with the "-V" argument. See |-V|.
4114 'viminfo' 'vi' string (default "")
4117 {not available when compiled without the |+viminfo|
4119 When non-empty, the viminfo file is read upon startup and written
4120 when exiting Vim (see |viminfo-file|). The string should be a comma
4121 separated list of parameters, each consisting of a single character
4122 identifying the particular parameter, followed by a number or string
4123 which specifies the value of that parameter. If a particular
4124 character is left out, then the default value is used for that
4125 parameter. The following is a list of the identifying characters and
4126 the effect of their value.
4128 ' Maximum number of previously edited files for which the marks
4129 are remembered. This parameter must always be included when
4130 'viminfo' is non-empty.
4131 f Whether file marks need to be stored. If zero, file marks ('0
4132 to '9, 'A to 'Z) are not stored. When not present or when
4133 non-zero, they are all stored. '0 is used for the current
4134 cursor position (when exiting or when doing ":wviminfo").
4135 r Removable media. The argument is a string (up to the next
4136 ','). This parameter can be given several times. Each
4137 specifies the start of a path for which no marks will be
4138 stored. This is to avoid removable media. For MS-DOS you
4139 could use "ra:,rb:", for Amiga "rdf0:,rdf1:,rdf2:". Case is
4140 ignored. Maximum length of each 'r' argument is 50
4142 " Maximum number of lines saved for each register. If zero then
4143 registers are not saved. When not included, all lines are
4144 saved. Dont forget to put a backslash before the ", otherwise
4145 it will be recognized as the start of a comment!
4146 : Maximum number of items in the command-line history to be
4147 saved. When not included, the value of 'history' is used.
4148 / Maximum number of items in the search pattern history to be
4149 saved. If non-zero, then the previous search and substitute
4150 patterns are also saved. When not included, the value of
4152 h Disable the effect of 'hlsearch' when loading the viminfo
4153 file. When not included, it depends on whether ":nohlsearch"
4154 has been used since the last search command.
4155 @ Maximum number of items in the input-line history to be
4156 saved. When not included, the value of 'history' is used.
4157 n Name of the viminfo file. The name must immediately follow
4158 the 'n'. Must be the last one! If the "-i" argument was
4159 given when starting Vim, that file name overrides the one
4160 given here with 'viminfo'. Environment variables are expanded
4161 when opening the file, not when setting the option.
4162 % When included, save and restore the buffer list. If Vim is
4163 started with a file name argument, the buffer list is not
4164 restored. If Vim is started without a file name argument, the
4165 buffer list is restored from the viminfo file. Buffers
4166 without a file name and buffers for help files are not written
4167 to the viminfo file.
4168 ! When included, save and restore global variables that start
4169 with an uppercase letter, and don't contain a lowercase
4173 > :set viminfo='50,\"1000,:0,n~/vim/viminfo
4175 '50 Marks will be remembered for the last 50 files you
4177 "1000 Contents of registers (up to 1000 lines each) will be
4179 :0 Command-line history will not be saved.
4180 n~/vim/viminfo The name of the file to use is "~/vim/viminfo".
4181 no / Since '/' is not specified, the default will be used,
4182 that is, save all of the search history, and also the
4183 previous search and substitute patterns.
4184 no % The buffer list will not be saved nor read back.
4185 no h 'hlsearch' highlighting will be restored.
4187 *'visualbell'* *'vb'* *'novisualbell'* *'novb'* *beep*
4188 'visualbell' 'vb' boolean (default off)
4191 Use visual bell instead of beeping. The terminal code to display the
4192 visual bell is given with 't_vb'. When no beep or flash is wanted,
4193 use ":set vb t_vb=".
4194 Note: When the GUI starts, 't_vb' is reset to its default value. You
4195 might want to set it again in your |gvimrc|.
4196 In the GUI, 't_vb' defaults to "<Esc>|f", which inverts the display
4197 for 20 msec. If you want to use a different time, use "<Esc>|40f",
4198 where 40 is the time in msec.
4199 Does not work on the Amiga, you always get a screen flash.
4200 Also see 'errorbells'.
4203 'warn' boolean (default on)
4205 Give a warning message when a shell command is used while the buffer
4208 *'weirdinvert'* *'wiv'* *'noweirdinvert'* *'nowiv'*
4209 'weirdinvert' 'wiv' boolean (default off)
4212 This option has the same effect as the 't_xs' termcap option.
4213 It is provided for backwards compatibility with version 4.x.
4214 Setting 'weirdinvert' has the effect of making 't_xs' non-empty, and
4215 vice versa. Has no effect when the GUI is running.
4217 *'whichwrap'* *'ww'*
4218 'whichwrap' 'ww' string (Vim default: "b,s", Vi default: "")
4221 Allow specified keys that move the cursor left/right to wrap to the
4222 previous/next line when the cursor is on the first/last character in
4223 the line. Concatenate characters to allow this for these keys:
4225 b <BS> Normal and Visual
4226 s <Space> Normal and Visual
4227 h "h" Normal and Visual
4228 l "l" Normal and Visual
4229 < <Left> Normal and Visual
4230 > <Right> Normal and Visual
4232 [ <Left> Insert and Replace
4233 ] <Right> Insert and Replace
4236 allows wrap only when cursor keys are used.
4237 When the movement keys are used in combination with a delete or change
4238 operator, the <EOL> also counts for a character. This makes "3h"
4239 different from "3dh" when the cursor crosses the end of a line. This
4240 is also true for "x" and "X", because they do the same as "dl" and
4241 "dh". If you use this, you may also want to use the mapping
4242 ":map <BS> X" to make backspace delete the character in front of the
4244 When 'l' is included, you get a side effect: "yl" on an empty line
4245 will include the <EOL>, so that "p" will insert a new line.
4246 NOTE: This option is set to the Vi default value when 'compatible' is
4247 set and to the Vim default value when 'compatible' is reset.
4250 'wildchar' 'wc' number (Vim default: <Tab>, Vi default: CTRL-E)
4253 Character you have to type to start wildcard expansion in the
4254 command-line, as specified with 'wildmode'.
4255 The character is not recognized when used inside a macro. See
4256 'wildcharm' for that.
4257 Although 'wc' is a number option, you can set it to a special key:
4259 NOTE: This option is set to the Vi default value when 'compatible' is
4260 set and to the Vim default value when 'compatible' is reset.
4262 *'wildcharm'* *'wcm'*
4263 'wildcharm' 'wcm' number (default: none (0))
4266 'wildcharm' works exactly like 'wildchar', except that it is
4267 recognized when used inside a macro. You can find "spare" command-line
4268 keys suitable for this option by looking at |ex-edit-index|. Normally
4269 you'll never actually type 'wildcharm', just use it in mappings that
4270 automatically invoke completion mode, e.g.:
4272 > :cmap ss so $vim/sessions/*.vim<C-Z>
4273 Then after typing :ss you can use CTRL-P & CTRL-N.
4275 *'wildignore'* *'wig'*
4276 'wildignore' 'wig' string (default "")
4279 {not available when compiled without the |+wildignore|
4281 A list of file patterns. A file that matches with one of these
4282 patterns is ignored when completing file or directory names.
4283 The pattern is used like with |:autocmd|, see |autocmd-patterns|.
4284 Also see 'suffixes'.
4286 > :set wildignore=*.o,*.obj
4287 The use of |:set+=| and |:set-=| is preferred when adding or removing
4288 a pattern from the list. This avoids problems when a future version
4289 uses another default.
4291 *'wildmenu'* *'wmnu'* *'nowildmenu'* *'nowmnu'*
4292 'wildmenu' 'wmnu' boolean (default off)
4295 {not available if compiled without the |+wildmenu|
4297 When 'wildmenu' is on, command-line completion operates in an enhanced
4298 mode. On pressing 'wildchar' (usually <Tab>) to invoke completion,
4299 the possible matches are shown just above the command line, with the
4300 first match highlighted (overwriting the status line, if there is
4301 one). Keys that show the previous/next match, such as <Tab> or
4302 CTRL-P/CTRL-N, cause the highlight to move to the appropriate match.
4303 When 'wildmode' is used, "wildmenu" mode is used where "full" is
4304 specified. "longest" and "list" do not start "wildmenu" mode.
4305 If there are more matches than can fit in the line, a ">" is shown on
4306 the right and/or a "<" is shown on the left. The status line scrolls
4308 The "wildmenu" mode is abandoned when a key is hit that is not used
4309 for selecting a completion.
4310 While the "wildmenu" is active the following keys have special
4313 <Left> <Right> - select previous/next match (like CTRL-P/N)
4314 <Down> - in filename/menu name completion: move into a
4315 subdirectory or submenu.
4316 <CR> - in menu completion, when the cursor is just after a
4317 dot: move into a submenu.
4318 <Up> - in filename/menu name completion: move up into
4319 parent directory or parent menu.
4321 This makes the menus accessible from the console |console-menus|.
4323 The "WildMenu" highlighting is used for displaying the current match
4326 *'wildmode'* *'wim'*
4327 'wildmode' 'wim' string (Vim default: "full")
4330 Completion mode that is used for the character specified with
4331 'wildchar'. It is a comma separated list of up to four parts. Each
4332 part specifies what to do for each consecutive use of 'wildchar. The
4333 first part specifies the behavior for the first use of 'wildchar',
4334 The second part for the second use, etc.
4335 These are the possible values for each part:
4336 "" Complete only the first match.
4337 "full" Complete the next full match. After the last match,
4338 the original string is used and then the first match
4340 "longest" Complete till longest common string. If this doesn't
4341 result in a longer string, use the next part.
4342 "longest:full" Like "longest", but also start 'wildmenu' if it is
4344 "list" When more than one match, list all matches.
4345 "list:full" When more than one match, list all matches and
4346 complete first match.
4347 "list:longest" When more than one match, list all matches and
4348 complete till longest common string.
4349 When there is only a single match, it is fully completed in all cases.
4353 Complete first full match, next match, etc. (the default)
4354 > set wildmode=longest,full
4355 Complete longest common string, then each full match.
4356 > set wildmode=list:full
4357 List all matches and complete each full match.
4358 > set wildmode=list,full
4359 List all matches without completing, then each full match.
4360 > set wildmode=longest,list
4361 Complete longest common string, then list alternatives.
4363 *'winaltkeys'* *'wak'*
4364 'winaltkeys' 'wak' string (default "menu")
4367 {only used in Win32 and Motif GUI; GTK only supports
4369 Some GUI versions allow the access to menu entries by using the ALT
4370 key in combination with a character that appears underlined in the
4371 menu. This conflicts with the use of the ALT key for mappings and
4372 entering special characters. This option tells what to do:
4373 no Don't use ALT keys for menus. ALT key combinations can be
4374 mapped, but there is no automatic handling. This can then be
4375 done with the |:simalt| command.
4376 yes ALT key handling is done by the windowing system. ALT key
4377 combinations cannot be mapped.
4378 menu Using ALT in combination with a character that is a menu
4379 shortcut key, will be handled by the windowing system. Other
4381 If the menu is disabled by excluding 'm' from 'guioptions', the ALT
4382 key is never used for the menu.
4383 In the Win32 version, the <F10> key is handled like this too, since
4384 Windows uses it to select a menu.
4386 *'winheight'* *'wh'*
4387 'winheight' 'wh' number (default 1)
4390 Minimal number of lines for the current window. This is not a hard
4391 minimum, Vim will use less lines if there is not enough room. If the
4392 current window is smaller, its size is increased, at the cost of the
4393 height of other windows. Set it to 999 to make the current window
4394 always fill the screen. Set it to a small number for normal editing.
4395 The height is not adjusted after one of the commands to change the
4396 height of the current window.
4397 'winheight' applies to the current window. Use 'winminheight' to set
4398 the minimal height for other windows.
4400 *'winminheight'* *'wmh'*
4401 'winminheight' 'wmh' number (default 1)
4404 The minimal height of a window, when it's not the current window.
4405 This is a hard minimum, windows will never become smaller.
4406 When set to zero, windows may be "squashed" to zero lines (i.e. just a
4407 status bar) if necessary. They will return to at least one line when
4408 they become active (since the cursor has to have somewhere to go.)
4409 Use 'winheight' to set the minimal height of the current window.
4410 This option is only checked when making a window smaller. Don't use a
4411 large number, it will cause errors when opening more than a few
4412 windows. A value of 0 to 3 is reasonable.
4415 'wrap' boolean (default on)
4418 When on, lines longer than the width of the window will wrap and
4419 displaying continues on the next line. When off lines will not wrap
4420 and only part of long lines will be displayed. When the cursor is
4421 moved to a part that is not shown, the screen will scroll horizontally
4422 (also see 'sidescroll' and 'listchars' options and |wrap-off|). If
4423 you want to break long lines, see 'textwidth'.
4425 *'wrapmargin'* *'wm'*
4426 'wrapmargin' 'wm' number (default 0)
4428 Number of characters from the right window border where wrapping
4429 starts. When typing text beyond this limit, an <EOL> will be inserted
4430 and inserting continues on the next line. When 'textwidth' is
4431 non-zero, this option is not used. See also 'formatoptions' and
4432 |ins-textwidth|. {Vi: works differently and less useful}
4434 *'wrapscan'* *'ws'* *'nowrapscan'* *'nows'*
4435 'wrapscan' 'ws' boolean (default on)
4437 Searches wrap around the end of the file.
4439 *'write'* *'nowrite'*
4440 'write' boolean (default on)
4443 Allows writing files. When not set, writing a file is not allowed.
4444 Can be used for a view-only mode, where modifications to the text are
4445 still allowed. Can be reset with the |-m| command line argument.
4446 Filtering text is still possible, even though this requires writing a
4449 *'writeany'* *'wa'* *'nowriteany'* *'nowa'*
4450 'writeany' 'wa' boolean (default off)
4452 Allows writing to any file with no need for "!" override.
4454 *'writebackup'* *'wb'* *'nowritebackup'* *'nowb'*
4455 'writebackup' 'wb' boolean (default on with |+writebackup| feature, off
4459 Make a backup before overwriting a file. The backup is removed after
4460 the file was successfully written, unless the 'backup' option is
4461 also on. Reset this option if your file system is almost full. See
4462 |backup-table| for another explanation.
4463 NOTE: This option is set to the default value when 'compatible' is
4466 *'writedelay'* *'wd'*
4467 'writedelay' 'wd' number (default 0)
4470 The number of microseconds to wait for each character sent to the
4471 screen. When non-zero, characters are sent to the terminal one by
4472 one. For MS-DOS pcterm this does not work. For debugging purposes.
4474 vim:tw=78:ts=8:sw=8: