

Help FAQ Both

Vim documentation: options

*options.txt* For Vim version 7.3. Last change: 2011 Mar 22 VIM REFERENCE MANUAL by Bram Moolenaar Options *options* 1. Setting options |set-option| 2. Automatically setting options |auto-setting| 3. Options summary |option-summary| For an overview of options see help.txt |option-list|. Vim has a number of internal variables and switches which can be set to achieve special effects. These options come in three forms: boolean can only be on or off *boolean* *toggle* number has a numeric value string has a string value ============================================================================== 1. Setting options *set-option* *E764* *:se* *:set* :se[t] Show all options that differ from their default value. :se[t] all Show all but terminal options. :se[t] termcap Show all terminal options. Note that in the GUI the key codes are not shown, because they are generated internally and can't be changed. Changing the terminal codes in the GUI is not useful either... *E518* *E519* :se[t] {option}? Show value of {option}. :se[t] {option} Toggle option: set, switch it on. Number option: show value. String option: show value. :se[t] no{option} Toggle option: Reset, switch it off. *:set-!* *:set-inv* :se[t] {option}! or :se[t] inv{option} Toggle option: Invert value. {not in Vi} *:set-default* *:set-&* *:set-&vi* *:set-&vim* :se[t] {option}& Reset option to its default value. May depend on the current value of 'compatible'. {not in Vi} :se[t] {option}&vi Reset option to its Vi default value. {not in Vi} :se[t] {option}&vim Reset option to its Vim default value. {not in Vi} :se[t] all& Set all options, except terminal options, to their default value. The values of 'term', 'lines' and 'columns' are not changed. {not in Vi} *:set-args* *E487* *E521* :se[t] {option}={value} or :se[t] {option}:{value} Set string or number option to {value}. For numeric options the value can be given in decimal, hex (preceded with 0x) or octal (preceded with '0') (hex and octal are only available for machines which have the strtol() function). The old value can be inserted by typing 'wildchar' (by default this is a <Tab> or CTRL-E if 'compatible' is set). See |cmdline-completion|. White space between {option} and '=' is allowed and will be ignored. White space between '=' and {value} is not allowed. See |option-backslash| for using white space and backslashes in {value}. :se[t] {option}+={value} *:set+=* Add the {value} to a number option, or append the {value} to a string option. When the option is a comma separated list, a comma is added, unless the value was empty. If the option is a list of flags, superfluous flags are removed. When adding a flag that was already present the option value doesn't change. Also see |:set-args| above. {not in Vi} :se[t] {option}^={value} *:set^=* Multiply the {value} to a number option, or prepend the {value} to a string option. When the option is a comma separated list, a comma is added, unless the value was empty. Also see |:set-args| above. {not in Vi} :se[t] {option}-={value} *:set-=* Subtract the {value} from a number option, or remove the {value} from a string option, if it is there. If the {value} is not found in a string option, there is no error or warning. When the option is a comma separated list, a comma is deleted, unless the option becomes empty. When the option is a list of flags, {value} must be exactly as they appear in the option. Remove flags one by one to avoid problems. Also see |:set-args| above. {not in Vi} The {option} arguments to ":set" may be repeated. For example: :set ai nosi sw=3 ts=3 If you make an error in one of the arguments, an error message will be given and the following arguments will be ignored. *:set-verbose* When 'verbose' is non-zero, displaying an option value will also tell where it was last set. Example: :verbose set shiftwidth cindent? shiftwidth=4 Last set from modeline cindent Last set from /usr/local/share/vim/vim60/ftplugin/c.vim This is only done when specific option values are requested, not for ":verbose set all" or ":verbose set" without an argument. When the option was set by hand there is no "Last set" message. When the option was set while executing a function, user command or autocommand, the script in which it was defined is reported. Note that an option may also have been set as a side effect of setting 'compatible'. A few special texts: Last set from modeline Option was set in a |modeline|. Last set from --cmd argument Option was set with command line argument |--cmd| or +. Last set from -c argument Option was set with command line argument |-c|, +, |-S| or |-q|. Last set from environment variable Option was set from an environment variable, $VIMINIT, $GVIMINIT or $EXINIT. Last set from error handler Option was cleared when evaluating it resulted in an error. {not available when compiled without the |+eval| feature} *:set-termcap* *E522* For {option} the form "t_xx" may be used to set a terminal option. This will override the value from the termcap. You can then use it in a mapping. If the "xx" part contains special characters, use the <t_xx> form: :set <t_#4>=^[Ot This can also be used to translate a special code for a normal key. For example, if Alt-b produces <Esc>b, use this: :set <M-b>=^[b (the ^[ is a real <Esc> here, use CTRL-V <Esc> to enter it) The advantage over a mapping is that it works in all situations. You can define any key codes, e.g.: :set t_xy=^[foo; There is no warning for using a name that isn't recognized. You can map these codes as you like: :map <t_xy> something *E846* When a key code is not set, it's like it does not exist. Trying to get its value will result in an error: :set t_kb= :set t_kb E846: Key code not set: t_kb The t_xx options cannot be set from a |modeline| or in the |sandbox|, for security reasons. The listing from ":set" looks different from Vi. Long string options are put at the end of the list. The number of options is quite large. The output of "set all" probably does not fit on the screen, causing Vim to give the |more-prompt|. *option-backslash* To include white space in a string option value it has to be preceded with a backslash. To include a backslash you have to use two. Effectively this means that the number of backslashes in an option value is halved (rounded down). A few examples: :set tags=tags\ /usr/tags results in "tags /usr/tags" :set tags=tags\\,file results in "tags\,file" :set tags=tags\\\ file results in "tags\ file" The "|" character separates a ":set" command from a following command. To include the "|" in the option value, use "\|" instead. This example sets the 'titlestring' option to "hi|there": :set titlestring=hi\|there This sets the 'titlestring' option to "hi" and 'iconstring' to "there": :set titlestring=hi|set iconstring=there Similarly, the double quote character starts a comment. To include the '"'' in the option value, use '\"' instead. This example sets the 'titlestring' option to 'hi "there"': :set titlestring=hi\ \"there\" For MS-DOS and WIN32 backslashes in file names are mostly not removed. More precise: For options that expect a file name (those where environment variables are expanded) a backslash before a normal file name character is not removed. But a backslash before a special character (space, backslash, comma, etc.) is used like explained above. There is one special situation, when the value starts with "\\": :set dir=\\machine\path results in "\\machine\path" :set dir=\\\\machine\\path results in "\\machine\path" :set dir=\\path\\file results in "\\path\file" (wrong!) For the first one the start is kept, but for the second one the backslashes are halved. This makes sure it works both when you expect backslashes to be halved and when you expect the backslashes to be kept. The third gives a result which is probably not what you want. Avoid it. *add-option-flags* *remove-option-flags* *E539* *E550* *E551* *E552* Some options are a list of flags. When you want to add a flag to such an option, without changing the existing ones, you can do it like this: :set guioptions+=a Remove a flag from an option like this: :set guioptions-=a This removes the 'a' flag from 'guioptions'. Note that you should add or remove one flag at a time. If 'guioptions' has the value "ab", using "set guioptions-=ba" won't work, because the string "ba" doesn't appear. *:set_env* *expand-env* *expand-environment-var* Environment variables in specific string options will be expanded. If the environment variable exists the '$' and the following environment variable name is replaced with its value. If it does not exist the '$' and the name are not modified. Any non-id character (not a letter, digit or '_') may follow the environment variable name. That character and what follows is appended to the value of the environment variable. Examples: :set term=$TERM.new :set path=/usr/$INCLUDE,$HOME/include,. When adding or removing a string from an option with ":set opt-=val" or ":set opt+=val" the expansion is done before the adding or removing. Handling of local options *local-options* Some of the options only apply to a window or buffer. Each window or buffer has its own copy of this option, thus can each have their own value. This allows you to set 'list' in one window but not in another. And set 'shiftwidth' to 3 in one buffer and 4 in another. The following explains what happens to these local options in specific situations. You don't really need to know all of this, since Vim mostly uses the option values you would expect. Unfortunately, doing what the user expects is a bit complicated... When splitting a window, the local options are copied to the new window. Thus right after the split the contents of the two windows look the same. When editing a new buffer, its local option values must be initialized. Since the local options of the current buffer might be specifically for that buffer, these are not used. Instead, for each buffer-local option there also is a global value, which is used for new buffers. With ":set" both the local and global value is changed. With "setlocal" only the local value is changed, thus this value is not used when editing a new buffer. When editing a buffer that has been edited before, the last used window options are used again. If this buffer has been edited in this window, the values from back then are used. Otherwise the values from the window where the buffer was edited last are used. It's possible to set a local window option specifically for a type of buffer. When you edit another buffer in the same window, you don't want to keep using these local window options. Therefore Vim keeps a global value of the local window options, which is used when editing another buffer. Each window has its own copy of these values. Thus these are local to the window, but global to all buffers in the window. With this you can do: :e one :set list :e two Now the 'list' option will also be set in "two", since with the ":set list" command you have also set the global value. :set nolist :e one :setlocal list :e two Now the 'list' option is not set, because ":set nolist" resets the global value, ":setlocal list" only changes the local value and ":e two" gets the global value. Note that if you do this next: :e one You will not get back the 'list' value as it was the last time you edited "one". The options local to a window are not remembered for each buffer. *:setl* *:setlocal* :setl[ocal] ... Like ":set" but set only the value local to the current buffer or window. Not all options have a local value. If the option does not have a local value the global value is set. With the "all" argument: display local values for all local options. Without argument: Display local values for all local options which are different from the default. When displaying a specific local option, show the local value. For a global/local boolean option, when the global value is being used, "--" is displayed before the option name. For a global option the global value is shown (but that might change in the future). {not in Vi} :setl[ocal] {option}< Set the local value of {option} to its global value by copying the value. {not in Vi} :se[t] {option}< Set the local value of {option} to its global value by making it empty. Only makes sense for |global-local| options. {not in Vi} *:setg* *:setglobal* :setg[lobal] ... Like ":set" but set only the global value for a local option without changing the local value. When displaying an option, the global value is shown. With the "all" argument: display global values for all local options. Without argument: display global values for all local options which are different from the default. {not in Vi} For buffer-local and window-local options: Command global value local value :set option=value set set :setlocal option=value - set :setglobal option=value set - :set option? - display :setlocal option? - display :setglobal option? display - Global options with a local value *global-local* Options are global when you mostly use one value for all buffers and windows. For some global options it's useful to sometimes have a different local value. You can set the local value with ":setlocal". That buffer or window will then use the local value, while other buffers and windows continue using the global value. For example, you have two windows, both on C source code. They use the global 'makeprg' option. If you do this in one of the two windows: :set makeprg=gmake then the other window will switch to the same value. There is no need to set the 'makeprg' option in the other C source window too. However, if you start editing a Perl file in a new window, you want to use another 'makeprg' for it, without changing the value used for the C source files. You use this command: :setlocal makeprg=perlmake You can switch back to using the global value by making the local value empty: :setlocal makeprg= This only works for a string option. For a boolean option you need to use the "<" flag, like this: :setlocal autoread< Note that for non-boolean options using "<" copies the global value to the local value, it doesn't switch back to using the global value (that matters when the global value changes later). You can also use: :set path< This will make the local value of 'path' empty, so that the global value is used. Thus it does the same as: :setlocal path= Note: In the future more global options can be made global-local. Using ":setlocal" on a global option might work differently then. Setting the filetype :setf[iletype] {filetype} *:setf* *:setfiletype* Set the 'filetype' option to {filetype}, but only if not done yet in a sequence of (nested) autocommands. This is short for: :if !did_filetype() : setlocal filetype={filetype} :endif This command is used in a filetype.vim file to avoid setting the 'filetype' option twice, causing different settings and syntax files to be loaded. {not in Vi} *option-window* *optwin* :bro[wse] se[t] *:set-browse* *:browse-set* *:opt* *:options* :opt[ions] Open a window for viewing and setting all options. Options are grouped by function. Offers short help for each option. Hit <CR> on the short help to open a help window with more help for the option. Modify the value of the option and hit <CR> on the "set" line to set the new value. For window and buffer specific options, the last accessed window is used to set the option value in, unless this is a help window, in which case the window below help window is used (skipping the option-window). {not available when compiled without the |+eval| or |+autocmd| features} *$HOME* Using "~" is like using "$HOME", but it is only recognized at the start of an option and after a space or comma. On Unix systems "~user" can be used too. It is replaced by the home directory of user "user". Example: :set path=~mool/include,/usr/include,. On Unix systems the form "${HOME}" can be used too. The name between {} can contain non-id characters then. Note that if you want to use this for the "gf" command, you need to add the '{' and '}' characters to 'isfname'. NOTE: expanding environment variables and "~/" is only done with the ":set" command, not when assigning a value to an option with ":let". Note the maximum length of an expanded option is limited. How much depends on the system, mostly it is something like 256 or 1024 characters. *:fix* *:fixdel* :fix[del] Set the value of 't_kD': 't_kb' is 't_kD' becomes CTRL-? CTRL-H not CTRL-? CTRL-? (CTRL-? is 0177 octal, 0x7f hex) {not in Vi} If your delete key terminal code is wrong, but the code for backspace is alright, you can put this in your .vimrc: :fixdel This works no matter what the actual code for backspace is. If the backspace key terminal code is wrong you can use this: :if &term == "termname" : set t_kb=^V<BS> : fixdel :endif Where "^V" is CTRL-V and "<BS>" is the backspace key (don't type four characters!). Replace "termname" with your terminal name. If your <Delete> key sends a strange key sequence (not CTRL-? or CTRL-H) you cannot use ":fixdel". Then use: :if &term == "termname" : set t_kD=^V<Delete> :endif Where "^V" is CTRL-V and "<Delete>" is the delete key (don't type eight characters!). Replace "termname" with your terminal name. *Linux-backspace* Note about Linux: By default the backspace key produces CTRL-?, which is wrong. You can fix it by putting this line in your rc.local: echo "keycode 14 = BackSpace" | loadkeys *NetBSD-backspace* Note about NetBSD: If your backspace doesn't produce the right code, try this: xmodmap -e "keycode 22 = BackSpace" If this works, add this in your .Xmodmap file: keysym 22 = BackSpace You need to restart for this to take effect. ============================================================================== 2. Automatically setting options *auto-setting* Besides changing options with the ":set" command, there are three alternatives to set options automatically for one or more files: 1. When starting Vim initializations are read from various places. See |initialization|. Most of them are performed for all editing sessions, and some of them depend on the directory where Vim is started. You can create an initialization file with |:mkvimrc|, |:mkview| and |:mksession|. 2. If you start editing a new file, the automatic commands are executed. This can be used to set options for files matching a particular pattern and many other things. See |autocommand|. 3. If you start editing a new file, and the 'modeline' option is on, a number of lines at the beginning and end of the file are checked for modelines. This is explained here. *modeline* *vim:* *vi:* *ex:* *E520* There are two forms of modelines. The first form: [text]{white}{vi:|vim:|ex:}[white]{options} [text] any text or empty {white} at least one blank character (<Space> or <Tab>) {vi:|vim:|ex:} the string "vi:", "vim:" or "ex:" [white] optional white space {options} a list of option settings, separated with white space or ':', where each part between ':' is the argument for a ":set" command (can be empty) Example: vi:noai:sw=3 ts=6 The second form (this is compatible with some versions of Vi): [text]{white}{vi:|vim:|ex:}[white]se[t] {options}:[text] [text] any text or empty {white} at least one blank character (<Space> or <Tab>) {vi:|vim:|ex:} the string "vi:", "vim:" or "ex:" [white] optional white space se[t] the string "set " or "se " (note the space) {options} a list of options, separated with white space, which is the argument for a ":set" command : a colon [text] any text or empty Example: /* vim: set ai tw=75: */ The white space before {vi:|vim:|ex:} is required. This minimizes the chance that a normal word like "lex:" is caught. There is one exception: "vi:" and "vim:" can also be at the start of the line (for compatibility with version 3.0). Using "ex:" at the start of the line will be ignored (this could be short for "example:"). *modeline-local* The options are set like with ":setlocal": The new value only applies to the buffer and window that contain the file. Although it's possible to set global options from a modeline, this is unusual. If you have two windows open and the files in it set the same global option to a different value, the result depends on which one was opened last. When editing a file that was already loaded, only the window-local options from the modeline are used. Thus if you manually changed a buffer-local option after opening the file, it won't be changed if you edit the same buffer in another window. But window-local options will be set. *modeline-version* If the modeline is only to be used for some versions of Vim, the version number can be specified where "vim:" is used: vim{vers}: version {vers} or later vim<{vers}: version before {vers} vim={vers}: version {vers} vim>{vers}: version after {vers} {vers} is 600 for Vim 6.0 (hundred times the major version plus minor). For example, to use a modeline only for Vim 6.0 and later: /* vim600: set foldmethod=marker: */ To use a modeline for Vim before version 5.7: /* vim<570: set sw=4: */ There can be no blanks between "vim" and the ":". The number of lines that are checked can be set with the 'modelines' option. If 'modeline' is off or 'modelines' is 0 no lines are checked. Note that for the first form all of the rest of the line is used, thus a line like: /* vi:ts=4: */ will give an error message for the trailing "*/". This line is OK: /* vi:set ts=4: */ If an error is detected the rest of the line is skipped. If you want to include a ':' in a set command precede it with a '\'. The backslash in front of the ':' will be removed. Example: /* vi:set dir=c\:\tmp: */ This sets the 'dir' option to "c:\tmp". Only a single backslash before the ':' is removed. Thus to include "\:" you have to specify "\\:". No other commands than "set" are supported, for security reasons (somebody might create a Trojan horse text file with modelines). And not all options can be set. For some options a flag is set, so that when it's used the |sandbox| is effective. Still, there is always a small risk that a modeline causes trouble. E.g., when some joker sets 'textwidth' to 5 all your lines are wrapped unexpectedly. So disable modelines before editing untrusted text. The mail ftplugin does this, for example. Hint: If you would like to do something else than setting an option, you could define an autocommand that checks the file for a specific string. For example: au BufReadPost * if getline(1) =~ "VAR" | call SetVar() | endif And define a function SetVar() that does something with the line containing "VAR". ============================================================================== 3. Options summary *option-summary* In the list below all the options are mentioned with their full name and with an abbreviation if there is one. Both forms may be used. In this document when a boolean option is "set" that means that ":set option" is entered. When an option is "reset", ":set nooption" is used. For some options there are two default values: The "Vim default", which is used when 'compatible' is not set, and the "Vi default", which is used when 'compatible' is set. Most options are the same in all windows and buffers. There are a few that are specific to how the text is presented in a window. These can be set to a different value in each window. For example the 'list' option can be set in one window and reset in another for the same text, giving both types of view at the same time. There are a few options that are specific to a certain file. These can have a different value for each file or buffer. For example the 'textwidth' option can be 78 for a normal text file and 0 for a C program. global one option for all buffers and windows local to window each window has its own copy of this option local to buffer each buffer has its own copy of this option When creating a new window the option values from the currently active window are used as a default value for the window-specific options. For the buffer-specific options this depends on the 's' and 'S' flags in the 'cpoptions' option. If 's' is included (which is the default) the values for buffer options are copied from the currently active buffer when a buffer is first entered. If 'S' is present the options are copied each time the buffer is entered, this is almost like having global options. If 's' and 'S' are not present, the options are copied from the currently active buffer when the buffer is created. Hidden options *hidden-options* Not all options are supported in all versions. This depends on the supported features and sometimes on the system. A remark about this is in curly braces below. When an option is not supported it may still be set without getting an error, this is called a hidden option. You can't get the value of a hidden option though, it is not stored. To test if option "foo" can be used with ":set" use something like this: if exists('&foo') This also returns true for a hidden option. To test if option "foo" is really supported use something like this: if exists('+foo') *E355* A jump table for the options with a short description can be found at |Q_op|. *'aleph'* *'al'* *aleph* *Aleph* 'aleph' 'al' number (default 128 for MS-DOS, 224 otherwise) global {not in Vi} {only available when compiled with the |+rightleft| feature} The ASCII code for the first letter of the Hebrew alphabet. The routine that maps the keyboard in Hebrew mode, both in Insert mode (when hkmap is set) and on the command-line (when hitting CTRL-_) outputs the Hebrew characters in the range [aleph..aleph+26]. aleph=128 applies to PC code, and aleph=224 applies to ISO 8859-8. See |rileft.txt|. *'allowrevins'* *'ari'* *'noallowrevins'* *'noari'* 'allowrevins' 'ari' boolean (default off) global {not in Vi} {only available when compiled with the |+rightleft| feature} Allow CTRL-_ in Insert and Command-line mode. This is default off, to avoid that users that accidentally type CTRL-_ instead of SHIFT-_ get into reverse Insert mode, and don't know how to get out. See 'revins'. NOTE: This option is reset when 'compatible' is set. *'altkeymap'* *'akm'* *'noaltkeymap'* *'noakm'* 'altkeymap' 'akm' boolean (default off) global {not in Vi} {only available when compiled with the |+farsi| feature} When on, the second language is Farsi. In editing mode CTRL-_ toggles the keyboard map between Farsi and English, when 'allowrevins' set. When off, the keyboard map toggles between Hebrew and English. This is useful to start the Vim in native mode i.e. English (left-to-right mode) and have default second language Farsi or Hebrew (right-to-left mode). See |farsi.txt|. *'ambiwidth'* *'ambw'* 'ambiwidth' 'ambw' string (default: "single") global {not in Vi} {only available when compiled with the |+multi_byte| feature} Only effective when 'encoding' is "utf-8" or another Unicode encoding. Tells Vim what to do with characters with East Asian Width Class Ambiguous (such as Euro, Registered Sign, Copyright Sign, Greek letters, Cyrillic letters). There are currently two possible values: "single": Use the same width as characters in US-ASCII. This is expected by most users. "double": Use twice the width of ASCII characters. *E834* *E835* The value "double" cannot be used if 'listchars' or 'fillchars' contains a character that would be double width. There are a number of CJK fonts for which the width of glyphs for those characters are solely based on how many octets they take in legacy/traditional CJK encodings. In those encodings, Euro, Registered sign, Greek/Cyrillic letters are represented by two octets, therefore those fonts have "wide" glyphs for them. This is also true of some line drawing characters used to make tables in text file. Therefore, when a CJK font is used for GUI Vim or Vim is running inside a terminal (emulators) that uses a CJK font (or Vim is run inside an xterm invoked with "-cjkwidth" option.), this option should be set to "double" to match the width perceived by Vim with the width of glyphs in the font. Perhaps it also has to be set to "double" under CJK Windows 9x/ME or Windows 2k/XP when the system locale is set to one of CJK locales. See Unicode Standard Annex #11 http://www.unicode.org/reports/tr11. *'antialias'* *'anti'* *'noantialias'* *'noanti'* 'antialias' 'anti' boolean (default: off) global {not in Vi} {only available when compiled with GUI enabled on Mac OS X} This option only has an effect in the GUI version of Vim on Mac OS X v10.2 or later. When on, Vim will use smooth ("antialiased") fonts, which can be easier to read at certain sizes on certain displays. Setting this option can sometimes cause problems if 'guifont' is set to its default (empty string). *'autochdir'* *'acd'* *'noautochdir'* *'noacd'* 'autochdir' 'acd' boolean (default off) global {not in Vi} {only available when compiled with it, use exists("+autochdir") to check} When on, Vim will change the current working directory whenever you open a file, switch buffers, delete a buffer or open/close a window. It will change to the directory containing the file which was opened or selected. This option is provided for backward compatibility with the Vim released with Sun ONE Studio 4 Enterprise Edition. Note: When this option is on some plugins may not work. *'arabic'* *'arab'* *'noarabic'* *'noarab'* 'arabic' 'arab' boolean (default off) local to window {not in Vi} {only available when compiled with the |+arabic| feature} This option can be set to start editing Arabic text. Setting this option will: - Set the 'rightleft' option, unless 'termbidi' is set. - Set the 'arabicshape' option, unless 'termbidi' is set. - Set the 'keymap' option to "arabic"; in Insert mode CTRL-^ toggles between typing English and Arabic key mapping. - Set the 'delcombine' option Note that 'encoding' must be "utf-8" for working with Arabic text. Resetting this option will: - Reset the 'rightleft' option. - Disable the use of 'keymap' (without changing its value). Note that 'arabicshape' and 'delcombine' are not reset (it is a global option. Also see |arabic.txt|. *'arabicshape'* *'arshape'* *'noarabicshape'* *'noarshape'* 'arabicshape' 'arshape' boolean (default on) global {not in Vi} {only available when compiled with the |+arabic| feature} When on and 'termbidi' is off, the required visual character corrections that need to take place for displaying the Arabic language take affect. Shaping, in essence, gets enabled; the term is a broad one which encompasses: a) the changing/morphing of characters based on their location within a word (initial, medial, final and stand-alone). b) the enabling of the ability to compose characters c) the enabling of the required combining of some characters When disabled the display shows each character's true stand-alone form. Arabic is a complex language which requires other settings, for further details see |arabic.txt|. *'autoindent'* *'ai'* *'noautoindent'* *'noai'* 'autoindent' 'ai' boolean (default off) local to buffer Copy indent from current line when starting a new line (typing <CR> in Insert mode or when using the "o" or "O" command). If you do not type anything on the new line except <BS> or CTRL-D and then type <Esc>, CTRL-O or <CR>, the indent is deleted again. Moving the cursor to another line has the same effect, unless the 'I' flag is included in 'cpoptions'. When autoindent is on, formatting (with the "gq" command or when you reach 'textwidth' in Insert mode) uses the indentation of the first line. When 'smartindent' or 'cindent' is on the indent is changed in a different way. The 'autoindent' option is reset when the 'paste' option is set. {small difference from Vi: After the indent is deleted when typing <Esc> or <CR>, the cursor position when moving up or down is after the deleted indent; Vi puts the cursor somewhere in the deleted indent}. *'autoread'* *'ar'* *'noautoread'* *'noar'* 'autoread' 'ar' boolean (default off) global or local to buffer |global-local| {not in Vi} When a file has been detected to have been changed outside of Vim and it has not been changed inside of Vim, automatically read it again. When the file has been deleted this is not done. |timestamp| If this option has a local value, use this command to switch back to using the global value: :set autoread< *'autowrite'* *'aw'* *'noautowrite'* *'noaw'* 'autowrite' 'aw' boolean (default off) global Write the contents of the file, if it has been modified, on each :next, :rewind, :last, :first, :previous, :stop, :suspend, :tag, :!, :make, CTRL-] and CTRL-^ command; and when a :buffer, CTRL-O, CTRL-I, '{A-Z0-9}, or `{A-Z0-9} command takes one to another file. Note that for some commands the 'autowrite' option is not used, see 'autowriteall' for that. *'autowriteall'* *'awa'* *'noautowriteall'* *'noawa'* 'autowriteall' 'awa' boolean (default off) global {not in Vi} Like 'autowrite', but also used for commands ":edit", ":enew", ":quit", ":qall", ":exit", ":xit", ":recover" and closing the Vim window. Setting this option also implies that Vim behaves like 'autowrite' has been set. *'background'* *'bg'* 'background' 'bg' string (default "dark" or "light") global {not in Vi} When set to "dark", Vim will try to use colors that look good on a dark background. When set to "light", Vim will try to use colors that look good on a light background. Any other value is illegal. Vim tries to set the default value according to the terminal used. This will not always be correct. Setting this option does not change the background color, it tells Vim what the background color looks like. For changing the background color, see |:hi-normal|. When 'background' is set Vim will adjust the default color groups for the new value. But the colors used for syntax highlighting will not change. *g:colors_name* When a color scheme is loaded (the "g:colors_name" variable is set) setting 'background' will cause the color scheme to be reloaded. If the color scheme adjusts to the value of 'background' this will work. However, if the color scheme sets 'background' itself the effect may be undone. First delete the "g:colors_name" variable when needed. When setting 'background' to the default value with: :set background& Vim will guess the value. In the GUI this should work correctly, in other cases Vim might not be able to guess the right value. When starting the GUI, the default value for 'background' will be "light". When the value is not set in the .gvimrc, and Vim detects that the background is actually quite dark, 'background' is set to "dark". But this happens only AFTER the .gvimrc file has been read (because the window needs to be opened to find the actual background color). To get around this, force the GUI window to be opened by putting a ":gui" command in the .gvimrc file, before where the value of 'background' is used (e.g., before ":syntax on"). Normally this option would be set in the .vimrc file. Possibly depending on the terminal name. Example: :if &term == "pcterm" : set background=dark :endif When this option is set, the default settings for the highlight groups will change. To use other settings, place ":highlight" commands AFTER the setting of the 'background' option. This option is also used in the "$VIMRUNTIME/syntax/syntax.vim" file to select the colors for syntax highlighting. After changing this option, you must load syntax.vim again to see the result. This can be done with ":syntax on". *'backspace'* *'bs'* 'backspace' 'bs' string (default "") global {not in Vi} Influences the working of <BS>, <Del>, CTRL-W and CTRL-U in Insert mode. This is a list of items, separated by commas. Each item allows a way to backspace over something: value effect indent allow backspacing over autoindent eol allow backspacing over line breaks (join lines) start allow backspacing over the start of insert; CTRL-W and CTRL-U stop once at the start of insert. When the value is empty, Vi compatible backspacing is used. For backwards compatibility with version 5.4 and earlier: value effect 0 same as ":set backspace=" (Vi compatible) 1 same as ":set backspace=indent,eol" 2 same as ":set backspace=indent,eol,start" See |:fixdel| if your <BS> or <Del> key does not do what you want. NOTE: This option is set to "" when 'compatible' is set. *'backup'* *'bk'* *'nobackup'* *'nobk'* 'backup' 'bk' boolean (default off) global {not in Vi} Make a backup before overwriting a file. Leave it around after the file has been successfully written. If you do not want to keep the backup file, but you do want a backup while the file is being written, reset this option and set the 'writebackup' option (this is the default). If you do not want a backup file at all reset both options (use this if your file system is almost full). See the |backup-table| for more explanations. When the 'backupskip' pattern matches, a backup is not made anyway. When 'patchmode' is set, the backup may be renamed to become the oldest version of a file. NOTE: This option is reset when 'compatible' is set. *'backupcopy'* *'bkc'* 'backupcopy' 'bkc' string (Vi default for Unix: "yes", otherwise: "auto") global {not in Vi} When writing a file and a backup is made, this option tells how it's done. This is a comma separated list of words. The main values are: "yes" make a copy of the file and overwrite the original one "no" rename the file and write a new one "auto" one of the previous, what works best Extra values that can be combined with the ones above are: "breaksymlink" always break symlinks when writing "breakhardlink" always break hardlinks when writing Making a copy and overwriting the original file: - Takes extra time to copy the file. + When the file has special attributes, is a (hard/symbolic) link or has a resource fork, all this is preserved. - When the file is a link the backup will have the name of the link, not of the real file. Renaming the file and writing a new one: + It's fast. - Sometimes not all attributes of the file can be copied to the new file. - When the file is a link the new file will not be a link. The "auto" value is the middle way: When Vim sees that renaming file is possible without side effects (the attributes can be passed on and the file is not a link) that is used. When problems are expected, a copy will be made. The "breaksymlink" and "breakhardlink" values can be used in combination with any of "yes", "no" and "auto". When included, they force Vim to always break either symbolic or hard links by doing exactly what the "no" option does, renaming the original file to become the backup and writing a new file in its place. This can be useful for example in source trees where all the files are symbolic or hard links and any changes should stay in the local source tree, not be propagated back to the original source. *crontab* One situation where "no" and "auto" will cause problems: A program that opens a file, invokes Vim to edit that file, and then tests if the open file was changed (through the file descriptor) will check the backup file instead of the newly created file. "crontab -e" is an example. When a copy is made, the original file is truncated and then filled with the new text. This means that protection bits, owner and symbolic links of the original file are unmodified. The backup file however, is a new file, owned by the user who edited the file. The group of the backup is set to the group of the original file. If this fails, the protection bits for the group are made the same as for others. When the file is renamed this is the other way around: The backup has the same attributes of the original file, and the newly written file is owned by the current user. When the file was a (hard/symbolic) link, the new file will not! That's why the "auto" value doesn't rename when the file is a link. The owner and group of the newly written file will be set to the same ones as the original file, but the system may refuse to do this. In that case the "auto" value will again not rename the file. *'backupdir'* *'bdir'* 'backupdir' 'bdir' string (default for Amiga: ".,t:", for MS-DOS and Win32: ".,c:/tmp,c:/temp" for Unix: ".,~/tmp,~/") global {not in Vi} List of directories for the backup file, separated with commas. - The backup file will be created in the first directory in the list where this is possible. The directory must exist, Vim will not create it for you. - Empty means that no backup file will be created ('patchmode' is impossible!). Writing may fail because of this. - A directory "." means to put the backup file in the same directory as the edited file. - A directory starting with "./" (or ".\" for MS-DOS et al.) means to put the backup file relative to where the edited file is. The leading "." is replaced with the path name of the edited file. ("." inside a directory name has no special meaning). - Spaces after the comma are ignored, other spaces are considered part of the directory name. To have a space at the start of a directory name, precede it with a backslash. - To include a comma in a directory name precede it with a backslash. - A directory name may end in an '/'. - Environment variables are expanded |:set_env|. - Careful with '\' characters, type one before a space, type two to get one in the option (see |option-backslash|), for example: :set bdir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces - For backwards compatibility with Vim version 3.0 a '>' at the start of the option is removed. See also 'backup' and 'writebackup' options. If you want to hide your backup files on Unix, consider this value: :set backupdir=./.backup,~/.backup,.,/tmp You must create a ".backup" directory in each directory and in your home directory for this to work properly. The use of |:set+=| and |:set-=| is preferred when adding or removing directories from the list. This avoids problems when a future version uses another default. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. *'backupext'* *'bex'* *E589* 'backupext' 'bex' string (default "~", for VMS: "_") global {not in Vi} String which is appended to a file name to make the name of the backup file. The default is quite unusual, because this avoids accidentally overwriting existing files with a backup file. You might prefer using ".bak", but make sure that you don't have files with ".bak" that you want to keep. Only normal file name characters can be used, "/\*?[|<>" are illegal. If you like to keep a lot of backups, you could use a BufWritePre autocommand to change 'backupext' just before writing the file to include a timestamp. :au BufWritePre * let &bex = '-' . strftime("%Y%b%d%X") . '~' Use 'backupdir' to put the backup in a different directory. *'backupskip'* *'bsk'* 'backupskip' 'bsk' string (default: "/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*") global {not in Vi} {not available when compiled without the |+wildignore| feature} A list of file patterns. When one of the patterns matches with the name of the file which is written, no backup file is created. Both the specified file name and the full path name of the file are used. The pattern is used like with |:autocmd|, see |autocmd-patterns|. Watch out for special characters, see |option-backslash|. When $TMPDIR, $TMP or $TEMP is not defined, it is not used for the default value. "/tmp/*" is only used for Unix. Note that environment variables are not expanded. If you want to use $HOME you must expand it explicitly, e.g.: :let backupskip = escape(expand('$HOME'), '\') . '/tmp/*' Note that the default also makes sure that "crontab -e" works (when a backup would be made by renaming the original file crontab won't see the newly created file). Also see 'backupcopy' and |crontab|. *'balloondelay'* *'bdlay'* 'balloondelay' 'bdlay' number (default: 600) global {not in Vi} {only available when compiled with the |+balloon_eval| feature} Delay in milliseconds before a balloon may pop up. See |balloon-eval|. *'ballooneval'* *'beval'* *'noballooneval'* *'nobeval'* 'ballooneval' 'beval' boolean (default off) global {not in Vi} {only available when compiled with the |+balloon_eval| feature} Switch on the |balloon-eval| functionality. *'balloonexpr'* *'bexpr'* 'balloonexpr' 'bexpr' string (default "") global or local to buffer |global-local| {not in Vi} {only available when compiled with the |+balloon_eval| feature} Expression for text to show in evaluation balloon. It is only used when 'ballooneval' is on. These variables can be used: v:beval_bufnr number of the buffer in which balloon is going to show v:beval_winnr number of the window v:beval_lnum line number v:beval_col column number (byte index) v:beval_text word under or after the mouse pointer The evaluation of the expression must not have side effects! Example: function! MyBalloonExpr() return 'Cursor is at line ' . v:beval_lnum . \', column ' . v:beval_col . \ ' of file ' . bufname(v:beval_bufnr) . \ ' on word "' . v:beval_text . '"' endfunction set bexpr=MyBalloonExpr() set ballooneval NOTE: The balloon is displayed only if the cursor is on a text character. If the result of evaluating 'balloonexpr' is not empty, Vim does not try to send a message to an external debugger (Netbeans or Sun Workshop). The expression may be evaluated in the |sandbox|, see |sandbox-option|. It is not allowed to change text or jump to another window while evaluating 'balloonexpr' |textlock|. To check whether line breaks in the balloon text work use this check: if has("balloon_multiline") When they are supported "

" characters will start a new line. If the expression evaluates to a |List| this is equal to using each List item as a string and putting "

" in between them. *'binary'* *'bin'* *'nobinary'* *'nobin'* 'binary' 'bin' boolean (default off) local to buffer {not in Vi} This option should be set before editing a binary file. You can also use the |-b| Vim argument. When this option is switched on a few options will be changed (also when it already was on): 'textwidth' will be set to 0 'wrapmargin' will be set to 0 'modeline' will be off 'expandtab' will be off Also, 'fileformat' and 'fileformats' options will not be used, the file is read and written like 'fileformat' was "unix" (a single <NL> separates lines). The 'fileencoding' and 'fileencodings' options will not be used, the file is read without conversion. NOTE: When you start editing a(nother) file while the 'bin' option is on, settings from autocommands may change the settings again (e.g., 'textwidth'), causing trouble when editing. You might want to set 'bin' again when the file has been loaded. The previous values of these options are remembered and restored when 'bin' is switched from on to off. Each buffer has its own set of saved option values. To edit a file with 'binary' set you can use the |++bin| argument. This avoids you have to do ":set bin" which would have effect for all files you edit. When writing a file the <EOL> for the last line is only written if there was one in the original file (normally Vim appends an <EOL> to the last line if there is none; this would make the file longer). See the 'endofline' option. *'bioskey'* *'biosk'* *'nobioskey'* *'nobiosk'* 'bioskey' 'biosk' boolean (default on) global {not in Vi} {only for MS-DOS} When on the BIOS is called to obtain a keyboard character. This works better to detect CTRL-C, but only works for the console. When using a terminal over a serial port reset this option. Also see |'conskey'|. *'bomb'* *'nobomb'* 'bomb' boolean (default off) local to buffer {not in Vi} {only available when compiled with the |+multi_byte| feature} When writing a file and the following conditions are met, a BOM (Byte Order Mark) is prepended to the file: - this option is on - the 'binary' option is off - 'fileencoding' is "utf-8", "ucs-2", "ucs-4" or one of the little/big endian variants. Some applications use the BOM to recognize the encoding of the file. Often used for UCS-2 files on MS-Windows. For other applications it causes trouble, for example: "cat file1 file2" makes the BOM of file2 appear halfway the resulting file. Gcc doesn't accept a BOM. When Vim reads a file and 'fileencodings' starts with "ucs-bom", a check for the presence of the BOM is done and 'bomb' set accordingly. Unless 'binary' is set, it is removed from the first line, so that you don't see it when editing. When you don't change the options, the BOM will be restored when writing the file. *'breakat'* *'brk'* 'breakat' 'brk' string (default " ^I!@*-+;:,./?") global {not in Vi} {not available when compiled without the |+linebreak| feature} This option lets you choose which characters might cause a line break if 'linebreak' is on. Only works for ASCII and also for 8-bit characters when 'encoding' is an 8-bit encoding. *'browsedir'* *'bsdir'* 'browsedir' 'bsdir' string (default: "last") global {not in Vi} {only for Motif, Athena, GTK, Mac and Win32 GUI} Which directory to use for the file browser: last Use same directory as with last file browser, where a file was opened or saved. buffer Use the directory of the related buffer. current Use the current directory. {path} Use the specified directory *'bufhidden'* *'bh'* 'bufhidden' 'bh' string (default: "") local to buffer {not in Vi} {not available when compiled without the |+quickfix| feature} This option specifies what happens when a buffer is no longer displayed in a window: <empty> follow the global 'hidden' option hide hide the buffer (don't unload it), also when 'hidden' is not set unload unload the buffer, also when 'hidden' is set or using |:hide| delete delete the buffer from the buffer list, also when 'hidden' is set or using |:hide|, like using |:bdelete| wipe wipe out the buffer from the buffer list, also when 'hidden' is set or using |:hide|, like using |:bwipeout| CAREFUL: when "unload", "delete" or "wipe" is used changes in a buffer are lost without a warning. This option is used together with 'buftype' and 'swapfile' to specify special kinds of buffers. See |special-buffers|. *'buflisted'* *'bl'* *'nobuflisted'* *'nobl'* *E85* 'buflisted' 'bl' boolean (default: on) local to buffer {not in Vi} When this option is set, the buffer shows up in the buffer list. If it is reset it is not used for ":bnext", "ls", the Buffers menu, etc. This option is reset by Vim for buffers that are only used to remember a file name or marks. Vim sets it when starting to edit a buffer. But not when moving to a buffer with ":buffer". *'buftype'* *'bt'* *E382* 'buftype' 'bt' string (default: "") local to buffer {not in Vi} {not available when compiled without the |+quickfix| feature} The value of this option specifies the type of a buffer: <empty> normal buffer nofile buffer which is not related to a file and will not be written nowrite buffer which will not be written acwrite buffer which will always be written with BufWriteCmd autocommands. {not available when compiled without the |+autocmd| feature} quickfix quickfix buffer, contains list of errors |:cwindow| or list of locations |:lwindow| help help buffer (you are not supposed to set this manually) This option is used together with 'bufhidden' and 'swapfile' to specify special kinds of buffers. See |special-buffers|. Be careful with changing this option, it can have many side effects! A "quickfix" buffer is only used for the error list and the location list. This value is set by the |:cwindow| and |:lwindow| commands and you are not supposed to change it. "nofile" and "nowrite" buffers are similar: both: The buffer is not to be written to disk, ":w" doesn't work (":w filename" does work though). both: The buffer is never considered to be |'modified'|. There is no warning when the changes will be lost, for example when you quit Vim. both: A swap file is only created when using too much memory (when 'swapfile' has been reset there is never a swap file). nofile only: The buffer name is fixed, it is not handled like a file name. It is not modified in response to a |:cd| command. *E676* "acwrite" implies that the buffer name is not related to a file, like "nofile", but it will be written. Thus, in contrast to "nofile" and "nowrite", ":w" does work and a modified buffer can't be abandoned without saving. For writing there must be matching |BufWriteCmd|, |FileWriteCmd| or |FileAppendCmd| autocommands. *'casemap'* *'cmp'* 'casemap' 'cmp' string (default: "internal,keepascii") global {not in Vi} {only available when compiled with the |+multi_byte| feature} Specifies details about changing the case of letters. It may contain these words, separated by a comma: internal Use internal case mapping functions, the current locale does not change the case mapping. This only matters when 'encoding' is a Unicode encoding, "latin1" or "iso-8859-15". When "internal" is omitted, the towupper() and towlower() system library functions are used when available. keepascii For the ASCII characters (0x00 to 0x7f) use the US case mapping, the current locale is not effective. This probably only matters for Turkish. *'cdpath'* *'cd'* *E344* *E346* 'cdpath' 'cd' string (default: equivalent to $CDPATH or ",,") global {not in Vi} {not available when compiled without the |+file_in_path| feature} This is a list of directories which will be searched when using the |:cd| and |:lcd| commands, provided that the directory being searched for has a relative path, not an absolute part starting with "/", "./" or "../", the 'cdpath' option is not used then. The 'cdpath' option's value has the same form and semantics as |'path'|. Also see |file-searching|. The default value is taken from $CDPATH, with a "," prepended to look in the current directory first. If the default value taken from $CDPATH is not what you want, include a modified version of the following command in your vimrc file to override it: :let &cdpath = ',' . substitute(substitute($CDPATH, '[, ]', '\\\0', 'g'), ':', ',', 'g') This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. (parts of 'cdpath' can be passed to the shell to expand file names). *'cedit'* 'cedit' string (Vi default: "", Vim default: CTRL-F) global {not in Vi} {not available when compiled without the |+vertsplit| feature} The key used in Command-line Mode to open the command-line window. The default is CTRL-F when 'compatible' is off. Only non-printable keys are allowed. The key can be specified as a single character, but it is difficult to type. The preferred way is to use the <> notation. Examples: :set cedit=<C-Y> :set cedit=<Esc> |Nvi| also has this option, but it only uses the first character. See |cmdwin|. *'charconvert'* *'ccv'* *E202* *E214* *E513* 'charconvert' 'ccv' string (default "") global {only available when compiled with the |+multi_byte| and |+eval| features} {not in Vi} An expression that is used for character encoding conversion. It is evaluated when a file that is to be read or has been written has a different encoding from what is desired. 'charconvert' is not used when the internal iconv() function is supported and is able to do the conversion. Using iconv() is preferred, because it is much faster. 'charconvert' is not used when reading stdin |--|, because there is no file to convert from. You will have to save the text in a file first. The expression must return zero or an empty string for success, non-zero for failure. The possible encoding names encountered are in 'encoding'. Additionally, names given in 'fileencodings' and 'fileencoding' are used. Conversion between "latin1", "unicode", "ucs-2", "ucs-4" and "utf-8" is done internally by Vim, 'charconvert' is not used for this. 'charconvert' is also used to convert the viminfo file, if the 'c' flag is present in 'viminfo'. Also used for Unicode conversion. Example: set charconvert=CharConvert() fun CharConvert() system("recode " \ . v:charconvert_from . ".." . v:charconvert_to \ . " <" . v:fname_in . " >" v:fname_out) return v:shell_error endfun The related Vim variables are: v:charconvert_from name of the current encoding v:charconvert_to name of the desired encoding v:fname_in name of the input file v:fname_out name of the output file Note that v:fname_in and v:fname_out will never be the same. Note that v:charconvert_from and v:charconvert_to may be different from 'encoding'. Vim internally uses UTF-8 instead of UCS-2 or UCS-4. Encryption is not done by Vim when using 'charconvert'. If you want to encrypt the file after conversion, 'charconvert' should take care of this. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. *'cindent'* *'cin'* *'nocindent'* *'nocin'* 'cindent' 'cin' boolean (default off) local to buffer {not in Vi} {not available when compiled without the |+cindent| feature} Enables automatic C program indenting. See 'cinkeys' to set the keys that trigger reindenting in insert mode and 'cinoptions' to set your preferred indent style. If 'indentexpr' is not empty, it overrules 'cindent'. If 'lisp' is not on and both 'indentexpr' and 'equalprg' are empty, the "=" operator indents using this algorithm rather than calling an external program. See |C-indenting|. When you don't like the way 'cindent' works, try the 'smartindent' option or 'indentexpr'. This option is not used when 'paste' is set. NOTE: This option is reset when 'compatible' is set. *'cinkeys'* *'cink'* 'cinkeys' 'cink' string (default "0{,0},0),:,0#,!^F,o,O,e") local to buffer {not in Vi} {not available when compiled without the |+cindent| feature} A list of keys that, when typed in Insert mode, cause reindenting of the current line. Only used if 'cindent' is on and 'indentexpr' is empty. For the format of this option see |cinkeys-format|. See |C-indenting|. *'cinoptions'* *'cino'* 'cinoptions' 'cino' string (default "") local to buffer {not in Vi} {not available when compiled without the |+cindent| feature} The 'cinoptions' affect the way 'cindent' reindents lines in a C program. See |cinoptions-values| for the values of this option, and |C-indenting| for info on C indenting in general. *'cinwords'* *'cinw'* 'cinwords' 'cinw' string (default "if,else,while,do,for,switch") local to buffer {not in Vi} {not available when compiled without both the |+cindent| and the |+smartindent| features} These keywords start an extra indent in the next line when 'smartindent' or 'cindent' is set. For 'cindent' this is only done at an appropriate place (inside {}). Note that 'ignorecase' isn't used for 'cinwords'. If case doesn't matter, include the keyword both the uppercase and lowercase: "if,If,IF". *'clipboard'* *'cb'* 'clipboard' 'cb' string (default "autoselect,exclude:cons\|linux" for X-windows, "" otherwise) global {not in Vi} {only in GUI versions or when the |+xterm_clipboard| feature is included} This option is a list of comma separated names. These names are recognized: unnamed When included, Vim will use the clipboard register '*' for all yank, delete, change and put operations which would normally go to the unnamed register. When a register is explicitly specified, it will always be used regardless of whether "unnamed" is in 'clipboard' or not. The clipboard register can always be explicitly accessed using the "* notation. Also see |gui-clipboard|. unnamedplus A variant of "unnamed" flag which uses the clipboard register '+' (|quoteplus|) instead of register '*' for all operations except yank. Yank shall copy the text into register '+' and also into '*' when "unnamed" is included. Only available with the |+X11| feature. Availability can be checked with: if has('unnamedplus') autoselect Works like the 'a' flag in 'guioptions': If present, then whenever Visual mode is started, or the Visual area extended, Vim tries to become the owner of the windowing system's global selection or put the selected text on the clipboard used by the selection register "*. See |guioptions_a| and |quotestar| for details. When the GUI is active, the 'a' flag in 'guioptions' is used, when the GUI is not active, this "autoselect" flag is used. Also applies to the modeless selection. autoselectml Like "autoselect", but for the modeless selection only. Compare to the 'A' flag in 'guioptions'. html When the clipboard contains HTML, use this when pasting. When putting text on the clipboard, mark it as HTML. This works to copy rendered HTML from Firefox, paste it as raw HTML in Vim, select the HTML in Vim and paste it in a rich edit box in Firefox. You probably want to add this only temporarily, possibly use BufEnter autocommands. Only supported for GTK version 2 and later. Only available with the |+multi_byte| feature. exclude:{pattern} Defines a pattern that is matched against the name of the terminal 'term'. If there is a match, no connection will be made to the X server. This is useful in this situation: - Running Vim in a console. - $DISPLAY is set to start applications on another display. - You do not want to connect to the X server in the console, but do want this in a terminal emulator. To never connect to the X server use: exclude:.* This has the same effect as using the |-X| argument. Note that when there is no connection to the X server the window title won't be restored and the clipboard cannot be accessed. The value of 'magic' is ignored, {pattern} is interpreted as if 'magic' was on. The rest of the option value will be used for {pattern}, this must be the last entry. *'cmdheight'* *'ch'* 'cmdheight' 'ch' number (default 1) global {not in Vi} Number of screen lines to use for the command-line. Helps avoiding |hit-enter| prompts. The value of this option is stored with the tab page, so that each tab page can have a different value. *'cmdwinheight'* *'cwh'* 'cmdwinheight' 'cwh' number (default 7) global {not in Vi} {not available when compiled without the |+vertsplit| feature} Number of screen lines to use for the command-line window. |cmdwin| *'colorcolumn'* *'cc'* 'colorcolumn' 'cc' string (default "") local to window {not in Vi} {not available when compiled without the |+syntax| feature} 'colorcolumn' is a comma separated list of screen columns that are highlighted with ColorColumn |hl-ColorColumn|. Useful to align text. Will make screen redrawing slower. The screen column can be an absolute number, or a number preceded with '+' or '-', which is added to or subtracted from 'textwidth'. :set cc=+1 " highlight column after 'textwidth' :set cc=+1,+2,+3 " highlight three columns after 'textwidth' :hi ColorColumn ctermbg=lightgrey guibg=lightgrey When 'textwidth' is zero then the items with '-' and '+' are not used. A maximum of 256 columns are highlighted. *'columns'* *'co'* *E594* 'columns' 'co' number (default 80 or terminal width) global {not in Vi} Number of columns of the screen. Normally this is set by the terminal initialization and does not have to be set by hand. Also see |posix-screen-size|. When Vim is running in the GUI or in a resizable window, setting this option will cause the window size to be changed. When you only want to use the size for the GUI, put the command in your |gvimrc| file. When you set this option and Vim is unable to change the physical number of columns of the display, the display may be messed up. For the GUI it is always possible and Vim limits the number of columns to what fits on the screen. You can use this command to get the widest window possible: :set columns=9999 Minimum value is 12, maximum value is 10000. *'comments'* *'com'* *E524* *E525* 'comments' 'com' string (default "s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-") local to buffer {not in Vi} {not available when compiled without the |+comments| feature} A comma separated list of strings that can start a comment line. See |format-comments|. See |option-backslash| about using backslashes to insert a space. *'commentstring'* *'cms'* *E537* 'commentstring' 'cms' string (default "/*%s*/") local to buffer {not in Vi} {not available when compiled without the |+folding| feature} A template for a comment. The "%s" in the value is replaced with the comment text. Currently only used to add markers for folding, see |fold-marker|. *'compatible'* *'cp'* *'nocompatible'* *'nocp'* 'compatible' 'cp' boolean (default on, off when a |vimrc| or |gvimrc| file is found) global {not in Vi} This option has the effect of making Vim either more Vi-compatible, or make Vim behave in a more useful way. This is a special kind of option, because when it's set or reset, other options are also changed as a side effect. CAREFUL: Setting or resetting this option can have a lot of unexpected effects: Mappings are interpreted in another way, undo behaves differently, etc. If you set this option in your vimrc file, you should probably put it at the very start. By default this option is on and the Vi defaults are used for the options. This default was chosen for those people who want to use Vim just like Vi, and don't even (want to) know about the 'compatible' option. When a |vimrc| or |gvimrc| file is found while Vim is starting up, this option is switched off, and all options that have not been modified will be set to the Vim defaults. Effectively, this means that when a |vimrc| or |gvimrc| file exists, Vim will use the Vim defaults, otherwise it will use the Vi defaults. (Note: This doesn't happen for the system-wide vimrc or gvimrc file, nor for a file given with the |-u| argument). Also see |compatible-default| and |posix-compliance|. You can also set this option with the "-C" argument, and reset it with "-N". See |-C| and |-N|. Switching this option off makes the Vim defaults be used for options that have a different Vi and Vim default value. See the options marked with a '+' below. Other options are not modified. At the moment this option is set, several other options will be set or reset to make Vim as Vi-compatible as possible. See the table below. This can be used if you want to revert to Vi compatible editing. See also 'cpoptions'. option + set value effect 'allowrevins' off no CTRL-_ command 'backupcopy' Unix: "yes" backup file is a copy others: "auto" copy or rename backup file 'backspace' "" normal backspace 'backup' off no backup file 'cindent' off no C code indentation 'cedit' + "" no key to open the |cmdwin| 'cpoptions' + (all flags) Vi-compatible flags 'cscopetag' off don't use cscope for ":tag" 'cscopetagorder' 0 see |cscopetagorder| 'cscopeverbose' off see |cscopeverbose| 'digraph' off no digraphs 'esckeys' + off no <Esc>-keys in Insert mode 'expandtab' off tabs not expanded to spaces 'fileformats' + "" no automatic file format detection, "dos,unix" except for DOS, Windows and OS/2 'formatoptions' + "vt" Vi compatible formatting 'gdefault' off no default 'g' flag for ":s" 'history' + 0 no commandline history 'hkmap' off no Hebrew keyboard mapping 'hkmapp' off no phonetic Hebrew keyboard mapping 'hlsearch' off no highlighting of search matches 'incsearch' off no incremental searching 'indentexpr' "" no indenting by expression 'insertmode' off do not start in Insert mode 'iskeyword' + "@,48-57,_" keywords contain alphanumeric characters and '_' 'joinspaces' on insert 2 spaces after period 'modeline' + off no modelines 'more' + off no pauses in listings 'revins' off no reverse insert 'ruler' off no ruler 'scrolljump' 1 no jump scroll 'scrolloff' 0 no scroll offset 'shiftround' off indent not rounded to shiftwidth 'shortmess' + "" no shortening of messages 'showcmd' + off command characters not shown 'showmode' + off current mode not shown 'smartcase' off no automatic ignore case switch 'smartindent' off no smart indentation 'smarttab' off no smart tab size 'softtabstop' 0 tabs are always 'tabstop' positions 'startofline' on goto startofline with some commands 'tagrelative' + off tag file names are not relative 'textauto' + off no automatic textmode detection 'textwidth' 0 no automatic line wrap 'tildeop' off tilde is not an operator 'ttimeout' off no terminal timeout 'whichwrap' + "" left-right movements don't wrap 'wildchar' + CTRL-E only when the current value is <Tab> use CTRL-E for cmdline completion 'writebackup' on or off depends on the |+writebackup| feature *'complete'* *'cpt'* *E535* 'complete' 'cpt' string (default: ".,w,b,u,t,i") local to buffer {not in Vi} This option specifies how keyword completion |ins-completion| works when CTRL-P or CTRL-N are used. It is also used for whole-line completion |i_CTRL-X_CTRL-L|. It indicates the type of completion and the places to scan. It is a comma separated list of flags: . scan the current buffer ('wrapscan' is ignored) w scan buffers from other windows b scan other loaded buffers that are in the buffer list u scan the unloaded buffers that are in the buffer list U scan the buffers that are not in the buffer list k scan the files given with the 'dictionary' option kspell use the currently active spell checking |spell| k{dict} scan the file {dict}. Several "k" flags can be given, patterns are valid too. For example: :set cpt=k/usr/dict/*,k~/spanish s scan the files given with the 'thesaurus' option s{tsr} scan the file {tsr}. Several "s" flags can be given, patterns are valid too. i scan current and included files d scan current and included files for defined name or macro |i_CTRL-X_CTRL-D| ] tag completion t same as "]" Unloaded buffers are not loaded, thus their autocmds |:autocmd| are not executed, this may lead to unexpected completions from some files (gzipped files for example). Unloaded buffers are not scanned for whole-line completion. The default is ".,w,b,u,t,i", which means to scan: 1. the current buffer 2. buffers in other windows 3. other loaded buffers 4. unloaded buffers 5. tags 6. included files As you can see, CTRL-N and CTRL-P can be used to do any 'iskeyword'- based expansion (e.g., dictionary |i_CTRL-X_CTRL-K|, included patterns |i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions). *'completefunc'* *'cfu'* 'completefunc' 'cfu' string (default: empty) local to buffer {not in Vi} {not available when compiled without the |+eval| or |+insert_expand| features} This option specifies a function to be used for Insert mode completion with CTRL-X CTRL-U. |i_CTRL-X_CTRL-U| See |complete-functions| for an explanation of how the function is invoked and what it should return. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. *'completeopt'* *'cot'* 'completeopt' 'cot' string (default: "menu,preview") global {not available when compiled without the |+insert_expand| feature} {not in Vi} A comma separated list of options for Insert mode completion |ins-completion|. The supported values are: menu Use a popup menu to show the possible completions. The menu is only shown when there is more than one match and sufficient colors are available. |ins-completion-menu| menuone Use the popup menu also when there is only one match. Useful when there is additional information about the match, e.g., what file it comes from. longest Only insert the longest common text of the matches. If the menu is displayed you can use CTRL-L to add more characters. Whether case is ignored depends on the kind of completion. For buffer text the 'ignorecase' option is used. preview Show extra information about the currently selected completion in the preview window. Only works in combination with "menu" or "menuone". *'concealcursor'* *'cocu'* 'concealcursor' 'cocu' string (default: "") local to window {not in Vi} {not available when compiled without the |+conceal| feature} Sets the modes in which text in the cursor line can also be concealed. When the current mode is listed then concealing happens just like in other lines. n Normal mode v Visual mode i Insert mode c Command line editing, for 'incsearch' 'v' applies to all lines in the Visual area, not only the cursor. A useful value is "nc". This is used in help files. So long as you are moving around text is concealed, but when starting to insert text or selecting a Visual area the concealed text is displayed, so that you can see what you are doing. Keep in mind that the cursor position is not always where it's displayed. E.g., when moving vertically it may change column. 'conceallevel' 'cole' *'conceallevel'* *'cole'* number (default 0) local to window {not in Vi} {not available when compiled without the |+conceal| feature} Determine how text with the "conceal" syntax attribute |:syn-conceal| is shown: Value Effect 0 Text is shown normally 1 Each block of concealed text is replaced with one character. If the syntax item does not have a custom replacement character defined (see |:syn-cchar|) the character defined in 'listchars' is used (default is a space). It is highlighted with the "Conceal" highlight group. 2 Concealed text is completely hidden unless it has a custom replacement character defined (see |:syn-cchar|). 3 Concealed text is completely hidden. Note: in the cursor line concealed text is not hidden, so that you can edit and copy the text. This can be changed with the 'concealcursor' option. *'confirm'* *'cf'* *'noconfirm'* *'nocf'* 'confirm' 'cf' boolean (default off) global {not in Vi} When 'confirm' is on, certain operations that would normally fail because of unsaved changes to a buffer, e.g. ":q" and ":e", instead raise a |dialog| asking if you wish to save the current file(s). You can still use a ! to unconditionally |abandon| a buffer. If 'confirm' is off you can still activate confirmation for one command only (this is most useful in mappings) with the |:confirm| command. Also see the |confirm()| function and the 'v' flag in 'guioptions'. *'conskey'* *'consk'* *'noconskey'* *'noconsk'* 'conskey' 'consk' boolean (default off) global {not in Vi} {only for MS-DOS} When on direct console I/O is used to obtain a keyboard character. This should work in most cases. Also see |'bioskey'|. Together, three methods of console input are available: 'conskey' 'bioskey' action on on or off direct console input off on BIOS off off STDIN *'copyindent'* *'ci'* *'nocopyindent'* *'noci'* 'copyindent' 'ci' boolean (default off) local to buffer {not in Vi} Copy the structure of the existing lines indent when autoindenting a new line. Normally the new indent is reconstructed by a series of tabs followed by spaces as required (unless |'expandtab'| is enabled, in which case only spaces are used). Enabling this option makes the new line copy whatever characters were used for indenting on the existing line. 'expandtab' has no effect on these characters, a Tab remains a Tab. If the new indent is greater than on the existing line, the remaining space is filled in the normal manner. NOTE: 'copyindent' is reset when 'compatible' is set. Also see 'preserveindent'. *'cpoptions'* *'cpo'* 'cpoptions' 'cpo' string (Vim default: "aABceFs", Vi default: all flags) global {not in Vi} A sequence of single character flags. When a character is present this indicates vi-compatible behavior. This is used for things where not being vi-compatible is mostly or sometimes preferred. 'cpoptions' stands for "compatible-options". Commas can be added for readability. To avoid problems with flags that are added in the future, use the "+=" and "-=" feature of ":set" |add-option-flags|. NOTE: This option is set to the Vi default value when 'compatible' is set and to the Vim default value when 'compatible' is reset. NOTE: This option is set to the POSIX default value at startup when the Vi default value would be used and the $VIM_POSIX environment variable exists |posix|. This means Vim tries to behave like the POSIX specification. contains behavior *cpo-a* a When included, a ":read" command with a file name argument will set the alternate file name for the current window. *cpo-A* A When included, a ":write" command with a file name argument will set the alternate file name for the current window. *cpo-b* b "\|" in a ":map" command is recognized as the end of the map command. The '\' is included in the mapping, the text after the '|' is interpreted as the next command. Use a CTRL-V instead of a backslash to include the '|' in the mapping. Applies to all mapping, abbreviation, menu and autocmd commands. See also |map_bar|. *cpo-B* B A backslash has no special meaning in mappings, abbreviations and the "to" part of the menu commands. Remove this flag to be able to use a backslash like a CTRL-V. For example, the command ":map X \<Esc>" results in X being mapped to: 'B' included: "\^[" (^[ is a real <Esc>) 'B' excluded: "<Esc>" (5 characters) ('<' excluded in both cases) *cpo-c* c Searching continues at the end of any match at the cursor position, but not further than the start of the next line. When not present searching continues one character from the cursor position. With 'c' "abababababab" only gets three matches when repeating "/abab", without 'c' there are five matches. *cpo-C* C Do not concatenate sourced lines that start with a backslash. See |line-continuation|. *cpo-d* d Using "./" in the 'tags' option doesn't mean to use the tags file relative to the current file, but the tags file in the current directory. *cpo-D* D Can't use CTRL-K to enter a digraph after Normal mode commands with a character argument, like |r|, |f| and |t|. *cpo-e* e When executing a register with ":@r", always add a <CR> to the last line, also when the register is not linewise. If this flag is not present, the register is not linewise and the last line does not end in a <CR>, then the last line is put on the command-line and can be edited before hitting <CR>. *cpo-E* E It is an error when using "y", "d", "c", "g~", "gu" or "gU" on an Empty region. The operators only work when at least one character is to be operate on. Example: This makes "y0" fail in the first column. *cpo-f* f When included, a ":read" command with a file name argument will set the file name for the current buffer, if the current buffer doesn't have a file name yet. *cpo-F* F When included, a ":write" command with a file name argument will set the file name for the current buffer, if the current buffer doesn't have a file name yet. Also see |cpo-P|. *cpo-g* g Goto line 1 when using ":edit" without argument. *cpo-H* H When using "I" on a line with only blanks, insert before the last blank. Without this flag insert after the last blank. *cpo-i* i When included, interrupting the reading of a file will leave it modified. *cpo-I* I When moving the cursor up or down just after inserting indent for 'autoindent', do not delete the indent. *cpo-j* j When joining lines, only add two spaces after a '.', not after '!' or '?'. Also see 'joinspaces'. *cpo-J* J A |sentence| has to be followed by two spaces after the '.', '!' or '?'. A <Tab> is not recognized as white space. *cpo-k* k Disable the recognition of raw key codes in mappings, abbreviations, and the "to" part of menu commands. For example, if <Key> sends ^[OA (where ^[ is <Esc>), the command ":map X ^[OA" results in X being mapped to: 'k' included: "^[OA" (3 characters) 'k' excluded: "<Key>" (one key code) Also see the '<' flag below. *cpo-K* K Don't wait for a key code to complete when it is halfway a mapping. This breaks mapping <F1><F1> when only part of the second <F1> has been read. It enables cancelling the mapping by typing <F1><Esc>. *cpo-l* l Backslash in a [] range in a search pattern is taken literally, only "\]", "\^", "\-" and "\\" are special. See |/[]| 'l' included: "/[ \t]" finds <Space>, '\' and 't' 'l' excluded: "/[ \t]" finds <Space> and <Tab> Also see |cpo-\|. *cpo-L* L When the 'list' option is set, 'wrapmargin', 'textwidth', 'softtabstop' and Virtual Replace mode (see |gR|) count a <Tab> as two characters, instead of the normal behavior of a <Tab>. *cpo-m* m When included, a showmatch will always wait half a second. When not included, a showmatch will wait half a second or until a character is typed. |'showmatch'| *cpo-M* M When excluded, "%" matching will take backslashes into account. Thus in "( \( )" and "\( ( \)" the outer parenthesis match. When included "%" ignores backslashes, which is Vi compatible. *cpo-n* n When included, the column used for 'number' and 'relativenumber' will also be used for text of wrapped lines. *cpo-o* o Line offset to search command is not remembered for next search. *cpo-O* O Don't complain if a file is being overwritten, even when it didn't exist when editing it. This is a protection against a file unexpectedly created by someone else. Vi didn't complain about this. *cpo-p* p Vi compatible Lisp indenting. When not present, a slightly better algorithm is used. *cpo-P* P When included, a ":write" command that appends to a file will set the file name for the current buffer, if the current buffer doesn't have a file name yet and the 'F' flag is also included |cpo-F|. *cpo-q* q When joining multiple lines leave the cursor at the position where it would be when joining two lines. *cpo-r* r Redo ("." command) uses "/" to repeat a search command, instead of the actually used search string. *cpo-R* R Remove marks from filtered lines. Without this flag marks are kept like |:keepmarks| was used. *cpo-s* s Set buffer options when entering the buffer for the first time. This is like it is in Vim version 3.0. And it is the default. If not present the options are set when the buffer is created. *cpo-S* S Set buffer options always when entering a buffer (except 'readonly', 'fileformat', 'filetype' and 'syntax'). This is the (most) Vi compatible setting. The options are set to the values in the current buffer. When you change an option and go to another buffer, the value is copied. Effectively makes the buffer options global to all buffers. 's' 'S' copy buffer options no no when buffer created yes no when buffer first entered (default) X yes each time when buffer entered (vi comp.) *cpo-t* t Search pattern for the tag command is remembered for "n" command. Otherwise Vim only puts the pattern in the history for search pattern, but doesn't change the last used search pattern. *cpo-u* u Undo is Vi compatible. See |undo-two-ways|. *cpo-v* v Backspaced characters remain visible on the screen in Insert mode. Without this flag the characters are erased from the screen right away. With this flag the screen newly typed text overwrites backspaced characters. *cpo-w* w When using "cw" on a blank character, only change one character and not all blanks until the start of the next word. *cpo-W* W Don't overwrite a readonly file. When omitted, ":w!" overwrites a readonly file, if possible. *cpo-x* x <Esc> on the command-line executes the command-line. The default in Vim is to abandon the command-line, because <Esc> normally aborts a command. |c_<Esc>| *cpo-X* X When using a count with "R" the replaced text is deleted only once. Also when repeating "R" with "." and a count. *cpo-y* y A yank command can be redone with ".". *cpo-Z* Z When using "w!" while the 'readonly' option is set, don't reset 'readonly'. *cpo-!* ! When redoing a filter command, use the last used external command, whatever it was. Otherwise the last used -filter- command is used. *cpo-$* $ When making a change to one line, don't redisplay the line, but put a '$' at the end of the changed text. The changed text will be overwritten when you type the new text. The line is redisplayed if you type any command that moves the cursor from the insertion point. *cpo-%* % Vi-compatible matching is done for the "%" command. Does not recognize "#if", "#endif", etc. Does not recognize "/*" and "*/". Parens inside single and double quotes are also counted, causing a string that contains a paren to disturb the matching. For example, in a line like "if (strcmp("foo(", s))" the first paren does not match the last one. When this flag is not included, parens inside single and double quotes are treated specially. When matching a paren outside of quotes, everything inside quotes is ignored. When matching a paren inside quotes, it will find the matching one (if there is one). This works very well for C programs. This flag is also used for other features, such as C-indenting. *cpo--* - When included, a vertical movement command fails when it would go above the first line or below the last line. Without it the cursor moves to the first or last line, unless it already was in that line. Applies to the commands "-", "k", CTRL-P, "+", "j", CTRL-N, CTRL-J and ":1234". *cpo-+* + When included, a ":write file" command will reset the 'modified' flag of the buffer, even though the buffer itself may still be different from its file. *cpo-star* * Use ":*" in the same way as ":@". When not included, ":*" is an alias for ":'<,'>", select the Visual area. *cpo-<* < Disable the recognition of special key codes in |<>| form in mappings, abbreviations, and the "to" part of menu commands. For example, the command ":map X <Tab>" results in X being mapped to: '<' included: "<Tab>" (5 characters) '<' excluded: "^I" (^I is a real <Tab>) Also see the 'k' flag above. *cpo->* > When appending to a register, put a line break before the appended text. POSIX flags. These are not included in the Vi default value, except when $VIM_POSIX was set on startup. |posix| contains behavior *cpo-#* # A count before "D", "o" and "O" has no effect. *cpo-&* & When ":preserve" was used keep the swap file when exiting normally while this buffer is still loaded. This flag is tested when exiting. *cpo-\* \ Backslash in a [] range in a search pattern is taken literally, only "\]" is special See |/[]| '\' included: "/[ \-]" finds <Space>, '\' and '-' '\' excluded: "/[ \-]" finds <Space> and '-' Also see |cpo-l|. *cpo-/* / When "%" is used as the replacement string in a |:s| command, use the previous replacement string. |:s%| *cpo-{* { The |{| and |}| commands also stop at a "{" character at the start of a line. *cpo-.* . The ":chdir" and ":cd" commands fail if the current buffer is modified, unless ! is used. Vim doesn't need this, since it remembers the full path of an opened file. *cpo-bar* | The value of the $LINES and $COLUMNS environment variables overrule the terminal size values obtained with system specific functions. *'cryptmethod'* *'cm'* 'cryptmethod' string (default "zip") global or local to buffer |global-local| {not in Vi} Method used for encryption when the buffer is written to a file: *pkzip* zip PkZip compatible method. A weak kind of encryption. Backwards compatible with Vim 7.2 and older. *blowfish* blowfish Blowfish method. Strong encryption. Requires Vim 7.3 or later, files can NOT be read by Vim 7.2 and older. This adds a "seed" to the file, every time you write the file the encrypted bytes will be different. When reading an encrypted file 'cryptmethod' will be set automatically to the detected method of the file being read. Thus if you write it without changing 'cryptmethod' the same method will be used. Changing 'cryptmethod' does not mark the file as modified, you have to explicitly write it, you don't get a warning unless there are other modifications. Also see |:X|. When setting the global value to an empty string, it will end up with the value "zip". When setting the local value to an empty string the buffer will use the global value. When a new encryption method is added in a later version of Vim, and the current version does not recognize it, you will get *E821* . You need to edit this file with the later version of Vim. *'cscopepathcomp'* *'cspc'* 'cscopepathcomp' 'cspc' number (default 0) global {not available when compiled without the |+cscope| feature} {not in Vi} Determines how many components of the path to show in a list of tags. See |cscopepathcomp|. *'cscopeprg'* *'csprg'* 'cscopeprg' 'csprg' string (default "cscope") global {not available when compiled without the |+cscope| feature} {not in Vi} Specifies the command to execute cscope. See |cscopeprg|. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. *'cscopequickfix'* *'csqf'* 'cscopequickfix' 'csqf' string (default "") global {not available when compiled without the |+cscope| or |+quickfix| features} {not in Vi} Specifies whether to use quickfix window to show cscope results. See |cscopequickfix|. *'cscopetag'* *'cst'* *'nocscopetag'* *'nocst'* 'cscopetag' 'cst' boolean (default off) global {not available when compiled without the |+cscope| feature} {not in Vi} Use cscope for tag commands. See |cscope-options|. NOTE: This option is reset when 'compatible' is set. *'cscopetagorder'* *'csto'* 'cscopetagorder' 'csto' number (default 0) global {not available when compiled without the |+cscope| feature} {not in Vi} Determines the order in which ":cstag" performs a search. See |cscopetagorder|. NOTE: This option is set to 0 when 'compatible' is set. *'cscopeverbose'* *'csverb'* *'nocscopeverbose'* *'nocsverb'* 'cscopeverbose' 'csverb' boolean (default off) global {not available when compiled without the |+cscope| feature} {not in Vi} Give messages when adding a cscope database. See |cscopeverbose|. NOTE: This option is reset when 'compatible' is set. *'cursorbind'* *'crb'* *'nocursorbind'* *'nocrb'* 'cursorbind' 'crb' boolean (default off) local to window {not in Vi} {not available when compiled without the |+cursorbind| feature} When this option is set, as the cursor in the current window moves other cursorbound windows (windows that also have this option set) move their cursors to the corresponding line and column. This option is useful for viewing the differences between two versions of a file (see 'diff'); in diff mode, inserted and deleted lines (though not characters within a line) are taken into account. *'cursorcolumn'* *'cuc'* *'nocursorcolumn'* *'nocuc'* 'cursorcolumn' 'cuc' boolean (default off) local to window {not in Vi} {not available when compiled without the |+syntax| feature} Highlight the screen column of the cursor with CursorColumn |hl-CursorColumn|. Useful to align text. Will make screen redrawing slower. If you only want the highlighting in the current window you can use these autocommands: au WinLeave * set nocursorline nocursorcolumn au WinEnter * set cursorline cursorcolumn *'cursorline'* *'cul'* *'nocursorline'* *'nocul'* 'cursorline' 'cul' boolean (default off) local to window {not in Vi} {not available when compiled without the |+syntax| feature} Highlight the screen line of the cursor with CursorLine |hl-CursorLine|. Useful to easily spot the cursor. Will make screen redrawing slower. When Visual mode is active the highlighting isn't used to make it easier to see the selected text. *'debug'* 'debug' string (default "") global {not in Vi} These values can be used: msg Error messages that would otherwise be omitted will be given anyway. throw Error messages that would otherwise be omitted will be given anyway and also throw an exception and set |v:errmsg|. beep A message will be given when otherwise only a beep would be produced. The values can be combined, separated by a comma. "msg" and "throw" are useful for debugging 'foldexpr', 'formatexpr' or 'indentexpr'. *'define'* *'def'* 'define' 'def' string (default "^\s*#\s*define") global or local to buffer |global-local| {not in Vi} Pattern to be used to find a macro definition. It is a search pattern, just like for the "/" command. This option is used for the commands like "[i" and "[d" |include-search|. The 'isident' option is used to recognize the defined name after the match: {match with 'define'}{non-ID chars}{defined name}{non-ID char} See |option-backslash| about inserting backslashes to include a space or backslash. The default value is for C programs. For C++ this value would be useful, to include const type declarations: ^\(#\s*define\|[a-z]*\s*const\s*[a-z]*\) When using the ":set" command, you need to double the backslashes! *'delcombine'* *'deco'* *'nodelcombine'* *'nodeco'* 'delcombine' 'deco' boolean (default off) global {not in Vi} {only available when compiled with the |+multi_byte| feature} If editing Unicode and this option is set, backspace and Normal mode "x" delete each combining character on its own. When it is off (the default) the character along with its combining characters are deleted. Note: When 'delcombine' is set "xx" may work different from "2x"! This is useful for Arabic, Hebrew and many other languages where one may have combining characters overtop of base characters, and want to remove only the combining ones. *'dictionary'* *'dict'* 'dictionary' 'dict' string (default "") global or local to buffer |global-local| {not in Vi} List of file names, separated by commas, that are used to lookup words for keyword completion commands |i_CTRL-X_CTRL-K|. Each file should contain a list of words. This can be one word per line, or several words per line, separated by non-keyword characters (white space is preferred). Maximum line length is 510 bytes. When this option is empty, or an entry "spell" is present, spell checking is enabled the currently active spelling is used. |spell| To include a comma in a file name precede it with a backslash. Spaces after a comma are ignored, otherwise spaces are included in the file name. See |option-backslash| about using backslashes. This has nothing to do with the |Dictionary| variable type. Where to find a list of words? - On FreeBSD, there is the file "/usr/share/dict/words". - In the Simtel archive, look in the "msdos/linguist" directory. - In "miscfiles" of the GNU collection. The use of |:set+=| and |:set-=| is preferred when adding or removing directories from the list. This avoids problems when a future version uses another default. Backticks cannot be used in this option for security reasons. *'diff'* *'nodiff'* 'diff' boolean (default off) local to window {not in Vi} {not available when compiled without the |+diff| feature} Join the current window in the group of windows that shows differences between files. See |vimdiff|. *'dex'* *'diffexpr'* 'diffexpr' 'dex' string (default "") global {not in Vi} {not available when compiled without the |+diff| feature} Expression which is evaluated to obtain an ed-style diff file from two versions of a file. See |diff-diffexpr|. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. *'dip'* *'diffopt'* 'diffopt' 'dip' string (default "filler") global {not in Vi} {not available when compiled without the |+diff| feature} Option settings for diff mode. It can consist of the following items. All are optional. Items must be separated by a comma. filler Show filler lines, to keep the text synchronized with a window that has inserted lines at the same position. Mostly useful when windows are side-by-side and 'scrollbind' is set. context:{n} Use a context of {n} lines between a change and a fold that contains unchanged lines. When omitted a context of six lines is used. See |fold-diff|. icase Ignore changes in case of text. "a" and "A" are considered the same. Adds the "-i" flag to the "diff" command if 'diffexpr' is empty. iwhite Ignore changes in amount of white space. Adds the "-b" flag to the "diff" command if 'diffexpr' is empty. Check the documentation of the "diff" command for what this does exactly. It should ignore adding trailing white space, but not leading white space. horizontal Start diff mode with horizontal splits (unless explicitly specified otherwise). vertical Start diff mode with vertical splits (unless explicitly specified otherwise). foldcolumn:{n} Set the 'foldcolumn' option to {n} when starting diff mode. Without this 2 is used. Examples: :set diffopt=filler,context:4 :set diffopt= :set diffopt=filler,foldcolumn:3 *'digraph'* *'dg'* *'nodigraph'* *'nodg'* 'digraph' 'dg' boolean (default off) global {not in Vi} {not available when compiled without the |+digraphs| feature} Enable the entering of digraphs in Insert mode with {char1} <BS> {char2}. See |digraphs|. NOTE: This option is reset when 'compatible' is set. *'directory'* *'dir'* 'directory' 'dir' string (default for Amiga: ".,t:", for MS-DOS and Win32: ".,c:\tmp,c:\temp" for Unix: ".,~/tmp,/var/tmp,/tmp") global List of directory names for the swap file, separated with commas. - The swap file will be created in the first directory where this is possible. - Empty means that no swap file will be used (recovery is impossible!). - A directory "." means to put the swap file in the same directory as the edited file. On Unix, a dot is prepended to the file name, so it doesn't show in a directory listing. On MS-Windows the "hidden" attribute is set and a dot prepended if possible. - A directory starting with "./" (or ".\" for MS-DOS et al.) means to put the swap file relative to where the edited file is. The leading "." is replaced with the path name of the edited file. - For Unix and Win32, if a directory ends in two path separators "//" or "\\", the swap file name will be built from the complete path to the file with all path separators substituted to percent '%' signs. This will ensure file name uniqueness in the preserve directory. On Win32, when a separating comma is following, you must use "//", since "\\" will include the comma in the file name. - Spaces after the comma are ignored, other spaces are considered part of the directory name. To have a space at the start of a directory name, precede it with a backslash. - To include a comma in a directory name precede it with a backslash. - A directory name may end in an ':' or '/'. - Environment variables are expanded |:set_env|. - Careful with '\' characters, type one before a space, type two to get one in the option (see |option-backslash|), for example: :set dir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces - For backwards compatibility with Vim version 3.0 a '>' at the start of the option is removed. Using "." first in the list is recommended. This means that editing the same file twice will result in a warning. Using "/tmp" on Unix is discouraged: When the system crashes you lose the swap file. "/var/tmp" is often not cleared when rebooting, thus is a better choice than "/tmp". But it can contain a lot of files, your swap files get lost in the crowd. That is why a "tmp" directory in your home directory is tried first. The use of |:set+=| and |:set-=| is preferred when adding or removing directories from the list. This avoids problems when a future version uses another default. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. {Vi: directory to put temp file in, defaults to "/tmp"} *'display'* *'dy'* 'display' 'dy' string (default "") global {not in Vi} Change the way text is displayed. This is comma separated list of flags: lastline When included, as much as possible of the last line in a window will be displayed. When not included, a last line that doesn't fit is replaced with "@" lines. uhex Show unprintable characters hexadecimal as <xx> instead of using ^C and ~C. *'eadirection'* *'ead'* 'eadirection' 'ead' string (default "both") global {not in Vi} {not available when compiled without the |+vertsplit| feature} Tells when the 'equalalways' option applies: ver vertically, width of windows is not affected hor horizontally, height of windows is not affected both width and height of windows is affected *'ed'* *'edcompatible'* *'noed'* *'noedcompatible'* 'edcompatible' 'ed' boolean (default off) global Makes the 'g' and 'c' flags of the ":substitute" command to be toggled each time the flag is given. See |complex-change|. See also 'gdefault' option. Switching this option on is discouraged! *'encoding'* *'enc'* *E543* 'encoding' 'enc' string (default: "latin1" or value from $LANG) global {only available when compiled with the |+multi_byte| feature} {not in Vi} Sets the character encoding used inside Vim. It applies to text in the buffers, registers, Strings in expressions, text stored in the viminfo file, etc. It sets the kind of characters which Vim can work with. See |encoding-names| for the possible values. NOTE: Changing this option will not change the encoding of the existing text in Vim. It may cause non-ASCII text to become invalid. It should normally be kept at its default value, or set when Vim starts up. See |multibyte|. To reload the menus see |:menutrans|. This option cannot be set from a |modeline|. It would most likely corrupt the text. NOTE: For GTK+ 2 it is highly recommended to set 'encoding' to "utf-8". Although care has been taken to allow different