Hirohito Higashi | 73b9650 | 2025-06-28 18:18:21 +0200 | [diff] [blame] | 1 | *options.txt* For Vim version 9.1. Last change: 2025 Jun 28 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2 | |
| 3 | |
| 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
| 5 | |
| 6 | |
| 7 | Options *options* |
| 8 | |
| 9 | 1. Setting options |set-option| |
| 10 | 2. Automatically setting options |auto-setting| |
| 11 | 3. Options summary |option-summary| |
| 12 | |
Bram Moolenaar | 2ec618c | 2016-10-01 14:47:05 +0200 | [diff] [blame] | 13 | For an overview of options see quickref.txt |option-list|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 14 | |
| 15 | Vim has a number of internal variables and switches which can be set to |
| 16 | achieve special effects. These options come in three forms: |
| 17 | boolean can only be on or off *boolean* *toggle* |
| 18 | number has a numeric value |
| 19 | string has a string value |
| 20 | |
| 21 | ============================================================================== |
Bram Moolenaar | f75a963 | 2005-09-13 21:20:47 +0000 | [diff] [blame] | 22 | 1. Setting options *set-option* *E764* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 23 | |
| 24 | *:se* *:set* |
Bram Moolenaar | 6b915c0 | 2020-01-18 15:53:19 +0100 | [diff] [blame] | 25 | :se[t][!] Show all options that differ from their default value. |
| 26 | When [!] is present every option is on a separate |
| 27 | line. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 28 | |
Bram Moolenaar | 6b915c0 | 2020-01-18 15:53:19 +0100 | [diff] [blame] | 29 | :se[t][!] all Show all but terminal options. |
| 30 | When [!] is present every option is on a separate |
| 31 | line. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 32 | |
| 33 | :se[t] termcap Show all terminal options. Note that in the GUI the |
| 34 | key codes are not shown, because they are generated |
| 35 | internally and can't be changed. Changing the terminal |
| 36 | codes in the GUI is not useful either... |
Bram Moolenaar | f1dcd14 | 2022-12-31 15:30:45 +0000 | [diff] [blame] | 37 | The options have the form t_AB, see |
| 38 | |terminal-options|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 39 | |
Bram Moolenaar | 4700398 | 2021-12-05 21:54:04 +0000 | [diff] [blame] | 40 | :se[t]! termcap Idem, but don't use multiple columns. |
| 41 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 42 | *E518* *E519* |
| 43 | :se[t] {option}? Show value of {option}. |
| 44 | |
| 45 | :se[t] {option} Toggle option: set, switch it on. |
| 46 | Number option: show value. |
| 47 | String option: show value. |
| 48 | |
| 49 | :se[t] no{option} Toggle option: Reset, switch it off. |
| 50 | |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 51 | *:set-!* *:set-inv* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 52 | :se[t] {option}! or |
Bram Moolenaar | 6c60f47 | 2019-04-28 16:00:35 +0200 | [diff] [blame] | 53 | :se[t] inv{option} Toggle option: Invert value. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 54 | |
| 55 | *:set-default* *:set-&* *:set-&vi* *:set-&vim* |
| 56 | :se[t] {option}& Reset option to its default value. May depend on the |
Bram Moolenaar | 6c60f47 | 2019-04-28 16:00:35 +0200 | [diff] [blame] | 57 | current value of 'compatible'. |
| 58 | :se[t] {option}&vi Reset option to its Vi default value. |
| 59 | :se[t] {option}&vim Reset option to its Vim default value. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 60 | |
Bram Moolenaar | 22f1d0e | 2018-02-27 14:53:30 +0100 | [diff] [blame] | 61 | :se[t] all& Set all options to their default value. The values of |
Bram Moolenaar | 88774fd | 2015-08-25 19:52:04 +0200 | [diff] [blame] | 62 | these options are not changed: |
| 63 | all terminal options, starting with t_ |
| 64 | 'columns' |
| 65 | 'cryptmethod' |
| 66 | 'encoding' |
| 67 | 'key' |
| 68 | 'lines' |
| 69 | 'term' |
| 70 | 'ttymouse' |
| 71 | 'ttytype' |
| 72 | Warning: This may have a lot of side effects. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 73 | |
h_east | 5985879 | 2023-10-25 22:47:05 +0900 | [diff] [blame] | 74 | *:set-args* *:set=* *E487* *E521* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 75 | :se[t] {option}={value} or |
| 76 | :se[t] {option}:{value} |
| 77 | Set string or number option to {value}. |
| 78 | For numeric options the value can be given in decimal, |
Doug Kearns | ddbb6fe | 2024-07-24 20:21:22 +0200 | [diff] [blame] | 79 | hex (preceded with 0x) or octal (preceded with '0' or |
| 80 | '0o'). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 81 | The old value can be inserted by typing 'wildchar' (by |
| 82 | default this is a <Tab> or CTRL-E if 'compatible' is |
Yee Cheng Chin | 900894b | 2023-09-29 20:42:32 +0200 | [diff] [blame] | 83 | set). Many string options with fixed syntax and names |
| 84 | also support completing known values. See |
| 85 | |cmdline-completion| and |complete-set-option|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 86 | White space between {option} and '=' is allowed and |
| 87 | will be ignored. White space between '=' and {value} |
| 88 | is not allowed. |
| 89 | See |option-backslash| for using white space and |
| 90 | backslashes in {value}. |
| 91 | |
| 92 | :se[t] {option}+={value} *:set+=* |
| 93 | Add the {value} to a number option, or append the |
| 94 | {value} to a string option. When the option is a |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 95 | comma-separated list, a comma is added, unless the |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 96 | value was empty. |
| 97 | If the option is a list of flags, superfluous flags |
Bram Moolenaar | a5792f5 | 2005-11-23 21:25:05 +0000 | [diff] [blame] | 98 | are removed. When adding a flag that was already |
| 99 | present the option value doesn't change. |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 100 | Also see |:set-args| above. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 101 | |
| 102 | :se[t] {option}^={value} *:set^=* |
| 103 | Multiply the {value} to a number option, or prepend |
| 104 | the {value} to a string option. When the option is a |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 105 | comma-separated list, a comma is added, unless the |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 106 | value was empty. |
| 107 | Also see |:set-args| above. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 108 | |
| 109 | :se[t] {option}-={value} *:set-=* |
| 110 | Subtract the {value} from a number option, or remove |
| 111 | the {value} from a string option, if it is there. |
| 112 | If the {value} is not found in a string option, there |
| 113 | is no error or warning. When the option is a comma |
| 114 | separated list, a comma is deleted, unless the option |
| 115 | becomes empty. |
| 116 | When the option is a list of flags, {value} must be |
| 117 | exactly as they appear in the option. Remove flags |
| 118 | one by one to avoid problems. |
Yee Cheng Chin | 900894b | 2023-09-29 20:42:32 +0200 | [diff] [blame] | 119 | The individual values from a comma separated list or |
| 120 | list of flags can be inserted by typing 'wildchar'. |
| 121 | See |complete-set-option|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 122 | Also see |:set-args| above. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 123 | |
| 124 | The {option} arguments to ":set" may be repeated. For example: > |
| 125 | :set ai nosi sw=3 ts=3 |
| 126 | If you make an error in one of the arguments, an error message will be given |
| 127 | and the following arguments will be ignored. |
| 128 | |
| 129 | *:set-verbose* |
| 130 | When 'verbose' is non-zero, displaying an option value will also tell where it |
| 131 | was last set. Example: > |
| 132 | :verbose set shiftwidth cindent? |
Bram Moolenaar | 95bafa2 | 2018-10-02 13:26:25 +0200 | [diff] [blame] | 133 | < shiftwidth=4 ~ |
| 134 | Last set from modeline line 1 ~ |
| 135 | cindent ~ |
| 136 | Last set from /usr/local/share/vim/vim60/ftplugin/c.vim line 30 ~ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 137 | This is only done when specific option values are requested, not for ":verbose |
| 138 | set all" or ":verbose set" without an argument. |
| 139 | When the option was set by hand there is no "Last set" message. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 140 | When the option was set while executing a function, user command or |
| 141 | autocommand, the script in which it was defined is reported. |
| 142 | Note that an option may also have been set as a side effect of setting |
| 143 | 'compatible'. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 144 | A few special texts: |
Bram Moolenaar | 95bafa2 | 2018-10-02 13:26:25 +0200 | [diff] [blame] | 145 | Last set from modeline line 1 ~ |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 146 | Option was set in a |modeline|. |
| 147 | Last set from --cmd argument ~ |
| 148 | Option was set with command line argument |--cmd| or +. |
| 149 | Last set from -c argument ~ |
| 150 | Option was set with command line argument |-c|, +, |-S| or |
| 151 | |-q|. |
| 152 | Last set from environment variable ~ |
| 153 | Option was set from an environment variable, $VIMINIT, |
| 154 | $GVIMINIT or $EXINIT. |
| 155 | Last set from error handler ~ |
| 156 | Option was cleared when evaluating it resulted in an error. |
| 157 | |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 158 | {not available when compiled without the |+eval| feature} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 159 | |
| 160 | *:set-termcap* *E522* |
Bram Moolenaar | 1d2ba7f | 2006-02-14 22:29:30 +0000 | [diff] [blame] | 161 | For {option} the form "t_xx" may be used to set a terminal option. This will |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 162 | override the value from the termcap. You can then use it in a mapping. If |
| 163 | the "xx" part contains special characters, use the <t_xx> form: > |
| 164 | :set <t_#4>=^[Ot |
| 165 | This can also be used to translate a special code for a normal key. For |
| 166 | example, if Alt-b produces <Esc>b, use this: > |
| 167 | :set <M-b>=^[b |
| 168 | (the ^[ is a real <Esc> here, use CTRL-V <Esc> to enter it) |
| 169 | The advantage over a mapping is that it works in all situations. |
| 170 | |
Bram Moolenaar | 0b2f94d | 2011-03-22 14:35:05 +0100 | [diff] [blame] | 171 | You can define any key codes, e.g.: > |
| 172 | :set t_xy=^[foo; |
| 173 | There is no warning for using a name that isn't recognized. You can map these |
| 174 | codes as you like: > |
| 175 | :map <t_xy> something |
| 176 | < *E846* |
| 177 | When a key code is not set, it's like it does not exist. Trying to get its |
| 178 | value will result in an error: > |
| 179 | :set t_kb= |
| 180 | :set t_kb |
Bram Moolenaar | 6f4754b | 2022-01-23 12:07:04 +0000 | [diff] [blame] | 181 | < E846: Key code not set: t_kb ~ |
Bram Moolenaar | 0b2f94d | 2011-03-22 14:35:05 +0100 | [diff] [blame] | 182 | |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 183 | The t_xx options cannot be set from a |modeline| or in the |sandbox|, for |
| 184 | security reasons. |
| 185 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 186 | The listing from ":set" looks different from Vi. Long string options are put |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 187 | at the end of the list. The number of options is quite large. The output of |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 188 | "set all" probably does not fit on the screen, causing Vim to give the |
| 189 | |more-prompt|. |
| 190 | |
| 191 | *option-backslash* |
| 192 | To include white space in a string option value it has to be preceded with a |
| 193 | backslash. To include a backslash you have to use two. Effectively this |
| 194 | means that the number of backslashes in an option value is halved (rounded |
| 195 | down). |
Yee Cheng Chin | 5484485 | 2023-10-09 18:12:31 +0200 | [diff] [blame] | 196 | In options 'path', 'cdpath', and 'tags', spaces have to be preceded with three |
| 197 | backslashes instead for compatibility with version 3.0 where the options can |
| 198 | be separated by either commas or spaces. |
| 199 | Comma-separated options like 'backupdir' and 'tags' will also require commas |
| 200 | to be escaped with two backslashes, whereas this is not needed for |
| 201 | non-comma-separated ones like 'makeprg'. |
| 202 | When setting options using |:let| and |literal-string|, you need to use one |
| 203 | fewer layer of backslash. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 204 | A few examples: > |
Yee Cheng Chin | 5484485 | 2023-10-09 18:12:31 +0200 | [diff] [blame] | 205 | :set makeprg=make\ file results in "make file" |
| 206 | :let &makeprg='make file' (same as above) |
| 207 | :set makeprg=make\\\ file results in "make\ file" |
| 208 | :set tags=tags\ /usr/tags results in "tags" and "/usr/tags" |
| 209 | :set tags=tags\\\ file results in "tags file" |
| 210 | :let &tags='tags\ file' (same as above) |
| 211 | |
| 212 | :set makeprg=make,file results in "make,file" |
| 213 | :set makeprg=make\\,file results in "make\,file" |
| 214 | :set tags=tags,file results in "tags" and "file" |
Qiming zhao | ab2fe65 | 2025-04-12 11:40:17 +0200 | [diff] [blame] | 215 | :set tags=tags\\,file results in "tags\,file" |
Yee Cheng Chin | 5484485 | 2023-10-09 18:12:31 +0200 | [diff] [blame] | 216 | :let &tags='tags\,file' (same as above) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 217 | |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 218 | The "|" character separates a ":set" command from a following command. To |
| 219 | include the "|" in the option value, use "\|" instead. This example sets the |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 220 | 'titlestring' option to "hi|there": > |
| 221 | :set titlestring=hi\|there |
| 222 | This sets the 'titlestring' option to "hi" and 'iconstring' to "there": > |
| 223 | :set titlestring=hi|set iconstring=there |
| 224 | |
Bram Moolenaar | 89a9c15 | 2021-08-29 21:55:35 +0200 | [diff] [blame] | 225 | Similarly, in legacy script the double quote character starts a comment. To |
| 226 | include the '"' in the option value, use '\"' instead. This example sets the |
| 227 | 'titlestring' option to 'hi "there"': > |
Bram Moolenaar | 7df351e | 2006-01-23 22:30:28 +0000 | [diff] [blame] | 228 | :set titlestring=hi\ \"there\" |
| 229 | |
Bram Moolenaar | 89a9c15 | 2021-08-29 21:55:35 +0200 | [diff] [blame] | 230 | In |Vim9| script it's simpler, comments start with a '#' character, and only |
| 231 | when preceded by white space. A backslash is needed less often: > |
| 232 | vim9script |
| 233 | set titlestring=hi\ "there" |
| 234 | set titlestring=hi#there# |
| 235 | set titlestring=hi\ \#there# |
| 236 | |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 237 | For Win32 backslashes in file names are mostly not removed. More precise: For |
| 238 | options that expect a file name (those where environment variables are |
| 239 | expanded) a backslash before a normal file name character is not removed. But |
| 240 | a backslash before a special character (space, backslash, comma, etc.) is used |
| 241 | like explained above. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 242 | There is one special situation, when the value starts with "\\": > |
| 243 | :set dir=\\machine\path results in "\\machine\path" |
| 244 | :set dir=\\\\machine\\path results in "\\machine\path" |
| 245 | :set dir=\\path\\file results in "\\path\file" (wrong!) |
| 246 | For the first one the start is kept, but for the second one the backslashes |
| 247 | are halved. This makes sure it works both when you expect backslashes to be |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 248 | halved and when you expect the backslashes to be kept. The third gives a |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 249 | result which is probably not what you want. Avoid it. |
| 250 | |
| 251 | *add-option-flags* *remove-option-flags* |
| 252 | *E539* *E550* *E551* *E552* |
| 253 | Some options are a list of flags. When you want to add a flag to such an |
| 254 | option, without changing the existing ones, you can do it like this: > |
| 255 | :set guioptions+=a |
| 256 | Remove a flag from an option like this: > |
| 257 | :set guioptions-=a |
| 258 | This removes the 'a' flag from 'guioptions'. |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 259 | Note that you should add or remove one flag at a time. If 'guioptions' has |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 260 | the value "ab", using "set guioptions-=ba" won't work, because the string "ba" |
| 261 | doesn't appear. |
| 262 | |
| 263 | *:set_env* *expand-env* *expand-environment-var* |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 264 | Environment variables in specific string options will be expanded. If the |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 265 | environment variable exists the '$' and the following environment variable |
| 266 | name is replaced with its value. If it does not exist the '$' and the name |
| 267 | are not modified. Any non-id character (not a letter, digit or '_') may |
| 268 | follow the environment variable name. That character and what follows is |
| 269 | appended to the value of the environment variable. Examples: > |
| 270 | :set term=$TERM.new |
| 271 | :set path=/usr/$INCLUDE,$HOME/include,. |
| 272 | When adding or removing a string from an option with ":set opt-=val" or ":set |
| 273 | opt+=val" the expansion is done before the adding or removing. |
| 274 | |
| 275 | |
| 276 | Handling of local options *local-options* |
| 277 | |
Christian Brabandt | 4a8eb6e | 2023-08-13 19:43:42 +0200 | [diff] [blame] | 278 | Note: The following also applies to |global-local| options. |
| 279 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 280 | Some of the options only apply to a window or buffer. Each window or buffer |
Bram Moolenaar | 5162822 | 2016-12-01 23:03:28 +0100 | [diff] [blame] | 281 | has its own copy of this option, thus each can have its own value. This |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 282 | allows you to set 'list' in one window but not in another. And set |
| 283 | 'shiftwidth' to 3 in one buffer and 4 in another. |
| 284 | |
| 285 | The following explains what happens to these local options in specific |
| 286 | situations. You don't really need to know all of this, since Vim mostly uses |
| 287 | the option values you would expect. Unfortunately, doing what the user |
| 288 | expects is a bit complicated... |
| 289 | |
| 290 | When splitting a window, the local options are copied to the new window. Thus |
| 291 | right after the split the contents of the two windows look the same. |
| 292 | |
| 293 | When editing a new buffer, its local option values must be initialized. Since |
| 294 | the local options of the current buffer might be specifically for that buffer, |
| 295 | these are not used. Instead, for each buffer-local option there also is a |
| 296 | global value, which is used for new buffers. With ":set" both the local and |
| 297 | global value is changed. With "setlocal" only the local value is changed, |
| 298 | thus this value is not used when editing a new buffer. |
| 299 | |
Bram Moolenaar | 95ec9d6 | 2016-08-12 18:29:59 +0200 | [diff] [blame] | 300 | When editing a buffer that has been edited before, the options from the window |
| 301 | that was last closed are used again. If this buffer has been edited in this |
| 302 | window, the values from back then are used. Otherwise the values from the |
| 303 | last closed window where the buffer was edited last are used. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 304 | |
| 305 | It's possible to set a local window option specifically for a type of buffer. |
| 306 | When you edit another buffer in the same window, you don't want to keep |
| 307 | using these local window options. Therefore Vim keeps a global value of the |
| 308 | local window options, which is used when editing another buffer. Each window |
| 309 | has its own copy of these values. Thus these are local to the window, but |
| 310 | global to all buffers in the window. With this you can do: > |
| 311 | :e one |
| 312 | :set list |
| 313 | :e two |
| 314 | Now the 'list' option will also be set in "two", since with the ":set list" |
| 315 | command you have also set the global value. > |
| 316 | :set nolist |
| 317 | :e one |
| 318 | :setlocal list |
| 319 | :e two |
| 320 | Now the 'list' option is not set, because ":set nolist" resets the global |
| 321 | value, ":setlocal list" only changes the local value and ":e two" gets the |
| 322 | global value. Note that if you do this next: > |
| 323 | :e one |
Bram Moolenaar | 531da59 | 2013-05-06 05:58:55 +0200 | [diff] [blame] | 324 | You will get back the 'list' value as it was the last time you edited "one". |
| 325 | The options local to a window are remembered for each buffer. This also |
| 326 | happens when the buffer is not loaded, but they are lost when the buffer is |
| 327 | wiped out |:bwipe|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 328 | |
Christian Brabandt | 596ad66 | 2023-08-16 00:11:09 +0200 | [diff] [blame] | 329 | Special local window options *local-noglobal* |
Christian Brabandt | 4a8eb6e | 2023-08-13 19:43:42 +0200 | [diff] [blame] | 330 | |
| 331 | The following local window options won't be copied over when new windows are |
| 332 | created, thus they behave slightly differently: |
| 333 | |
| 334 | Option Reason ~ |
| 335 | 'previewwindow' there can only be a single one |
| 336 | 'scroll' specific to existing window |
zeertzjq | 0049a49 | 2024-03-11 23:13:16 +0800 | [diff] [blame] | 337 | 'winfixbuf' specific to existing window |
Christian Brabandt | 4a8eb6e | 2023-08-13 19:43:42 +0200 | [diff] [blame] | 338 | 'winfixheight' specific to existing window |
| 339 | 'winfixwidth' specific to existing window |
| 340 | |
Christian Brabandt | 596ad66 | 2023-08-16 00:11:09 +0200 | [diff] [blame] | 341 | Special local buffer options |
Christian Brabandt | 4a8eb6e | 2023-08-13 19:43:42 +0200 | [diff] [blame] | 342 | |
| 343 | The following local buffer options won't be copied over when new buffers are |
| 344 | created, thus they behave slightly differently: |
| 345 | |
| 346 | Option Reason ~ |
| 347 | 'filetype' explicitly set by autocommands |
| 348 | 'syntax' explicitly set by autocommands |
| 349 | 'bufhidden' denote |special-buffers| |
| 350 | 'buftype' denote |special-buffers| |
| 351 | 'readonly' will be detected automatically |
| 352 | 'modified' will be detected automatically |
| 353 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 354 | *:setl* *:setlocal* |
Bram Moolenaar | 6b915c0 | 2020-01-18 15:53:19 +0100 | [diff] [blame] | 355 | :setl[ocal][!] ... Like ":set" but set only the value local to the |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 356 | current buffer or window. Not all options have a |
| 357 | local value. If the option does not have a local |
| 358 | value the global value is set. |
Bram Moolenaar | c330187 | 2010-07-25 20:53:06 +0200 | [diff] [blame] | 359 | With the "all" argument: display local values for all |
| 360 | local options. |
| 361 | Without argument: Display local values for all local |
| 362 | options which are different from the default. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 363 | When displaying a specific local option, show the |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 364 | local value. For a global/local boolean option, when |
| 365 | the global value is being used, "--" is displayed |
| 366 | before the option name. |
| 367 | For a global option the global value is |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 368 | shown (but that might change in the future). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 369 | |
Matt Ellis | 374e26a | 2024-02-24 17:02:43 +0100 | [diff] [blame] | 370 | :se[t] {option}< Set the effective value of {option} to its global |
zeertzjq | d086b8f | 2024-02-25 15:42:52 +0800 | [diff] [blame] | 371 | value. |
Matt Ellis | 374e26a | 2024-02-24 17:02:43 +0100 | [diff] [blame] | 372 | For string |global-local| options, the local value is |
| 373 | removed, so that the global value will be used. |
| 374 | For all other options, the global value is copied to |
| 375 | the local value. |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 376 | |
Matt Ellis | 374e26a | 2024-02-24 17:02:43 +0100 | [diff] [blame] | 377 | :setl[ocal] {option}< Set the effective value of {option} to its global |
zeertzjq | d086b8f | 2024-02-25 15:42:52 +0800 | [diff] [blame] | 378 | value. |
Matt Ellis | 374e26a | 2024-02-24 17:02:43 +0100 | [diff] [blame] | 379 | For number and boolean |global-local| options, the |
| 380 | local value is removed, so that the global value will |
| 381 | be used. |
| 382 | For all other options, including string |global-local| |
| 383 | options, the global value is copied to the local |
| 384 | value. |
| 385 | |
| 386 | Note that the behaviour for |global-local| options is slightly different |
| 387 | between string and number-based options. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 388 | |
| 389 | *:setg* *:setglobal* |
Bram Moolenaar | 6b915c0 | 2020-01-18 15:53:19 +0100 | [diff] [blame] | 390 | :setg[lobal][!] ... Like ":set" but set only the global value for a local |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 391 | option without changing the local value. |
| 392 | When displaying an option, the global value is shown. |
Bram Moolenaar | c330187 | 2010-07-25 20:53:06 +0200 | [diff] [blame] | 393 | With the "all" argument: display global values for all |
| 394 | local options. |
| 395 | Without argument: display global values for all local |
| 396 | options which are different from the default. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 397 | |
| 398 | For buffer-local and window-local options: |
Milly | d9af78b | 2024-09-26 15:54:43 +0200 | [diff] [blame] | 399 | Command global value local value condition ~ |
| 400 | :set option=value set set |
| 401 | :setlocal option=value - set |
| 402 | :setglobal option=value set - |
| 403 | :set option? - display local value is set |
| 404 | :set option? display - local value is not set |
| 405 | :setlocal option? - display |
| 406 | :setglobal option? display - |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 407 | |
| 408 | |
| 409 | Global options with a local value *global-local* |
| 410 | |
Bram Moolenaar | b5bf5b8 | 2004-12-24 14:35:23 +0000 | [diff] [blame] | 411 | Options are global when you mostly use one value for all buffers and windows. |
| 412 | For some global options it's useful to sometimes have a different local value. |
| 413 | You can set the local value with ":setlocal". That buffer or window will then |
| 414 | use the local value, while other buffers and windows continue using the global |
| 415 | value. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 416 | |
| 417 | For example, you have two windows, both on C source code. They use the global |
| 418 | 'makeprg' option. If you do this in one of the two windows: > |
| 419 | :set makeprg=gmake |
| 420 | then the other window will switch to the same value. There is no need to set |
| 421 | the 'makeprg' option in the other C source window too. |
| 422 | However, if you start editing a Perl file in a new window, you want to use |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 423 | another 'makeprg' for it, without changing the value used for the C source |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 424 | files. You use this command: > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 425 | :setlocal makeprg=perlmake |
| 426 | You can switch back to using the global value by making the local value empty: > |
| 427 | :setlocal makeprg= |
Bram Moolenaar | 314dd79 | 2019-02-03 15:27:20 +0100 | [diff] [blame] | 428 | This only works for a string option. For a number or boolean option you need |
| 429 | to use the "<" flag, like this: > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 430 | :setlocal autoread< |
Bram Moolenaar | 314dd79 | 2019-02-03 15:27:20 +0100 | [diff] [blame] | 431 | Note that for non-boolean and non-number options using "<" copies the global |
| 432 | value to the local value, it doesn't switch back to using the global value |
| 433 | (that matters when the global value changes later). You can also use: > |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 434 | :set path< |
| 435 | This will make the local value of 'path' empty, so that the global value is |
| 436 | used. Thus it does the same as: > |
| 437 | :setlocal path= |
Bram Moolenaar | 2f0936c | 2022-01-08 21:51:59 +0000 | [diff] [blame] | 438 | Note: In the future more global options can be made |global-local|. Using |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 439 | ":setlocal" on a global option might work differently then. |
| 440 | |
Yegappan Lakshmanan | 777175b | 2021-11-18 22:08:57 +0000 | [diff] [blame] | 441 | *option-value-function* |
Yegappan Lakshmanan | a13f3a4 | 2024-11-02 18:40:10 +0100 | [diff] [blame] | 442 | Some options ('completefunc', 'findfunc', 'imactivatefunc', 'imstatusfunc', |
| 443 | 'omnifunc', 'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc') |
| 444 | are set to a function name or a function reference or a lambda function. When |
| 445 | using a lambda it will be converted to the name, e.g. "<lambda>123". |
| 446 | Examples: |
Yegappan Lakshmanan | 777175b | 2021-11-18 22:08:57 +0000 | [diff] [blame] | 447 | > |
| 448 | set opfunc=MyOpFunc |
Yegappan Lakshmanan | 19916a8 | 2021-11-24 16:32:55 +0000 | [diff] [blame] | 449 | set opfunc=function('MyOpFunc') |
| 450 | set opfunc=funcref('MyOpFunc') |
Yegappan Lakshmanan | 05e59e3 | 2021-12-01 10:30:07 +0000 | [diff] [blame] | 451 | set opfunc={a\ ->\ MyOpFunc(a)} |
Bram Moolenaar | 1fca5f3 | 2022-02-18 17:50:47 +0000 | [diff] [blame] | 452 | |
| 453 | Set to a script-local function: > |
| 454 | set opfunc=s:MyLocalFunc |
| 455 | set opfunc=<SID>MyLocalFunc |
| 456 | In |Vim9| script the "s:" and "<SID>" can be omitted if the function exists in |
| 457 | the script: > |
| 458 | set opfunc=MyLocalFunc |
| 459 | |
| 460 | Set using a funcref variable: > |
Yegappan Lakshmanan | 05e59e3 | 2021-12-01 10:30:07 +0000 | [diff] [blame] | 461 | let Fn = function('MyTagFunc') |
Bram Moolenaar | fa3b723 | 2021-12-24 13:18:38 +0000 | [diff] [blame] | 462 | let &tagfunc = Fn |
Bram Moolenaar | 1fca5f3 | 2022-02-18 17:50:47 +0000 | [diff] [blame] | 463 | |
| 464 | Set using a lambda expression: > |
Yegappan Lakshmanan | 6409553 | 2021-12-06 11:03:55 +0000 | [diff] [blame] | 465 | let &tagfunc = {t -> MyTagFunc(t)} |
Bram Moolenaar | 1fca5f3 | 2022-02-18 17:50:47 +0000 | [diff] [blame] | 466 | |
| 467 | Set using a variable with lambda expression: > |
Yegappan Lakshmanan | 05e59e3 | 2021-12-01 10:30:07 +0000 | [diff] [blame] | 468 | let L = {a, b, c -> MyTagFunc(a, b , c)} |
Yegappan Lakshmanan | 6409553 | 2021-12-06 11:03:55 +0000 | [diff] [blame] | 469 | let &tagfunc = L |
Bram Moolenaar | 7b1463b | 2021-12-11 17:24:39 +0000 | [diff] [blame] | 470 | |
| 471 | In Vim9 script, in a compiled function, you can use a lambda, but a |
Aliaksei Budavei | b043ff3 | 2023-10-03 17:39:53 +0300 | [diff] [blame] | 472 | closure does not work, because the function will be called without the |
Bram Moolenaar | 7b1463b | 2021-12-11 17:24:39 +0000 | [diff] [blame] | 473 | context of where it was defined. |
| 474 | |
Yegappan Lakshmanan | 777175b | 2021-11-18 22:08:57 +0000 | [diff] [blame] | 475 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 476 | Setting the filetype |
| 477 | |
Bram Moolenaar | 6aa8cea | 2017-06-05 14:44:35 +0200 | [diff] [blame] | 478 | :setf[iletype] [FALLBACK] {filetype} *:setf* *:setfiletype* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 479 | Set the 'filetype' option to {filetype}, but only if |
| 480 | not done yet in a sequence of (nested) autocommands. |
| 481 | This is short for: > |
| 482 | :if !did_filetype() |
| 483 | : setlocal filetype={filetype} |
| 484 | :endif |
| 485 | < This command is used in a filetype.vim file to avoid |
| 486 | setting the 'filetype' option twice, causing different |
| 487 | settings and syntax files to be loaded. |
Bram Moolenaar | 6aa8cea | 2017-06-05 14:44:35 +0200 | [diff] [blame] | 488 | |
| 489 | When the optional FALLBACK argument is present, a |
| 490 | later :setfiletype command will override the |
Bram Moolenaar | 2696761 | 2019-03-17 17:13:16 +0100 | [diff] [blame] | 491 | 'filetype'. This is to be used for filetype |
| 492 | detections that are just a guess. |did_filetype()| |
| 493 | will return false after this command. |
Bram Moolenaar | 6aa8cea | 2017-06-05 14:44:35 +0200 | [diff] [blame] | 494 | |
Bram Moolenaar | d58e929 | 2011-02-09 17:07:58 +0100 | [diff] [blame] | 495 | *option-window* *optwin* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 496 | :bro[wse] se[t] *:set-browse* *:browse-set* *:opt* *:options* |
| 497 | :opt[ions] Open a window for viewing and setting all options. |
| 498 | Options are grouped by function. |
| 499 | Offers short help for each option. Hit <CR> on the |
| 500 | short help to open a help window with more help for |
| 501 | the option. |
| 502 | Modify the value of the option and hit <CR> on the |
| 503 | "set" line to set the new value. For window and |
| 504 | buffer specific options, the last accessed window is |
| 505 | used to set the option value in, unless this is a help |
| 506 | window, in which case the window below help window is |
| 507 | used (skipping the option-window). |
Bram Moolenaar | b5b7562 | 2018-03-09 22:22:21 +0100 | [diff] [blame] | 508 | {not available when compiled without the |+eval| |
| 509 | feature} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 510 | |
| 511 | *$HOME* |
| 512 | Using "~" is like using "$HOME", but it is only recognized at the start of an |
| 513 | option and after a space or comma. |
| 514 | |
| 515 | On Unix systems "~user" can be used too. It is replaced by the home directory |
| 516 | of user "user". Example: > |
| 517 | :set path=~mool/include,/usr/include,. |
| 518 | |
| 519 | On Unix systems the form "${HOME}" can be used too. The name between {} can |
| 520 | contain non-id characters then. Note that if you want to use this for the |
| 521 | "gf" command, you need to add the '{' and '}' characters to 'isfname'. |
| 522 | |
| 523 | NOTE: expanding environment variables and "~/" is only done with the ":set" |
| 524 | command, not when assigning a value to an option with ":let". |
| 525 | |
Bram Moolenaar | c572da5 | 2017-08-27 16:52:01 +0200 | [diff] [blame] | 526 | *$HOME-windows* |
| 527 | On MS-Windows, if $HOME is not defined as an environment variable, then |
| 528 | at runtime Vim will set it to the expansion of $HOMEDRIVE$HOMEPATH. |
Bram Moolenaar | 37c64c7 | 2017-09-19 22:06:03 +0200 | [diff] [blame] | 529 | If $HOMEDRIVE is not set then $USERPROFILE is used. |
| 530 | |
| 531 | This expanded value is not exported to the environment, this matters when |
| 532 | running an external command: > |
| 533 | :echo system('set | findstr ^HOME=') |
| 534 | and > |
| 535 | :echo luaeval('os.getenv("HOME")') |
| 536 | should echo nothing (an empty string) despite exists('$HOME') being true. |
| 537 | When setting $HOME to a non-empty string it will be exported to the |
| 538 | subprocesses. |
Bram Moolenaar | c572da5 | 2017-08-27 16:52:01 +0200 | [diff] [blame] | 539 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 540 | |
| 541 | Note the maximum length of an expanded option is limited. How much depends on |
| 542 | the system, mostly it is something like 256 or 1024 characters. |
| 543 | |
| 544 | *:fix* *:fixdel* |
| 545 | :fix[del] Set the value of 't_kD': |
| 546 | 't_kb' is 't_kD' becomes ~ |
| 547 | CTRL-? CTRL-H |
| 548 | not CTRL-? CTRL-? |
| 549 | |
Bram Moolenaar | 82be484 | 2021-01-11 19:40:15 +0100 | [diff] [blame] | 550 | (CTRL-? is 0o177 octal, 0x7f hex) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 551 | |
| 552 | If your delete key terminal code is wrong, but the |
| 553 | code for backspace is alright, you can put this in |
| 554 | your .vimrc: > |
| 555 | :fixdel |
| 556 | < This works no matter what the actual code for |
| 557 | backspace is. |
| 558 | |
| 559 | If the backspace key terminal code is wrong you can |
| 560 | use this: > |
| 561 | :if &term == "termname" |
| 562 | : set t_kb=^V<BS> |
| 563 | : fixdel |
| 564 | :endif |
| 565 | < Where "^V" is CTRL-V and "<BS>" is the backspace key |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 566 | (don't type four characters!). Replace "termname" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 567 | with your terminal name. |
| 568 | |
| 569 | If your <Delete> key sends a strange key sequence (not |
| 570 | CTRL-? or CTRL-H) you cannot use ":fixdel". Then use: > |
| 571 | :if &term == "termname" |
| 572 | : set t_kD=^V<Delete> |
| 573 | :endif |
| 574 | < Where "^V" is CTRL-V and "<Delete>" is the delete key |
| 575 | (don't type eight characters!). Replace "termname" |
| 576 | with your terminal name. |
| 577 | |
| 578 | *Linux-backspace* |
| 579 | Note about Linux: By default the backspace key |
| 580 | produces CTRL-?, which is wrong. You can fix it by |
| 581 | putting this line in your rc.local: > |
| 582 | echo "keycode 14 = BackSpace" | loadkeys |
| 583 | < |
| 584 | *NetBSD-backspace* |
| 585 | Note about NetBSD: If your backspace doesn't produce |
| 586 | the right code, try this: > |
| 587 | xmodmap -e "keycode 22 = BackSpace" |
| 588 | < If this works, add this in your .Xmodmap file: > |
| 589 | keysym 22 = BackSpace |
| 590 | < You need to restart for this to take effect. |
| 591 | |
| 592 | ============================================================================== |
| 593 | 2. Automatically setting options *auto-setting* |
| 594 | |
| 595 | Besides changing options with the ":set" command, there are three alternatives |
| 596 | to set options automatically for one or more files: |
| 597 | |
| 598 | 1. When starting Vim initializations are read from various places. See |
| 599 | |initialization|. Most of them are performed for all editing sessions, |
| 600 | and some of them depend on the directory where Vim is started. |
| 601 | You can create an initialization file with |:mkvimrc|, |:mkview| and |
| 602 | |:mksession|. |
| 603 | 2. If you start editing a new file, the automatic commands are executed. |
| 604 | This can be used to set options for files matching a particular pattern and |
| 605 | many other things. See |autocommand|. |
| 606 | 3. If you start editing a new file, and the 'modeline' option is on, a |
| 607 | number of lines at the beginning and end of the file are checked for |
| 608 | modelines. This is explained here. |
| 609 | |
| 610 | *modeline* *vim:* *vi:* *ex:* *E520* |
| 611 | There are two forms of modelines. The first form: |
Bram Moolenaar | 664f3cf | 2019-12-07 16:03:51 +0100 | [diff] [blame] | 612 | [text{white}]{vi:|vim:|ex:}[white]{options} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 613 | |
Bram Moolenaar | 664f3cf | 2019-12-07 16:03:51 +0100 | [diff] [blame] | 614 | [text{white}] empty or any text followed by at least one blank |
| 615 | character (<Space> or <Tab>); "ex:" always requires at |
| 616 | least one blank character |
Bram Moolenaar | 14b6945 | 2013-06-29 23:05:20 +0200 | [diff] [blame] | 617 | {vi:|vim:|ex:} the string "vi:", "vim:" or "ex:" |
Bram Moolenaar | 22dbc77 | 2013-06-28 18:44:48 +0200 | [diff] [blame] | 618 | [white] optional white space |
| 619 | {options} a list of option settings, separated with white space |
| 620 | or ':', where each part between ':' is the argument |
| 621 | for a ":set" command (can be empty) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 622 | |
Bram Moolenaar | 14b6945 | 2013-06-29 23:05:20 +0200 | [diff] [blame] | 623 | Examples: |
Bram Moolenaar | 97b2ad3 | 2006-03-18 21:40:56 +0000 | [diff] [blame] | 624 | vi:noai:sw=3 ts=6 ~ |
Bram Moolenaar | 14b6945 | 2013-06-29 23:05:20 +0200 | [diff] [blame] | 625 | vim: tw=77 ~ |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 626 | |
| 627 | The second form (this is compatible with some versions of Vi): |
| 628 | |
Bram Moolenaar | ade0d39 | 2020-01-21 22:33:58 +0100 | [diff] [blame] | 629 | [text{white}]{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text] |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 630 | |
Bram Moolenaar | ade0d39 | 2020-01-21 22:33:58 +0100 | [diff] [blame] | 631 | [text{white}] empty or any text followed by at least one blank |
| 632 | character (<Space> or <Tab>); "ex:" always requires at |
| 633 | least one blank character |
Bram Moolenaar | 22dbc77 | 2013-06-28 18:44:48 +0200 | [diff] [blame] | 634 | {vi:|vim:|Vim:|ex:} the string "vi:", "vim:", "Vim:" or "ex:" |
| 635 | [white] optional white space |
Bram Moolenaar | 14b6945 | 2013-06-29 23:05:20 +0200 | [diff] [blame] | 636 | se[t] the string "set " or "se " (note the space); When |
| 637 | "Vim" is used it must be "set". |
Bram Moolenaar | 22dbc77 | 2013-06-28 18:44:48 +0200 | [diff] [blame] | 638 | {options} a list of options, separated with white space, which |
| 639 | is the argument for a ":set" command |
| 640 | : a colon |
| 641 | [text] any text or empty |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 642 | |
Bram Moolenaar | 14b6945 | 2013-06-29 23:05:20 +0200 | [diff] [blame] | 643 | Examples: |
Bram Moolenaar | 97b2ad3 | 2006-03-18 21:40:56 +0000 | [diff] [blame] | 644 | /* vim: set ai tw=75: */ ~ |
Bram Moolenaar | 14b6945 | 2013-06-29 23:05:20 +0200 | [diff] [blame] | 645 | /* Vim: set ai tw=75: */ ~ |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 646 | |
Bram Moolenaar | 22dbc77 | 2013-06-28 18:44:48 +0200 | [diff] [blame] | 647 | The white space before {vi:|vim:|Vim:|ex:} is required. This minimizes the |
| 648 | chance that a normal word like "lex:" is caught. There is one exception: |
| 649 | "vi:" and "vim:" can also be at the start of the line (for compatibility with |
| 650 | version 3.0). Using "ex:" at the start of the line will be ignored (this |
| 651 | could be short for "example:"). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 652 | |
Hu Jialun | 9dcd349 | 2021-08-28 20:42:50 +0200 | [diff] [blame] | 653 | If the modeline is disabled within a modeline, subsequent modelines will be |
| 654 | ignored. This is to allow turning off modeline on a per-file basis. This is |
| 655 | useful when a line looks like a modeline but isn't. For example, it would be |
| 656 | good to start a YAML file containing strings like "vim:" with |
| 657 | # vim: nomodeline ~ |
| 658 | so as to avoid modeline misdetection. Following options on the same line |
| 659 | after modeline deactivation, if any, are still evaluated (but you would |
| 660 | normally not have any). |
| 661 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 662 | *modeline-local* |
| 663 | The options are set like with ":setlocal": The new value only applies to the |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 664 | buffer and window that contain the file. Although it's possible to set global |
| 665 | options from a modeline, this is unusual. If you have two windows open and |
| 666 | the files in it set the same global option to a different value, the result |
| 667 | depends on which one was opened last. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 668 | |
Bram Moolenaar | 15d0a8c | 2004-09-06 17:44:46 +0000 | [diff] [blame] | 669 | When editing a file that was already loaded, only the window-local options |
| 670 | from the modeline are used. Thus if you manually changed a buffer-local |
| 671 | option after opening the file, it won't be changed if you edit the same buffer |
| 672 | in another window. But window-local options will be set. |
| 673 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 674 | *modeline-version* |
| 675 | If the modeline is only to be used for some versions of Vim, the version |
Bram Moolenaar | 22dbc77 | 2013-06-28 18:44:48 +0200 | [diff] [blame] | 676 | number can be specified where "vim:" or "Vim:" is used: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 677 | vim{vers}: version {vers} or later |
| 678 | vim<{vers}: version before {vers} |
| 679 | vim={vers}: version {vers} |
| 680 | vim>{vers}: version after {vers} |
Bram Moolenaar | 2b8388b | 2015-02-28 13:11:45 +0100 | [diff] [blame] | 681 | {vers} is 700 for Vim 7.0 (hundred times the major version plus minor). |
| 682 | For example, to use a modeline only for Vim 7.0: |
| 683 | /* vim700: set foldmethod=marker */ ~ |
| 684 | To use a modeline for Vim after version 7.2: |
| 685 | /* vim>702: set cole=2: */ ~ |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 686 | There can be no blanks between "vim" and the ":". |
| 687 | |
| 688 | |
| 689 | The number of lines that are checked can be set with the 'modelines' option. |
| 690 | If 'modeline' is off or 'modelines' is 0 no lines are checked. |
| 691 | |
| 692 | Note that for the first form all of the rest of the line is used, thus a line |
Bram Moolenaar | 97b2ad3 | 2006-03-18 21:40:56 +0000 | [diff] [blame] | 693 | like: |
| 694 | /* vi:ts=4: */ ~ |
| 695 | will give an error message for the trailing "*/". This line is OK: |
| 696 | /* vi:set ts=4: */ ~ |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 697 | |
| 698 | If an error is detected the rest of the line is skipped. |
| 699 | |
| 700 | If you want to include a ':' in a set command precede it with a '\'. The |
Bram Moolenaar | 97b2ad3 | 2006-03-18 21:40:56 +0000 | [diff] [blame] | 701 | backslash in front of the ':' will be removed. Example: |
Bram Moolenaar | 95a9dd1 | 2019-12-19 22:12:03 +0100 | [diff] [blame] | 702 | /* vi:set fillchars=stl\:^,vert\:\|: */ ~ |
| 703 | This sets the 'fillchars' option to "stl:^,vert:\|". Only a single backslash |
| 704 | before the ':' is removed. Thus to include "\:" you have to specify "\\:". |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 705 | *E992* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 706 | No other commands than "set" are supported, for security reasons (somebody |
Bram Moolenaar | 8243a79 | 2007-05-01 17:05:03 +0000 | [diff] [blame] | 707 | might create a Trojan horse text file with modelines). And not all options |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 708 | can be set. For some options a flag is set, so that when the value is used |
| 709 | the |sandbox| is effective. Some options can only be set from the modeline |
| 710 | when 'modelineexpr' is set (the default is off). |
| 711 | |
| 712 | Still, there is always a small risk that a modeline causes trouble. E.g., |
| 713 | when some joker sets 'textwidth' to 5 all your lines are wrapped unexpectedly. |
| 714 | So disable modelines before editing untrusted text. The mail ftplugin does |
| 715 | this, for example. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 716 | |
| 717 | Hint: If you would like to do something else than setting an option, you could |
| 718 | define an autocommand that checks the file for a specific string. For |
| 719 | example: > |
| 720 | au BufReadPost * if getline(1) =~ "VAR" | call SetVar() | endif |
| 721 | And define a function SetVar() that does something with the line containing |
| 722 | "VAR". |
| 723 | |
| 724 | ============================================================================== |
| 725 | 3. Options summary *option-summary* |
| 726 | |
| 727 | In the list below all the options are mentioned with their full name and with |
| 728 | an abbreviation if there is one. Both forms may be used. |
| 729 | |
| 730 | In this document when a boolean option is "set" that means that ":set option" |
| 731 | is entered. When an option is "reset", ":set nooption" is used. |
| 732 | |
| 733 | For some options there are two default values: The "Vim default", which is |
| 734 | used when 'compatible' is not set, and the "Vi default", which is used when |
| 735 | 'compatible' is set. |
| 736 | |
| 737 | Most options are the same in all windows and buffers. There are a few that |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 738 | are specific to how the text is presented in a window. These can be set to a |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 739 | different value in each window. For example the 'list' option can be set in |
| 740 | one window and reset in another for the same text, giving both types of view |
| 741 | at the same time. There are a few options that are specific to a certain |
| 742 | file. These can have a different value for each file or buffer. For example |
| 743 | the 'textwidth' option can be 78 for a normal text file and 0 for a C |
| 744 | program. |
| 745 | |
| 746 | global one option for all buffers and windows |
| 747 | local to window each window has its own copy of this option |
| 748 | local to buffer each buffer has its own copy of this option |
| 749 | |
| 750 | When creating a new window the option values from the currently active window |
| 751 | are used as a default value for the window-specific options. For the |
| 752 | buffer-specific options this depends on the 's' and 'S' flags in the |
| 753 | 'cpoptions' option. If 's' is included (which is the default) the values for |
| 754 | buffer options are copied from the currently active buffer when a buffer is |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 755 | first entered. If 'S' is present the options are copied each time the buffer |
| 756 | is entered, this is almost like having global options. If 's' and 'S' are not |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 757 | present, the options are copied from the currently active buffer when the |
| 758 | buffer is created. |
| 759 | |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 760 | Hidden options *hidden-options* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 761 | |
Bram Moolenaar | 578b49e | 2005-09-10 19:22:57 +0000 | [diff] [blame] | 762 | Not all options are supported in all versions. This depends on the supported |
| 763 | features and sometimes on the system. A remark about this is in curly braces |
| 764 | below. When an option is not supported it may still be set without getting an |
| 765 | error, this is called a hidden option. You can't get the value of a hidden |
| 766 | option though, it is not stored. |
| 767 | |
| 768 | To test if option "foo" can be used with ":set" use something like this: > |
| 769 | if exists('&foo') |
| 770 | This also returns true for a hidden option. To test if option "foo" is really |
| 771 | supported use something like this: > |
| 772 | if exists('+foo') |
| 773 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 774 | *E355* |
| 775 | A jump table for the options with a short description can be found at |Q_op|. |
| 776 | |
| 777 | *'aleph'* *'al'* *aleph* *Aleph* |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 778 | 'aleph' 'al' number (default 128 for MS-Windows, 224 otherwise) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 779 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 780 | {only available when compiled with the |+rightleft| |
| 781 | feature} |
| 782 | The ASCII code for the first letter of the Hebrew alphabet. The |
| 783 | routine that maps the keyboard in Hebrew mode, both in Insert mode |
| 784 | (when hkmap is set) and on the command-line (when hitting CTRL-_) |
| 785 | outputs the Hebrew characters in the range [aleph..aleph+26]. |
| 786 | aleph=128 applies to PC code, and aleph=224 applies to ISO 8859-8. |
| 787 | See |rileft.txt|. |
| 788 | |
| 789 | *'allowrevins'* *'ari'* *'noallowrevins'* *'noari'* |
| 790 | 'allowrevins' 'ari' boolean (default off) |
| 791 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 792 | {only available when compiled with the |+rightleft| |
| 793 | feature} |
| 794 | Allow CTRL-_ in Insert and Command-line mode. This is default off, to |
| 795 | avoid that users that accidentally type CTRL-_ instead of SHIFT-_ get |
| 796 | into reverse Insert mode, and don't know how to get out. See |
| 797 | 'revins'. |
| 798 | NOTE: This option is reset when 'compatible' is set. |
| 799 | |
| 800 | *'altkeymap'* *'akm'* *'noaltkeymap'* *'noakm'* |
| 801 | 'altkeymap' 'akm' boolean (default off) |
| 802 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 803 | {only available when compiled with the |+farsi| |
| 804 | feature} |
Bram Moolenaar | 14184a3 | 2019-02-16 15:10:30 +0100 | [diff] [blame] | 805 | This option was for using Farsi, which has been removed. See |
| 806 | |farsi.txt|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 807 | |
| 808 | *'ambiwidth'* *'ambw'* |
| 809 | 'ambiwidth' 'ambw' string (default: "single") |
| 810 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 811 | Only effective when 'encoding' is "utf-8" or another Unicode encoding. |
| 812 | Tells Vim what to do with characters with East Asian Width Class |
| 813 | Ambiguous (such as Euro, Registered Sign, Copyright Sign, Greek |
| 814 | letters, Cyrillic letters). |
| 815 | |
| 816 | There are currently two possible values: |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 817 | "single": Use the same width as characters in US-ASCII. This is |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 818 | expected by most users. |
| 819 | "double": Use twice the width of ASCII characters. |
Bram Moolenaar | 5c3bd0a | 2010-08-04 20:55:44 +0200 | [diff] [blame] | 820 | *E834* *E835* |
| 821 | The value "double" cannot be used if 'listchars' or 'fillchars' |
Bram Moolenaar | 079ba76 | 2021-10-23 12:08:41 +0100 | [diff] [blame] | 822 | contains a character that would be double width. These errors may |
| 823 | also be given when calling setcellwidths(). |
Bram Moolenaar | 08aac3c | 2020-08-28 21:04:24 +0200 | [diff] [blame] | 824 | |
| 825 | The values are overruled for characters specified with |
| 826 | |setcellwidths()|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 827 | |
| 828 | There are a number of CJK fonts for which the width of glyphs for |
| 829 | those characters are solely based on how many octets they take in |
| 830 | legacy/traditional CJK encodings. In those encodings, Euro, |
| 831 | Registered sign, Greek/Cyrillic letters are represented by two octets, |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 832 | therefore those fonts have "wide" glyphs for them. This is also |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 833 | true of some line drawing characters used to make tables in text |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 834 | file. Therefore, when a CJK font is used for GUI Vim or |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 835 | Vim is running inside a terminal (emulators) that uses a CJK font |
| 836 | (or Vim is run inside an xterm invoked with "-cjkwidth" option.), |
| 837 | this option should be set to "double" to match the width perceived |
| 838 | by Vim with the width of glyphs in the font. Perhaps it also has |
Bram Moolenaar | 8024f93 | 2020-01-14 19:29:13 +0100 | [diff] [blame] | 839 | to be set to "double" under CJK MS-Windows when the system locale is |
| 840 | set to one of CJK locales. See Unicode Standard Annex #11 |
| 841 | (http://www.unicode.org/reports/tr11). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 842 | |
Bram Moolenaar | ac7bd63 | 2013-03-19 11:35:58 +0100 | [diff] [blame] | 843 | Vim may set this option automatically at startup time when Vim is |
| 844 | compiled with the |+termresponse| feature and if |t_u7| is set to the |
Bram Moolenaar | 37c64c7 | 2017-09-19 22:06:03 +0200 | [diff] [blame] | 845 | escape sequence to request cursor position report. The response can |
| 846 | be found in |v:termu7resp|. |
Bram Moolenaar | ac7bd63 | 2013-03-19 11:35:58 +0100 | [diff] [blame] | 847 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 848 | *'antialias'* *'anti'* *'noantialias'* *'noanti'* |
| 849 | 'antialias' 'anti' boolean (default: off) |
| 850 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 851 | {only available when compiled with GUI enabled |
Bram Moolenaar | 3d1cde8 | 2020-08-15 18:55:18 +0200 | [diff] [blame] | 852 | on macOS} |
| 853 | This option only has an effect in the GUI version of Vim on macOS |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 854 | v10.2 or later. When on, Vim will use smooth ("antialiased") fonts, |
| 855 | which can be easier to read at certain sizes on certain displays. |
| 856 | Setting this option can sometimes cause problems if 'guifont' is set |
| 857 | to its default (empty string). |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 858 | NOTE: This option is reset when 'compatible' is set. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 859 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 860 | *'arabic'* *'arab'* *'noarabic'* *'noarab'* |
| 861 | 'arabic' 'arab' boolean (default off) |
| 862 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 863 | {only available when compiled with the |+arabic| |
| 864 | feature} |
| 865 | This option can be set to start editing Arabic text. |
| 866 | Setting this option will: |
| 867 | - Set the 'rightleft' option, unless 'termbidi' is set. |
| 868 | - Set the 'arabicshape' option, unless 'termbidi' is set. |
| 869 | - Set the 'keymap' option to "arabic"; in Insert mode CTRL-^ toggles |
| 870 | between typing English and Arabic key mapping. |
| 871 | - Set the 'delcombine' option |
| 872 | Note that 'encoding' must be "utf-8" for working with Arabic text. |
| 873 | |
| 874 | Resetting this option will: |
| 875 | - Reset the 'rightleft' option. |
| 876 | - Disable the use of 'keymap' (without changing its value). |
| 877 | Note that 'arabicshape' and 'delcombine' are not reset (it is a global |
Bram Moolenaar | c873442 | 2012-06-01 22:38:45 +0200 | [diff] [blame] | 878 | option). |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 879 | NOTE: This option is reset when 'compatible' is set. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 880 | Also see |arabic.txt|. |
| 881 | |
| 882 | *'arabicshape'* *'arshape'* |
| 883 | *'noarabicshape'* *'noarshape'* |
| 884 | 'arabicshape' 'arshape' boolean (default on) |
| 885 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 886 | {only available when compiled with the |+arabic| |
| 887 | feature} |
| 888 | When on and 'termbidi' is off, the required visual character |
| 889 | corrections that need to take place for displaying the Arabic language |
Bram Moolenaar | 3a0d809 | 2012-10-21 03:02:54 +0200 | [diff] [blame] | 890 | take effect. Shaping, in essence, gets enabled; the term is a broad |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 891 | one which encompasses: |
| 892 | a) the changing/morphing of characters based on their location |
| 893 | within a word (initial, medial, final and stand-alone). |
| 894 | b) the enabling of the ability to compose characters |
| 895 | c) the enabling of the required combining of some characters |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 896 | When disabled the display shows each character's true stand-alone |
| 897 | form. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 898 | Arabic is a complex language which requires other settings, for |
| 899 | further details see |arabic.txt|. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 900 | NOTE: This option is set when 'compatible' is set. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 901 | |
laburnumT | 3f7855a | 2023-12-05 18:37:03 +0100 | [diff] [blame] | 902 | *'autochdir'* *'acd'* *'noautochdir'* *'noacd'* |
| 903 | 'autochdir' 'acd' boolean (default off) |
| 904 | global |
| 905 | {only available when compiled with it, use |
| 906 | exists("+autochdir") to check} |
| 907 | When on, Vim will change the current working directory whenever you |
| 908 | open a file, switch buffers, delete a buffer or open/close a window. |
| 909 | It will change to the directory containing the file which was opened |
| 910 | or selected. When a buffer has no name it also has no directory, thus |
| 911 | the current directory won't change when navigating to it. |
| 912 | Note: When this option is on some plugins may not work. |
| 913 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 914 | *'autoindent'* *'ai'* *'noautoindent'* *'noai'* |
| 915 | 'autoindent' 'ai' boolean (default off) |
| 916 | local to buffer |
| 917 | Copy indent from current line when starting a new line (typing <CR> |
| 918 | in Insert mode or when using the "o" or "O" command). If you do not |
| 919 | type anything on the new line except <BS> or CTRL-D and then type |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 920 | <Esc>, CTRL-O or <CR>, the indent is deleted again. Moving the cursor |
| 921 | to another line has the same effect, unless the 'I' flag is included |
| 922 | in 'cpoptions'. |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 923 | When autoindent is on, formatting (with the "gq" command or when you |
| 924 | reach 'textwidth' in Insert mode) uses the indentation of the first |
| 925 | line. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 926 | When 'smartindent' or 'cindent' is on the indent is changed in |
| 927 | a different way. |
Bram Moolenaar | ca63501 | 2015-09-25 20:34:21 +0200 | [diff] [blame] | 928 | The 'autoindent' option is reset when the 'paste' option is set and |
| 929 | restored when 'paste' is reset. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 930 | |
| 931 | *'autoread'* *'ar'* *'noautoread'* *'noar'* |
| 932 | 'autoread' 'ar' boolean (default off) |
| 933 | global or local to buffer |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 934 | When a file has been detected to have been changed outside of Vim and |
| 935 | it has not been changed inside of Vim, automatically read it again. |
Bram Moolenaar | fd35811 | 2018-07-07 23:21:31 +0200 | [diff] [blame] | 936 | When the file has been deleted this is not done, so you have the text |
| 937 | from before it was deleted. When it appears again then it is read. |
| 938 | |timestamp| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 939 | If this option has a local value, use this command to switch back to |
| 940 | using the global value: > |
| 941 | :set autoread< |
| 942 | < |
laburnumT | 3f7855a | 2023-12-05 18:37:03 +0100 | [diff] [blame] | 943 | |
| 944 | *'autoshelldir'* *'asd'* *'noautoshelldir'* *'noasd'* |
| 945 | 'autoshelldir' 'asd' boolean (default off) |
| 946 | global |
| 947 | When on, Vim will change the current working directory whenever you |
| 948 | change the directory of the shell running in a terminal window. You |
| 949 | need proper setting-up, so whenever the shell's pwd changes an OSC 7 |
| 950 | escape sequence will be emitted. For example, on Linux, you can |
| 951 | source /etc/profile.d/vte.sh in your shell profile if you use bash or |
| 952 | zsh. For bash this should work (put it in a bash init file): > |
| 953 | if [[ -n "$VIM_TERMINAL" ]]; then |
| 954 | PROMPT_COMMAND='_vim_sync_PWD' |
| 955 | function _vim_sync_PWD() { |
| 956 | printf '\033]7;file://%s\033\\' "$PWD" |
| 957 | } |
| 958 | fi |
| 959 | < |
| 960 | Or, in a zsh init file: > |
| 961 | if [[ -n "$VIM_TERMINAL" ]]; then |
| 962 | autoload -Uz add-zsh-hook |
| 963 | add-zsh-hook -Uz chpwd _vim_sync_PWD |
| 964 | function _vim_sync_PWD() { |
| 965 | printf '\033]7;file://%s\033\\' "$PWD" |
| 966 | } |
| 967 | fi |
| 968 | < |
| 969 | In a fish init file: > |
| 970 | if test -n "$VIM_TERMINAL" |
| 971 | function _vim_sync_PWD --on-variable=PWD |
| 972 | printf '\033]7;file://%s\033\\' "$PWD" |
| 973 | end |
| 974 | end |
| 975 | < |
| 976 | You can find an alternative method at |terminal-autoshelldir|. |
| 977 | When the parsing of the OSC sequence fails you get *E1179* . |
| 978 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 979 | *'autowrite'* *'aw'* *'noautowrite'* *'noaw'* |
| 980 | 'autowrite' 'aw' boolean (default off) |
| 981 | global |
| 982 | Write the contents of the file, if it has been modified, on each |
Bram Moolenaar | 4700398 | 2021-12-05 21:54:04 +0000 | [diff] [blame] | 983 | `:next`, `:rewind`, `:last`, `:first`, `:previous`, `:stop`, |
Bram Moolenaar | 2f0936c | 2022-01-08 21:51:59 +0000 | [diff] [blame] | 984 | `:suspend`, `:tag`, `:!`, `:make`, CTRL-] and CTRL-^ command; and when |
| 985 | a `:buffer`, CTRL-O, CTRL-I, '{A-Z0-9}, or `{A-Z0-9} command takes one |
Bram Moolenaar | 4700398 | 2021-12-05 21:54:04 +0000 | [diff] [blame] | 986 | to another file. |
| 987 | A buffer is not written if it becomes hidden, e.g. when 'bufhidden' is |
Bram Moolenaar | 2f0936c | 2022-01-08 21:51:59 +0000 | [diff] [blame] | 988 | set to "hide" and `:next` is used. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 989 | Note that for some commands the 'autowrite' option is not used, see |
| 990 | 'autowriteall' for that. |
Bram Moolenaar | 93a1df2 | 2018-09-10 11:51:50 +0200 | [diff] [blame] | 991 | Some buffers will not be written, specifically when 'buftype' is |
Bram Moolenaar | 20aac6c | 2018-09-02 21:07:30 +0200 | [diff] [blame] | 992 | "nowrite", "nofile", "terminal" or "prompt". |
Bram Moolenaar | b7398fe | 2023-05-14 18:50:25 +0100 | [diff] [blame] | 993 | USE WITH CARE: If you make temporary changes to a buffer that you |
| 994 | don't want to be saved this option may cause it to be saved anyway. |
| 995 | Renaming the buffer with ":file {name}" may help avoid this. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 996 | |
| 997 | *'autowriteall'* *'awa'* *'noautowriteall'* *'noawa'* |
| 998 | 'autowriteall' 'awa' boolean (default off) |
| 999 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1000 | Like 'autowrite', but also used for commands ":edit", ":enew", ":quit", |
| 1001 | ":qall", ":exit", ":xit", ":recover" and closing the Vim window. |
| 1002 | Setting this option also implies that Vim behaves like 'autowrite' has |
| 1003 | been set. |
| 1004 | |
| 1005 | *'background'* *'bg'* |
Bram Moolenaar | 446beb4 | 2011-05-10 17:18:44 +0200 | [diff] [blame] | 1006 | 'background' 'bg' string (default "dark" or "light", see below) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1007 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1008 | When set to "dark", Vim will try to use colors that look good on a |
| 1009 | dark background. When set to "light", Vim will try to use colors that |
| 1010 | look good on a light background. Any other value is illegal. |
| 1011 | Vim tries to set the default value according to the terminal used. |
| 1012 | This will not always be correct. |
| 1013 | Setting this option does not change the background color, it tells Vim |
| 1014 | what the background color looks like. For changing the background |
| 1015 | color, see |:hi-normal|. |
| 1016 | |
Gregory Anders | 83ad272 | 2024-01-03 19:48:51 +0100 | [diff] [blame] | 1017 | When 'background' is changed Vim will adjust the default color groups |
| 1018 | for the new value. But the colors used for syntax highlighting will |
| 1019 | not change. *g:colors_name* |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1020 | When a color scheme is loaded (the "g:colors_name" variable is set) |
Gregory Anders | 83ad272 | 2024-01-03 19:48:51 +0100 | [diff] [blame] | 1021 | changing 'background' will cause the color scheme to be reloaded. If |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1022 | the color scheme adjusts to the value of 'background' this will work. |
| 1023 | However, if the color scheme sets 'background' itself the effect may |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1024 | be undone. First delete the "g:colors_name" variable when needed. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1025 | |
| 1026 | When setting 'background' to the default value with: > |
| 1027 | :set background& |
| 1028 | < Vim will guess the value. In the GUI this should work correctly, |
| 1029 | in other cases Vim might not be able to guess the right value. |
Bram Moolenaar | 2e693a8 | 2019-10-16 22:35:02 +0200 | [diff] [blame] | 1030 | If the GUI supports a dark theme, you can use the "d" flag in |
Bram Moolenaar | 50bf7ce | 2019-09-15 13:17:00 +0200 | [diff] [blame] | 1031 | 'guioptions', see 'go-d'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1032 | |
Bram Moolenaar | 37c64c7 | 2017-09-19 22:06:03 +0200 | [diff] [blame] | 1033 | When the |t_RB| option is set, Vim will use it to request the background |
Bram Moolenaar | b4d6c3e | 2017-05-27 16:45:17 +0200 | [diff] [blame] | 1034 | color from the terminal. If the returned RGB value is dark/light and |
| 1035 | 'background' is not dark/light, 'background' will be set and the |
Jon Parise | 71028a3 | 2025-01-20 20:19:18 +0100 | [diff] [blame] | 1036 | screen is redrawn. This may have side effects, make |t_RB| empty in |
Bram Moolenaar | 37c64c7 | 2017-09-19 22:06:03 +0200 | [diff] [blame] | 1037 | your .vimrc if you suspect this problem. The response to |t_RB| can |
Bram Moolenaar | 01164a6 | 2017-11-02 22:58:42 +0100 | [diff] [blame] | 1038 | be found in |v:termrbgresp|. |
Bram Moolenaar | b4d6c3e | 2017-05-27 16:45:17 +0200 | [diff] [blame] | 1039 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1040 | When starting the GUI, the default value for 'background' will be |
| 1041 | "light". When the value is not set in the .gvimrc, and Vim detects |
| 1042 | that the background is actually quite dark, 'background' is set to |
| 1043 | "dark". But this happens only AFTER the .gvimrc file has been read |
| 1044 | (because the window needs to be opened to find the actual background |
| 1045 | color). To get around this, force the GUI window to be opened by |
| 1046 | putting a ":gui" command in the .gvimrc file, before where the value |
| 1047 | of 'background' is used (e.g., before ":syntax on"). |
Bram Moolenaar | 446beb4 | 2011-05-10 17:18:44 +0200 | [diff] [blame] | 1048 | |
Bram Moolenaar | 6f345a1 | 2019-12-17 21:27:18 +0100 | [diff] [blame] | 1049 | For MS-Windows the default is "dark". |
Bram Moolenaar | 446beb4 | 2011-05-10 17:18:44 +0200 | [diff] [blame] | 1050 | For other systems "dark" is used when 'term' is "linux", |
| 1051 | "screen.linux", "cygwin" or "putty", or $COLORFGBG suggests a dark |
| 1052 | background. Otherwise the default is "light". |
| 1053 | |
Bram Moolenaar | c572da5 | 2017-08-27 16:52:01 +0200 | [diff] [blame] | 1054 | The |:terminal| command and the |term_start()| function use the |
| 1055 | 'background' value to decide whether the terminal window will start |
| 1056 | with a white or black background. |
| 1057 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1058 | Normally this option would be set in the .vimrc file. Possibly |
| 1059 | depending on the terminal name. Example: > |
| 1060 | :if &term == "pcterm" |
| 1061 | : set background=dark |
| 1062 | :endif |
| 1063 | < When this option is set, the default settings for the highlight groups |
| 1064 | will change. To use other settings, place ":highlight" commands AFTER |
| 1065 | the setting of the 'background' option. |
| 1066 | This option is also used in the "$VIMRUNTIME/syntax/syntax.vim" file |
| 1067 | to select the colors for syntax highlighting. After changing this |
| 1068 | option, you must load syntax.vim again to see the result. This can be |
| 1069 | done with ":syntax on". |
| 1070 | |
| 1071 | *'backspace'* *'bs'* |
h-east | b534e80 | 2024-12-03 20:37:52 +0100 | [diff] [blame] | 1072 | 'backspace' 'bs' string (Vim default: "indent,eol,start", |
| 1073 | Vi default: "") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1074 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1075 | Influences the working of <BS>, <Del>, CTRL-W and CTRL-U in Insert |
| 1076 | mode. This is a list of items, separated by commas. Each item allows |
| 1077 | a way to backspace over something: |
| 1078 | value effect ~ |
| 1079 | indent allow backspacing over autoindent |
| 1080 | eol allow backspacing over line breaks (join lines) |
| 1081 | start allow backspacing over the start of insert; CTRL-W and CTRL-U |
| 1082 | stop once at the start of insert. |
Bram Moolenaar | aa0489e | 2020-04-17 19:41:21 +0200 | [diff] [blame] | 1083 | nostop like start, except CTRL-W and CTRL-U do not stop at the start of |
| 1084 | insert. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1085 | |
Bram Moolenaar | 46eea44 | 2022-03-30 10:51:39 +0100 | [diff] [blame] | 1086 | When the value is empty, Vi compatible backspacing is used, none of |
| 1087 | the ways mentioned for the items above are possible. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1088 | |
| 1089 | For backwards compatibility with version 5.4 and earlier: |
| 1090 | value effect ~ |
| 1091 | 0 same as ":set backspace=" (Vi compatible) |
| 1092 | 1 same as ":set backspace=indent,eol" |
| 1093 | 2 same as ":set backspace=indent,eol,start" |
Bram Moolenaar | aa0489e | 2020-04-17 19:41:21 +0200 | [diff] [blame] | 1094 | 3 same as ":set backspace=indent,eol,nostop" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1095 | |
| 1096 | See |:fixdel| if your <BS> or <Del> key does not do what you want. |
| 1097 | NOTE: This option is set to "" when 'compatible' is set. |
| 1098 | |
| 1099 | *'backup'* *'bk'* *'nobackup'* *'nobk'* |
| 1100 | 'backup' 'bk' boolean (default off) |
| 1101 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1102 | Make a backup before overwriting a file. Leave it around after the |
| 1103 | file has been successfully written. If you do not want to keep the |
| 1104 | backup file, but you do want a backup while the file is being |
| 1105 | written, reset this option and set the 'writebackup' option (this is |
| 1106 | the default). If you do not want a backup file at all reset both |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 1107 | options (use this if your file system is almost full). See the |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1108 | |backup-table| for more explanations. |
| 1109 | When the 'backupskip' pattern matches, a backup is not made anyway. |
| 1110 | When 'patchmode' is set, the backup may be renamed to become the |
| 1111 | oldest version of a file. |
| 1112 | NOTE: This option is reset when 'compatible' is set. |
| 1113 | |
| 1114 | *'backupcopy'* *'bkc'* |
| 1115 | 'backupcopy' 'bkc' string (Vi default for Unix: "yes", otherwise: "auto") |
Bram Moolenaar | b8ee25a | 2014-09-23 15:45:08 +0200 | [diff] [blame] | 1116 | global or local to buffer |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1117 | When writing a file and a backup is made, this option tells how it's |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 1118 | done. This is a comma-separated list of words. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1119 | |
| 1120 | The main values are: |
| 1121 | "yes" make a copy of the file and overwrite the original one |
| 1122 | "no" rename the file and write a new one |
| 1123 | "auto" one of the previous, what works best |
| 1124 | |
| 1125 | Extra values that can be combined with the ones above are: |
| 1126 | "breaksymlink" always break symlinks when writing |
| 1127 | "breakhardlink" always break hardlinks when writing |
| 1128 | |
| 1129 | Making a copy and overwriting the original file: |
| 1130 | - Takes extra time to copy the file. |
| 1131 | + When the file has special attributes, is a (hard/symbolic) link or |
| 1132 | has a resource fork, all this is preserved. |
| 1133 | - When the file is a link the backup will have the name of the link, |
| 1134 | not of the real file. |
| 1135 | |
| 1136 | Renaming the file and writing a new one: |
| 1137 | + It's fast. |
| 1138 | - Sometimes not all attributes of the file can be copied to the new |
| 1139 | file. |
| 1140 | - When the file is a link the new file will not be a link. |
| 1141 | |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 1142 | The "auto" value is the middle way: When Vim sees that renaming the |
| 1143 | file is possible without side effects (the attributes can be passed on |
| 1144 | and the file is not a link) that is used. When problems are expected, |
| 1145 | a copy will be made. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1146 | |
| 1147 | The "breaksymlink" and "breakhardlink" values can be used in |
| 1148 | combination with any of "yes", "no" and "auto". When included, they |
| 1149 | force Vim to always break either symbolic or hard links by doing |
| 1150 | exactly what the "no" option does, renaming the original file to |
| 1151 | become the backup and writing a new file in its place. This can be |
| 1152 | useful for example in source trees where all the files are symbolic or |
| 1153 | hard links and any changes should stay in the local source tree, not |
| 1154 | be propagated back to the original source. |
Christian Brabandt | 5bcfb5a | 2024-10-14 22:08:22 +0200 | [diff] [blame] | 1155 | *crontab* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1156 | One situation where "no" and "auto" will cause problems: A program |
| 1157 | that opens a file, invokes Vim to edit that file, and then tests if |
| 1158 | the open file was changed (through the file descriptor) will check the |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 1159 | backup file instead of the newly created file. "crontab -e" is an |
Christian Brabandt | 5bcfb5a | 2024-10-14 22:08:22 +0200 | [diff] [blame] | 1160 | example, as are several |file-watcher| daemons like inotify. In that |
| 1161 | case you probably want to switch this option. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1162 | |
| 1163 | When a copy is made, the original file is truncated and then filled |
| 1164 | with the new text. This means that protection bits, owner and |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 1165 | symbolic links of the original file are unmodified. The backup file, |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 1166 | however, is a new file, owned by the user who edited the file. The |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1167 | group of the backup is set to the group of the original file. If this |
| 1168 | fails, the protection bits for the group are made the same as for |
| 1169 | others. |
| 1170 | |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 1171 | When the file is renamed, this is the other way around: The backup has |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1172 | the same attributes of the original file, and the newly written file |
| 1173 | is owned by the current user. When the file was a (hard/symbolic) |
| 1174 | link, the new file will not! That's why the "auto" value doesn't |
| 1175 | rename when the file is a link. The owner and group of the newly |
| 1176 | written file will be set to the same ones as the original file, but |
| 1177 | the system may refuse to do this. In that case the "auto" value will |
| 1178 | again not rename the file. |
| 1179 | |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 1180 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 1181 | set and to the Vim default value when 'compatible' is reset. |
| 1182 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1183 | *'backupdir'* *'bdir'* |
| 1184 | 'backupdir' 'bdir' string (default for Amiga: ".,t:", |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 1185 | for Win32: ".,$TEMP,c:/tmp,c:/temp" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1186 | for Unix: ".,~/tmp,~/") |
| 1187 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1188 | List of directories for the backup file, separated with commas. |
| 1189 | - The backup file will be created in the first directory in the list |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1190 | where this is possible. The directory must exist, Vim will not |
| 1191 | create it for you. |
Bram Moolenaar | 3848e00 | 2016-03-19 18:42:29 +0100 | [diff] [blame] | 1192 | - Empty means that no backup file will be created ('patchmode' is |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1193 | impossible!). Writing may fail because of this. |
| 1194 | - A directory "." means to put the backup file in the same directory |
| 1195 | as the edited file. |
Bram Moolenaar | 8024f93 | 2020-01-14 19:29:13 +0100 | [diff] [blame] | 1196 | - A directory starting with "./" (or ".\" for MS-Windows) means to put |
| 1197 | the backup file relative to where the edited file is. The leading |
| 1198 | "." is replaced with the path name of the edited file. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1199 | ("." inside a directory name has no special meaning). |
| 1200 | - Spaces after the comma are ignored, other spaces are considered part |
| 1201 | of the directory name. To have a space at the start of a directory |
| 1202 | name, precede it with a backslash. |
| 1203 | - To include a comma in a directory name precede it with a backslash. |
| 1204 | - A directory name may end in an '/'. |
Bram Moolenaar | b782ba4 | 2018-08-07 21:39:28 +0200 | [diff] [blame] | 1205 | - For Unix and Win32, if a directory ends in two path separators "//", |
Bram Moolenaar | f0d58ef | 2018-11-16 16:13:44 +0100 | [diff] [blame] | 1206 | the backup file name will be built from the complete path to the |
| 1207 | file with all path separators changed to percent '%' signs. This |
| 1208 | will ensure file name uniqueness in the backup directory. |
Bram Moolenaar | b782ba4 | 2018-08-07 21:39:28 +0200 | [diff] [blame] | 1209 | On Win32, it is also possible to end with "\\". However, When a |
| 1210 | separating comma is following, you must use "//", since "\\" will |
| 1211 | include the comma in the file name. Therefore it is recommended to |
| 1212 | use '//', instead of '\\'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1213 | - Environment variables are expanded |:set_env|. |
| 1214 | - Careful with '\' characters, type one before a space, type two to |
| 1215 | get one in the option (see |option-backslash|), for example: > |
| 1216 | :set bdir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces |
| 1217 | < - For backwards compatibility with Vim version 3.0 a '>' at the start |
| 1218 | of the option is removed. |
| 1219 | See also 'backup' and 'writebackup' options. |
| 1220 | If you want to hide your backup files on Unix, consider this value: > |
| 1221 | :set backupdir=./.backup,~/.backup,.,/tmp |
| 1222 | < You must create a ".backup" directory in each directory and in your |
| 1223 | home directory for this to work properly. |
| 1224 | The use of |:set+=| and |:set-=| is preferred when adding or removing |
| 1225 | directories from the list. This avoids problems when a future version |
| 1226 | uses another default. |
| 1227 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 1228 | security reasons. |
| 1229 | |
| 1230 | *'backupext'* *'bex'* *E589* |
| 1231 | 'backupext' 'bex' string (default "~", for VMS: "_") |
| 1232 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1233 | String which is appended to a file name to make the name of the |
| 1234 | backup file. The default is quite unusual, because this avoids |
| 1235 | accidentally overwriting existing files with a backup file. You might |
| 1236 | prefer using ".bak", but make sure that you don't have files with |
| 1237 | ".bak" that you want to keep. |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 1238 | Only normal file name characters can be used; "/\*?[|<>" are illegal. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1239 | |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1240 | If you like to keep a lot of backups, you could use a BufWritePre |
| 1241 | autocommand to change 'backupext' just before writing the file to |
| 1242 | include a timestamp. > |
Bram Moolenaar | c51cf03 | 2022-02-26 12:25:45 +0000 | [diff] [blame] | 1243 | :au BufWritePre * let &bex = '-' .. strftime("%Y%b%d%X") .. '~' |
Bram Moolenaar | 3fdfa4a | 2004-10-07 21:02:47 +0000 | [diff] [blame] | 1244 | < Use 'backupdir' to put the backup in a different directory. |
| 1245 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1246 | *'backupskip'* *'bsk'* |
Bram Moolenaar | b8e22a0 | 2018-04-12 21:37:34 +0200 | [diff] [blame] | 1247 | 'backupskip' 'bsk' string (default: "$TMPDIR/*,$TMP/*,$TEMP/*" |
| 1248 | Unix: "/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*" |
| 1249 | Mac: "/private/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1250 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1251 | A list of file patterns. When one of the patterns matches with the |
| 1252 | name of the file which is written, no backup file is created. Both |
| 1253 | the specified file name and the full path name of the file are used. |
| 1254 | The pattern is used like with |:autocmd|, see |autocmd-patterns|. |
| 1255 | Watch out for special characters, see |option-backslash|. |
| 1256 | When $TMPDIR, $TMP or $TEMP is not defined, it is not used for the |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 1257 | default value. "/tmp/*" is only used for Unix. |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 1258 | |
Bram Moolenaar | 1aeaf8c | 2012-05-18 13:46:39 +0200 | [diff] [blame] | 1259 | WARNING: Not having a backup file means that when Vim fails to write |
| 1260 | your buffer correctly and then, for whatever reason, Vim exits, you |
| 1261 | lose both the original file and what you were writing. Only disable |
| 1262 | backups if you don't care about losing the file. |
| 1263 | |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 1264 | Note that environment variables are not expanded. If you want to use |
| 1265 | $HOME you must expand it explicitly, e.g.: > |
Bram Moolenaar | c51cf03 | 2022-02-26 12:25:45 +0000 | [diff] [blame] | 1266 | :let &backupskip = escape(expand('$HOME'), '\') .. '/tmp/*' |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 1267 | |
| 1268 | < Note that the default also makes sure that "crontab -e" works (when a |
Bram Moolenaar | a5792f5 | 2005-11-23 21:25:05 +0000 | [diff] [blame] | 1269 | backup would be made by renaming the original file crontab won't see |
| 1270 | the newly created file). Also see 'backupcopy' and |crontab|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1271 | |
| 1272 | *'balloondelay'* *'bdlay'* |
| 1273 | 'balloondelay' 'bdlay' number (default: 600) |
| 1274 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1275 | {only available when compiled with the |+balloon_eval| |
| 1276 | feature} |
| 1277 | Delay in milliseconds before a balloon may pop up. See |balloon-eval|. |
| 1278 | |
| 1279 | *'ballooneval'* *'beval'* *'noballooneval'* *'nobeval'* |
| 1280 | 'ballooneval' 'beval' boolean (default off) |
| 1281 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1282 | {only available when compiled with the |+balloon_eval| |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 1283 | feature} |
Bram Moolenaar | 51b0f37 | 2017-11-18 18:52:04 +0100 | [diff] [blame] | 1284 | Switch on the |balloon-eval| functionality for the GUI. |
| 1285 | |
| 1286 | *'balloonevalterm'* *'bevalterm'* *'noballoonevalterm'* |
| 1287 | *'nobevalterm'* |
| 1288 | 'balloonevalterm' 'bevalterm' boolean (default off) |
| 1289 | global |
Bram Moolenaar | 51b0f37 | 2017-11-18 18:52:04 +0100 | [diff] [blame] | 1290 | {only available when compiled with the |
| 1291 | |+balloon_eval_term| feature} |
| 1292 | Switch on the |balloon-eval| functionality for the terminal. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1293 | |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 1294 | *'balloonexpr'* *'bexpr'* |
| 1295 | 'balloonexpr' 'bexpr' string (default "") |
Bram Moolenaar | 9b2200a | 2006-03-20 21:55:45 +0000 | [diff] [blame] | 1296 | global or local to buffer |global-local| |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 1297 | {only available when compiled with the |+balloon_eval| |
| 1298 | feature} |
Bram Moolenaar | 97b2ad3 | 2006-03-18 21:40:56 +0000 | [diff] [blame] | 1299 | Expression for text to show in evaluation balloon. It is only used |
Bram Moolenaar | a6c27c4 | 2019-05-09 19:16:22 +0200 | [diff] [blame] | 1300 | when 'ballooneval' or 'balloonevalterm' is on. These variables can be |
| 1301 | used: |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 1302 | |
| 1303 | v:beval_bufnr number of the buffer in which balloon is going to show |
| 1304 | v:beval_winnr number of the window |
Bram Moolenaar | 82af871 | 2016-06-04 20:20:29 +0200 | [diff] [blame] | 1305 | v:beval_winid ID of the window |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 1306 | v:beval_lnum line number |
| 1307 | v:beval_col column number (byte index) |
| 1308 | v:beval_text word under or after the mouse pointer |
| 1309 | |
Bram Moolenaar | 5477506 | 2019-07-31 21:07:14 +0200 | [diff] [blame] | 1310 | Instead of showing a balloon, which is limited to plain text, consider |
| 1311 | using a popup window, see |popup_beval_example|. A popup window can |
| 1312 | use highlighting and show a border. |
| 1313 | |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 1314 | The evaluation of the expression must not have side effects! |
| 1315 | Example: > |
Bram Moolenaar | a6c27c4 | 2019-05-09 19:16:22 +0200 | [diff] [blame] | 1316 | function MyBalloonExpr() |
Bram Moolenaar | c51cf03 | 2022-02-26 12:25:45 +0000 | [diff] [blame] | 1317 | return 'Cursor is at line ' .. v:beval_lnum .. |
| 1318 | \ ', column ' .. v:beval_col .. |
| 1319 | \ ' of file ' .. bufname(v:beval_bufnr) .. |
| 1320 | \ ' on word "' .. v:beval_text .. '"' |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 1321 | endfunction |
| 1322 | set bexpr=MyBalloonExpr() |
Bram Moolenaar | f1dcd14 | 2022-12-31 15:30:45 +0000 | [diff] [blame] | 1323 | set ballooneval balloonevalterm |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 1324 | < |
Bram Moolenaar | 396e829 | 2019-07-13 23:04:31 +0200 | [diff] [blame] | 1325 | Also see |balloon_show()|, it can be used if the content of the balloon |
| 1326 | is to be fetched asynchronously. In that case evaluating |
| 1327 | 'balloonexpr' should result in an empty string. If you get a balloon |
| 1328 | with only "0" you probably didn't return anything from your function. |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 1329 | |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 1330 | NOTE: The balloon is displayed only if the cursor is on a text |
| 1331 | character. If the result of evaluating 'balloonexpr' is not empty, |
| 1332 | Vim does not try to send a message to an external debugger (Netbeans |
| 1333 | or Sun Workshop). |
| 1334 | |
Yegappan Lakshmanan | 8bb65f2 | 2021-12-26 10:51:39 +0000 | [diff] [blame] | 1335 | If the expression starts with s: or |<SID>|, then it is replaced with |
| 1336 | the script ID (|local-function|). Example: > |
| 1337 | set bexpr=s:MyBalloonExpr() |
| 1338 | set bexpr=<SID>SomeBalloonExpr() |
Bram Moolenaar | 6f4754b | 2022-01-23 12:07:04 +0000 | [diff] [blame] | 1339 | < Otherwise, the expression is evaluated in the context of the script |
| 1340 | where the option was set, thus script-local items are available. |
| 1341 | |
Bram Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 1342 | The expression will be evaluated in the |sandbox| when set from a |
| 1343 | modeline, see |sandbox-option|. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 1344 | This option cannot be set in a modeline when 'modelineexpr' is off. |
Bram Moolenaar | b71eaae | 2006-01-20 23:10:18 +0000 | [diff] [blame] | 1345 | |
| 1346 | It is not allowed to change text or jump to another window while |
Bram Moolenaar | 396e829 | 2019-07-13 23:04:31 +0200 | [diff] [blame] | 1347 | evaluating 'balloonexpr', see |textlock|. |
Bram Moolenaar | b71eaae | 2006-01-20 23:10:18 +0000 | [diff] [blame] | 1348 | |
Bram Moolenaar | 87e25fd | 2005-07-27 21:13:01 +0000 | [diff] [blame] | 1349 | To check whether line breaks in the balloon text work use this check: > |
Bram Moolenaar | 4536002 | 2005-07-21 21:08:21 +0000 | [diff] [blame] | 1350 | if has("balloon_multiline") |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 1351 | < When they are supported "\n" characters will start a new line. If the |
| 1352 | expression evaluates to a |List| this is equal to using each List item |
| 1353 | as a string and putting "\n" in between them. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 1354 | NOTE: This option is set to "" when 'compatible' is set. |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 1355 | |
Bram Moolenaar | 165bc69 | 2015-07-21 17:53:25 +0200 | [diff] [blame] | 1356 | *'belloff'* *'bo'* |
| 1357 | 'belloff' 'bo' string (default "") |
| 1358 | global |
Bram Moolenaar | 165bc69 | 2015-07-21 17:53:25 +0200 | [diff] [blame] | 1359 | Specifies for which events the bell will not be rung. It is a comma |
| 1360 | separated list of items. For each item that is present, the bell |
| 1361 | will be silenced. This is most useful to specify specific events in |
| 1362 | insert mode to be silenced. |
LemonBoy | 77771d3 | 2022-04-13 11:47:25 +0100 | [diff] [blame] | 1363 | You can also make it flash by using 'visualbell'. |
Bram Moolenaar | 165bc69 | 2015-07-21 17:53:25 +0200 | [diff] [blame] | 1364 | |
| 1365 | item meaning when present ~ |
| 1366 | all All events. |
| 1367 | backspace When hitting <BS> or <Del> and deleting results in an |
| 1368 | error. |
| 1369 | cursor Fail to move around using the cursor keys or |
| 1370 | <PageUp>/<PageDown> in |Insert-mode|. |
| 1371 | complete Error occurred when using |i_CTRL-X_CTRL-K| or |
| 1372 | |i_CTRL-X_CTRL-T|. |
| 1373 | copy Cannot copy char from insert mode using |i_CTRL-Y| or |
| 1374 | |i_CTRL-E|. |
| 1375 | ctrlg Unknown Char after <C-G> in Insert mode. |
| 1376 | error Other Error occurred (e.g. try to join last line) |
| 1377 | (mostly used in |Normal-mode| or |Cmdline-mode|). |
| 1378 | esc hitting <Esc> in |Normal-mode|. |
| 1379 | ex In |Visual-mode|, hitting |Q| results in an error. |
Bram Moolenaar | 0c0734d | 2019-11-26 21:44:46 +0100 | [diff] [blame] | 1380 | hangul Ignored. |
Bram Moolenaar | 165bc69 | 2015-07-21 17:53:25 +0200 | [diff] [blame] | 1381 | insertmode Pressing <Esc> in 'insertmode'. |
| 1382 | lang Calling the beep module for Lua/Mzscheme/TCL. |
| 1383 | mess No output available for |g<|. |
| 1384 | showmatch Error occurred for 'showmatch' function. |
| 1385 | operator Empty region error |cpo-E|. |
| 1386 | register Unknown register after <C-R> in |Insert-mode|. |
| 1387 | shell Bell from shell output |:!|. |
| 1388 | spell Error happened on spell suggest. |
LemonBoy | 77771d3 | 2022-04-13 11:47:25 +0100 | [diff] [blame] | 1389 | term Bell from |:terminal| output. |
Bram Moolenaar | 165bc69 | 2015-07-21 17:53:25 +0200 | [diff] [blame] | 1390 | wildmode More matches in |cmdline-completion| available |
| 1391 | (depends on the 'wildmode' setting). |
| 1392 | |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 1393 | This is most useful to fine tune when in Insert mode the bell should |
| 1394 | be rung. For Normal mode and Ex commands, the bell is often rung to |
Bram Moolenaar | 165bc69 | 2015-07-21 17:53:25 +0200 | [diff] [blame] | 1395 | indicate that an error occurred. It can be silenced by adding the |
| 1396 | "error" keyword. |
| 1397 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1398 | *'binary'* *'bin'* *'nobinary'* *'nobin'* |
| 1399 | 'binary' 'bin' boolean (default off) |
| 1400 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1401 | This option should be set before editing a binary file. You can also |
| 1402 | use the |-b| Vim argument. When this option is switched on a few |
| 1403 | options will be changed (also when it already was on): |
| 1404 | 'textwidth' will be set to 0 |
| 1405 | 'wrapmargin' will be set to 0 |
| 1406 | 'modeline' will be off |
| 1407 | 'expandtab' will be off |
| 1408 | Also, 'fileformat' and 'fileformats' options will not be used, the |
| 1409 | file is read and written like 'fileformat' was "unix" (a single <NL> |
| 1410 | separates lines). |
| 1411 | The 'fileencoding' and 'fileencodings' options will not be used, the |
| 1412 | file is read without conversion. |
| 1413 | NOTE: When you start editing a(nother) file while the 'bin' option is |
| 1414 | on, settings from autocommands may change the settings again (e.g., |
| 1415 | 'textwidth'), causing trouble when editing. You might want to set |
| 1416 | 'bin' again when the file has been loaded. |
| 1417 | The previous values of these options are remembered and restored when |
| 1418 | 'bin' is switched from on to off. Each buffer has its own set of |
| 1419 | saved option values. |
| 1420 | To edit a file with 'binary' set you can use the |++bin| argument. |
| 1421 | This avoids you have to do ":set bin", which would have effect for all |
| 1422 | files you edit. |
| 1423 | When writing a file the <EOL> for the last line is only written if |
| 1424 | there was one in the original file (normally Vim appends an <EOL> to |
| 1425 | the last line if there is none; this would make the file longer). See |
| 1426 | the 'endofline' option. |
| 1427 | |
| 1428 | *'bioskey'* *'biosk'* *'nobioskey'* *'nobiosk'* |
| 1429 | 'bioskey' 'biosk' boolean (default on) |
| 1430 | global |
Bram Moolenaar | 6c60f47 | 2019-04-28 16:00:35 +0200 | [diff] [blame] | 1431 | {only for MS-DOS} |
Bram Moolenaar | f391327 | 2016-02-25 00:00:01 +0100 | [diff] [blame] | 1432 | This was for MS-DOS and is no longer supported. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1433 | |
| 1434 | *'bomb'* *'nobomb'* |
| 1435 | 'bomb' boolean (default off) |
| 1436 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1437 | When writing a file and the following conditions are met, a BOM (Byte |
| 1438 | Order Mark) is prepended to the file: |
| 1439 | - this option is on |
| 1440 | - the 'binary' option is off |
| 1441 | - 'fileencoding' is "utf-8", "ucs-2", "ucs-4" or one of the little/big |
| 1442 | endian variants. |
| 1443 | Some applications use the BOM to recognize the encoding of the file. |
| 1444 | Often used for UCS-2 files on MS-Windows. For other applications it |
| 1445 | causes trouble, for example: "cat file1 file2" makes the BOM of file2 |
njohnston | aabca25 | 2023-11-19 23:18:57 +0000 | [diff] [blame] | 1446 | appear halfway through the resulting file. Gcc doesn't accept a BOM. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1447 | When Vim reads a file and 'fileencodings' starts with "ucs-bom", a |
| 1448 | check for the presence of the BOM is done and 'bomb' set accordingly. |
| 1449 | Unless 'binary' is set, it is removed from the first line, so that you |
| 1450 | don't see it when editing. When you don't change the options, the BOM |
| 1451 | will be restored when writing the file. |
| 1452 | |
| 1453 | *'breakat'* *'brk'* |
| 1454 | 'breakat' 'brk' string (default " ^I!@*-+;:,./?") |
| 1455 | global |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 1456 | {not available when compiled without the |+linebreak| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1457 | feature} |
| 1458 | This option lets you choose which characters might cause a line |
Bram Moolenaar | ac6e65f | 2005-08-29 22:25:38 +0000 | [diff] [blame] | 1459 | break if 'linebreak' is on. Only works for ASCII and also for 8-bit |
| 1460 | characters when 'encoding' is an 8-bit encoding. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1461 | |
Bram Moolenaar | 7c1c6db | 2016-04-03 22:08:05 +0200 | [diff] [blame] | 1462 | *'breakindent'* *'bri'* *'nobreakindent'* *'nobri'* |
Bram Moolenaar | 946e27a | 2014-06-25 18:50:27 +0200 | [diff] [blame] | 1463 | 'breakindent' 'bri' boolean (default off) |
| 1464 | local to window |
Bram Moolenaar | 946e27a | 2014-06-25 18:50:27 +0200 | [diff] [blame] | 1465 | {not available when compiled without the |+linebreak| |
| 1466 | feature} |
| 1467 | Every wrapped line will continue visually indented (same amount of |
| 1468 | space as the beginning of that line), thus preserving horizontal blocks |
| 1469 | of text. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 1470 | NOTE: This option is reset when 'compatible' is set. |
Bram Moolenaar | 946e27a | 2014-06-25 18:50:27 +0200 | [diff] [blame] | 1471 | |
| 1472 | *'breakindentopt'* *'briopt'* |
| 1473 | 'breakindentopt' 'briopt' string (default empty) |
| 1474 | local to window |
Bram Moolenaar | 946e27a | 2014-06-25 18:50:27 +0200 | [diff] [blame] | 1475 | {not available when compiled without the |+linebreak| |
| 1476 | feature} |
| 1477 | Settings for 'breakindent'. It can consist of the following optional |
Bram Moolenaar | 86b17e9 | 2014-07-02 20:00:47 +0200 | [diff] [blame] | 1478 | items and must be separated by a comma: |
Bram Moolenaar | 946e27a | 2014-06-25 18:50:27 +0200 | [diff] [blame] | 1479 | min:{n} Minimum text width that will be kept after |
| 1480 | applying 'breakindent', even if the resulting |
| 1481 | text should normally be narrower. This prevents |
| 1482 | text indented almost to the right window border |
Dominique Pellé | df62c62 | 2024-07-15 20:29:59 +0200 | [diff] [blame] | 1483 | occupying lots of vertical space when broken. |
Christian Brabandt | c53b467 | 2022-01-15 10:01:05 +0000 | [diff] [blame] | 1484 | (default: 20) |
Bram Moolenaar | 86b17e9 | 2014-07-02 20:00:47 +0200 | [diff] [blame] | 1485 | shift:{n} After applying 'breakindent', the wrapped line's |
| 1486 | beginning will be shifted by the given number of |
| 1487 | characters. It permits dynamic French paragraph |
Bram Moolenaar | 946e27a | 2014-06-25 18:50:27 +0200 | [diff] [blame] | 1488 | indentation (negative) or emphasizing the line |
| 1489 | continuation (positive). |
Christian Brabandt | e7d6dbc | 2022-05-06 12:21:04 +0100 | [diff] [blame] | 1490 | (default: 0) |
Bram Moolenaar | 22f1d0e | 2018-02-27 14:53:30 +0100 | [diff] [blame] | 1491 | sbr Display the 'showbreak' value before applying the |
Bram Moolenaar | 946e27a | 2014-06-25 18:50:27 +0200 | [diff] [blame] | 1492 | additional indent. |
Christian Brabandt | e7d6dbc | 2022-05-06 12:21:04 +0100 | [diff] [blame] | 1493 | (default: off) |
Maxim Kim | f674b35 | 2021-07-22 11:46:59 +0200 | [diff] [blame] | 1494 | list:{n} Adds an additional indent for lines that match a |
Christian Brabandt | 4a0b85a | 2021-07-14 20:00:27 +0200 | [diff] [blame] | 1495 | numbered or bulleted list (using the |
| 1496 | 'formatlistpat' setting). |
Christian Brabandt | e7d6dbc | 2022-05-06 12:21:04 +0100 | [diff] [blame] | 1497 | (default: 0) |
zeertzjq | 61a6ac4 | 2024-09-07 11:23:54 +0200 | [diff] [blame] | 1498 | list:-1 Uses the width of a match with 'formatlistpat' for |
| 1499 | indentation. |
Christian Brabandt | e7d6dbc | 2022-05-06 12:21:04 +0100 | [diff] [blame] | 1500 | column:{n} Indent at column {n}. Will overrule the other |
| 1501 | sub-options. Note: an additional indent may be |
| 1502 | added for the 'showbreak' setting. |
| 1503 | (default: off) |
Bram Moolenaar | 946e27a | 2014-06-25 18:50:27 +0200 | [diff] [blame] | 1504 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1505 | *'browsedir'* *'bsdir'* |
Bram Moolenaar | 7b0294c | 2004-10-11 10:16:09 +0000 | [diff] [blame] | 1506 | 'browsedir' 'bsdir' string (default: "last") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1507 | global |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 1508 | {only for Motif, GTK, Mac and Win32 GUI} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1509 | Which directory to use for the file browser: |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1510 | last Use same directory as with last file browser, where a |
Bram Moolenaar | 0bc380a | 2010-07-10 13:52:13 +0200 | [diff] [blame] | 1511 | file was opened or saved. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1512 | buffer Use the directory of the related buffer. |
| 1513 | current Use the current directory. |
| 1514 | {path} Use the specified directory |
| 1515 | |
| 1516 | *'bufhidden'* *'bh'* |
| 1517 | 'bufhidden' 'bh' string (default: "") |
Christian Brabandt | 596ad66 | 2023-08-16 00:11:09 +0200 | [diff] [blame] | 1518 | local to buffer |local-noglobal| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1519 | This option specifies what happens when a buffer is no longer |
| 1520 | displayed in a window: |
| 1521 | <empty> follow the global 'hidden' option |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 1522 | hide hide the buffer (don't unload it), even if 'hidden' is |
| 1523 | not set |
| 1524 | unload unload the buffer, even if 'hidden' is set; the |
Bram Moolenaar | 8a3b805 | 2022-06-26 12:21:15 +0100 | [diff] [blame] | 1525 | |:hide| command will also unload the buffer |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 1526 | delete delete the buffer from the buffer list, even if |
| 1527 | 'hidden' is set; the |:hide| command will also delete |
| 1528 | the buffer, making it behave like |:bdelete| |
| 1529 | wipe wipe the buffer from the buffer list, even if |
| 1530 | 'hidden' is set; the |:hide| command will also wipe |
| 1531 | out the buffer, making it behave like |:bwipeout| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1532 | |
Bram Moolenaar | a14de3d | 2005-01-07 21:48:26 +0000 | [diff] [blame] | 1533 | CAREFUL: when "unload", "delete" or "wipe" is used changes in a buffer |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 1534 | are lost without a warning. Also, these values may break autocommands |
| 1535 | that switch between buffers temporarily. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1536 | This option is used together with 'buftype' and 'swapfile' to specify |
| 1537 | special kinds of buffers. See |special-buffers|. |
| 1538 | |
| 1539 | *'buflisted'* *'bl'* *'nobuflisted'* *'nobl'* *E85* |
| 1540 | 'buflisted' 'bl' boolean (default: on) |
| 1541 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1542 | When this option is set, the buffer shows up in the buffer list. If |
| 1543 | it is reset it is not used for ":bnext", "ls", the Buffers menu, etc. |
| 1544 | This option is reset by Vim for buffers that are only used to remember |
| 1545 | a file name or marks. Vim sets it when starting to edit a buffer. |
| 1546 | But not when moving to a buffer with ":buffer". |
| 1547 | |
| 1548 | *'buftype'* *'bt'* *E382* |
| 1549 | 'buftype' 'bt' string (default: "") |
Christian Brabandt | 596ad66 | 2023-08-16 00:11:09 +0200 | [diff] [blame] | 1550 | local to buffer |local-noglobal| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1551 | The value of this option specifies the type of a buffer: |
| 1552 | <empty> normal buffer |
| 1553 | nofile buffer which is not related to a file and will not be |
| 1554 | written |
| 1555 | nowrite buffer which will not be written |
Bram Moolenaar | 21cf823 | 2004-07-16 20:18:37 +0000 | [diff] [blame] | 1556 | acwrite buffer which will always be written with BufWriteCmd |
Bram Moolenaar | b5b7562 | 2018-03-09 22:22:21 +0100 | [diff] [blame] | 1557 | autocommands. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1558 | quickfix quickfix buffer, contains list of errors |:cwindow| |
Bram Moolenaar | 280f126 | 2006-01-30 00:14:18 +0000 | [diff] [blame] | 1559 | or list of locations |:lwindow| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1560 | help help buffer (you are not supposed to set this |
| 1561 | manually) |
Bram Moolenaar | 1f2903c | 2017-07-23 19:51:01 +0200 | [diff] [blame] | 1562 | terminal buffer for a |terminal| (you are not supposed to set |
| 1563 | this manually) |
Bram Moolenaar | f273245 | 2018-06-03 14:47:35 +0200 | [diff] [blame] | 1564 | prompt buffer where only the last line can be edited, meant |
| 1565 | to be used by a plugin, see |prompt-buffer| |
| 1566 | {only when compiled with the |+channel| feature} |
Bram Moolenaar | 4d784b2 | 2019-05-25 19:51:39 +0200 | [diff] [blame] | 1567 | popup buffer used in a popup window, see |popup|. |
| 1568 | {only when compiled with the |+textprop| feature} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1569 | |
| 1570 | This option is used together with 'bufhidden' and 'swapfile' to |
| 1571 | specify special kinds of buffers. See |special-buffers|. |
Bram Moolenaar | ebdf3c9 | 2020-02-15 21:41:42 +0100 | [diff] [blame] | 1572 | Also see |win_gettype()|, which returns the type of the window. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1573 | |
| 1574 | Be careful with changing this option, it can have many side effects! |
Bram Moolenaar | 113cb51 | 2021-11-07 20:27:04 +0000 | [diff] [blame] | 1575 | One such effect is that Vim will not check the timestamp of the file, |
| 1576 | if the file is changed by another program this will not be noticed. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1577 | |
Bram Moolenaar | 280f126 | 2006-01-30 00:14:18 +0000 | [diff] [blame] | 1578 | A "quickfix" buffer is only used for the error list and the location |
| 1579 | list. This value is set by the |:cwindow| and |:lwindow| commands and |
| 1580 | you are not supposed to change it. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1581 | |
| 1582 | "nofile" and "nowrite" buffers are similar: |
| 1583 | both: The buffer is not to be written to disk, ":w" doesn't |
| 1584 | work (":w filename" does work though). |
| 1585 | both: The buffer is never considered to be |'modified'|. |
| 1586 | There is no warning when the changes will be lost, for |
| 1587 | example when you quit Vim. |
| 1588 | both: A swap file is only created when using too much memory |
| 1589 | (when 'swapfile' has been reset there is never a swap |
| 1590 | file). |
| 1591 | nofile only: The buffer name is fixed, it is not handled like a |
| 1592 | file name. It is not modified in response to a |:cd| |
| 1593 | command. |
Bram Moolenaar | 2b8388b | 2015-02-28 13:11:45 +0100 | [diff] [blame] | 1594 | both: When using ":e bufname" and already editing "bufname" |
| 1595 | the buffer is made empty and autocommands are |
| 1596 | triggered as usual for |:edit|. |
Bram Moolenaar | 21cf823 | 2004-07-16 20:18:37 +0000 | [diff] [blame] | 1597 | *E676* |
| 1598 | "acwrite" implies that the buffer name is not related to a file, like |
| 1599 | "nofile", but it will be written. Thus, in contrast to "nofile" and |
| 1600 | "nowrite", ":w" does work and a modified buffer can't be abandoned |
| 1601 | without saving. For writing there must be matching |BufWriteCmd|, |
| 1602 | |FileWriteCmd| or |FileAppendCmd| autocommands. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1603 | |
| 1604 | *'casemap'* *'cmp'* |
| 1605 | 'casemap' 'cmp' string (default: "internal,keepascii") |
| 1606 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1607 | Specifies details about changing the case of letters. It may contain |
| 1608 | these words, separated by a comma: |
| 1609 | internal Use internal case mapping functions, the current |
| 1610 | locale does not change the case mapping. This only |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1611 | matters when 'encoding' is a Unicode encoding, |
| 1612 | "latin1" or "iso-8859-15". When "internal" is |
| 1613 | omitted, the towupper() and towlower() system library |
| 1614 | functions are used when available. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1615 | keepascii For the ASCII characters (0x00 to 0x7f) use the US |
| 1616 | case mapping, the current locale is not effective. |
| 1617 | This probably only matters for Turkish. |
| 1618 | |
Bram Moolenaar | 938ae28 | 2023-02-20 20:44:55 +0000 | [diff] [blame] | 1619 | *'cdhome'* *'cdh'* *'nocdhome'* *'nocdh'* |
Bram Moolenaar | 7b1463b | 2021-12-11 17:24:39 +0000 | [diff] [blame] | 1620 | 'cdhome' 'cdh' boolean (default: off) |
| 1621 | global |
| 1622 | When on, |:cd|, |:tcd| and |:lcd| without an argument changes the |
| 1623 | current working directory to the |$HOME| directory like in Unix. |
| 1624 | When off, those commands just print the current directory name. |
| 1625 | On Unix this option has no effect. |
dkearns | 8ebdbc9 | 2023-10-29 06:26:19 +1100 | [diff] [blame] | 1626 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 1627 | security reasons. |
Bram Moolenaar | 7b1463b | 2021-12-11 17:24:39 +0000 | [diff] [blame] | 1628 | NOTE: This option is reset when 'compatible' is set. |
| 1629 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1630 | *'cdpath'* *'cd'* *E344* *E346* |
| 1631 | 'cdpath' 'cd' string (default: equivalent to $CDPATH or ",,") |
| 1632 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1633 | This is a list of directories which will be searched when using the |
Bram Moolenaar | 00aa069 | 2019-04-27 20:37:57 +0200 | [diff] [blame] | 1634 | |:cd|, |:tcd| and |:lcd| commands, provided that the directory being |
| 1635 | searched for has a relative path, not an absolute part starting with |
| 1636 | "/", "./" or "../", the 'cdpath' option is not used then. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1637 | The 'cdpath' option's value has the same form and semantics as |
| 1638 | |'path'|. Also see |file-searching|. |
| 1639 | The default value is taken from $CDPATH, with a "," prepended to look |
| 1640 | in the current directory first. |
| 1641 | If the default value taken from $CDPATH is not what you want, include |
| 1642 | a modified version of the following command in your vimrc file to |
| 1643 | override it: > |
Bram Moolenaar | c51cf03 | 2022-02-26 12:25:45 +0000 | [diff] [blame] | 1644 | :let &cdpath = ',' .. substitute(substitute($CDPATH, '[, ]', '\\\0', 'g'), ':', ',', 'g') |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1645 | < This option cannot be set from a |modeline| or in the |sandbox|, for |
| 1646 | security reasons. |
| 1647 | (parts of 'cdpath' can be passed to the shell to expand file names). |
| 1648 | |
| 1649 | *'cedit'* |
| 1650 | 'cedit' string (Vi default: "", Vim default: CTRL-F) |
| 1651 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1652 | The key used in Command-line Mode to open the command-line window. |
| 1653 | The default is CTRL-F when 'compatible' is off. |
| 1654 | Only non-printable keys are allowed. |
| 1655 | The key can be specified as a single character, but it is difficult to |
Milly | 2573243 | 2024-10-01 19:30:20 +0200 | [diff] [blame] | 1656 | type. The preferred way is to use |key-notation| (e.g. <Up>, <C-F>) or |
| 1657 | a letter preceded with a caret (e.g. `^F` is CTRL-F). Examples: > |
| 1658 | :set cedit=^Y |
| 1659 | :set cedit=<Esc> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1660 | < |Nvi| also has this option, but it only uses the first character. |
| 1661 | See |cmdwin|. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 1662 | NOTE: This option is set to the Vim default value when 'compatible' |
| 1663 | is reset. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1664 | |
| 1665 | *'charconvert'* *'ccv'* *E202* *E214* *E513* |
| 1666 | 'charconvert' 'ccv' string (default "") |
| 1667 | global |
Bram Moolenaar | 4c92e75 | 2019-02-17 21:18:32 +0100 | [diff] [blame] | 1668 | {only available when compiled with the |+eval| feature} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1669 | An expression that is used for character encoding conversion. It is |
| 1670 | evaluated when a file that is to be read or has been written has a |
| 1671 | different encoding from what is desired. |
| 1672 | 'charconvert' is not used when the internal iconv() function is |
| 1673 | supported and is able to do the conversion. Using iconv() is |
| 1674 | preferred, because it is much faster. |
| 1675 | 'charconvert' is not used when reading stdin |--|, because there is no |
| 1676 | file to convert from. You will have to save the text in a file first. |
Bram Moolenaar | f10911e | 2022-01-29 22:20:48 +0000 | [diff] [blame] | 1677 | The expression must return zero, false or an empty string for success, |
| 1678 | non-zero or true for failure. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1679 | The possible encoding names encountered are in 'encoding'. |
| 1680 | Additionally, names given in 'fileencodings' and 'fileencoding' are |
| 1681 | used. |
| 1682 | Conversion between "latin1", "unicode", "ucs-2", "ucs-4" and "utf-8" |
| 1683 | is done internally by Vim, 'charconvert' is not used for this. |
| 1684 | 'charconvert' is also used to convert the viminfo file, if the 'c' |
| 1685 | flag is present in 'viminfo'. Also used for Unicode conversion. |
| 1686 | Example: > |
| 1687 | set charconvert=CharConvert() |
| 1688 | fun CharConvert() |
| 1689 | system("recode " |
Bram Moolenaar | c51cf03 | 2022-02-26 12:25:45 +0000 | [diff] [blame] | 1690 | \ .. v:charconvert_from .. ".." .. v:charconvert_to |
| 1691 | \ .. " <" .. v:fname_in .. " >" .. v:fname_out) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1692 | return v:shell_error |
| 1693 | endfun |
| 1694 | < The related Vim variables are: |
| 1695 | v:charconvert_from name of the current encoding |
| 1696 | v:charconvert_to name of the desired encoding |
| 1697 | v:fname_in name of the input file |
| 1698 | v:fname_out name of the output file |
| 1699 | Note that v:fname_in and v:fname_out will never be the same. |
| 1700 | Note that v:charconvert_from and v:charconvert_to may be different |
| 1701 | from 'encoding'. Vim internally uses UTF-8 instead of UCS-2 or UCS-4. |
Bram Moolenaar | f10911e | 2022-01-29 22:20:48 +0000 | [diff] [blame] | 1702 | |
Bram Moolenaar | a4e0b97 | 2022-10-01 19:43:52 +0100 | [diff] [blame] | 1703 | The advantage of using a function call without arguments is that it is |
| 1704 | faster, see |expr-option-function|. |
| 1705 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1706 | Encryption is not done by Vim when using 'charconvert'. If you want |
| 1707 | to encrypt the file after conversion, 'charconvert' should take care |
| 1708 | of this. |
Bram Moolenaar | f10911e | 2022-01-29 22:20:48 +0000 | [diff] [blame] | 1709 | |
| 1710 | If the 'charconvert' expression starts with s: or |<SID>|, then it is |
| 1711 | replaced with the script ID (|local-function|). Example: > |
| 1712 | set charconvert=s:MyConvert() |
| 1713 | set charconvert=<SID>SomeConvert() |
| 1714 | < Otherwise the expression is evaluated in the context of the script |
| 1715 | where the option was set, thus script-local items are available. |
| 1716 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1717 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 1718 | security reasons. |
| 1719 | |
64-bitman | 88d41ab | 2025-04-06 17:20:39 +0200 | [diff] [blame] | 1720 | *'chistory'* *'chi'* |
| 1721 | 'chistory' 'chi' number (default: 10) |
| 1722 | global |
| 1723 | {only available when compiled with the |+quickfix| |
| 1724 | feature} |
| 1725 | Number of quickfix lists that should be remembered for the quickfix |
| 1726 | stack. Must be between 1 and 100. If the option is set to a value |
| 1727 | that is lower than the amount of entries in the quickfix list stack, |
| 1728 | entries will be removed starting from the oldest one. If the current |
| 1729 | quickfix list was removed, then the quickfix list at top of the stack |
| 1730 | (the most recently created) will be used in its place. For additional |
| 1731 | info, see |quickfix-stack|. |
| 1732 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1733 | *'cindent'* *'cin'* *'nocindent'* *'nocin'* |
| 1734 | 'cindent' 'cin' boolean (default off) |
| 1735 | local to buffer |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 1736 | Enables automatic C program indenting. See 'cinkeys' to set the keys |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1737 | that trigger reindenting in insert mode and 'cinoptions' to set your |
| 1738 | preferred indent style. |
| 1739 | If 'indentexpr' is not empty, it overrules 'cindent'. |
| 1740 | If 'lisp' is not on and both 'indentexpr' and 'equalprg' are empty, |
| 1741 | the "=" operator indents using this algorithm rather than calling an |
| 1742 | external program. |
| 1743 | See |C-indenting|. |
| 1744 | When you don't like the way 'cindent' works, try the 'smartindent' |
| 1745 | option or 'indentexpr'. |
| 1746 | This option is not used when 'paste' is set. |
| 1747 | NOTE: This option is reset when 'compatible' is set. |
| 1748 | |
| 1749 | *'cinkeys'* *'cink'* |
Bram Moolenaar | ce65574 | 2019-01-31 14:12:57 +0100 | [diff] [blame] | 1750 | 'cinkeys' 'cink' string (default "0{,0},0),0],:,0#,!^F,o,O,e") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1751 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1752 | A list of keys that, when typed in Insert mode, cause reindenting of |
| 1753 | the current line. Only used if 'cindent' is on and 'indentexpr' is |
| 1754 | empty. |
| 1755 | For the format of this option see |cinkeys-format|. |
| 1756 | See |C-indenting|. |
| 1757 | |
| 1758 | *'cinoptions'* *'cino'* |
| 1759 | 'cinoptions' 'cino' string (default "") |
| 1760 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1761 | The 'cinoptions' affect the way 'cindent' reindents lines in a C |
| 1762 | program. See |cinoptions-values| for the values of this option, and |
| 1763 | |C-indenting| for info on C indenting in general. |
| 1764 | |
laburnumT | 3f7855a | 2023-12-05 18:37:03 +0100 | [diff] [blame] | 1765 | *'cinscopedecls'* *'cinsd'* |
| 1766 | 'cinscopedecls' 'cinsd' string (default "public,protected,private") |
| 1767 | local to buffer |
| 1768 | Keywords that are interpreted as a C++ scope declaration by |cino-g|. |
| 1769 | Useful e.g. for working with the Qt framework that defines additional |
| 1770 | scope declarations "signals", "public slots" and "private slots": > |
| 1771 | set cinscopedecls+=signals,public\ slots,private\ slots |
| 1772 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1773 | *'cinwords'* *'cinw'* |
| 1774 | 'cinwords' 'cinw' string (default "if,else,while,do,for,switch") |
| 1775 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1776 | These keywords start an extra indent in the next line when |
| 1777 | 'smartindent' or 'cindent' is set. For 'cindent' this is only done at |
| 1778 | an appropriate place (inside {}). |
| 1779 | Note that 'ignorecase' isn't used for 'cinwords'. If case doesn't |
| 1780 | matter, include the keyword both the uppercase and lowercase: |
| 1781 | "if,If,IF". |
| 1782 | |
laburnumT | 3f7855a | 2023-12-05 18:37:03 +0100 | [diff] [blame] | 1783 | *'clipboard'* *'cb'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1784 | 'clipboard' 'cb' string (default "autoselect,exclude:cons\|linux" |
| 1785 | for X-windows, "" otherwise) |
| 1786 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1787 | {only in GUI versions or when the |+xterm_clipboard| |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 1788 | or |+wayland_clipboard| features are included} |
Tom Praschan | 3506cf3 | 2022-04-07 12:39:08 +0100 | [diff] [blame] | 1789 | This option is a list of comma-separated names. |
Bram Moolenaar | 942db23 | 2021-02-13 18:14:48 +0100 | [diff] [blame] | 1790 | Note: if one of the items is "exclude:", then you can't add an item |
Bram Moolenaar | 5ed1153 | 2022-07-06 13:18:11 +0100 | [diff] [blame] | 1791 | after that. Therefore do not append an item with += but use ^= to |
Bram Moolenaar | 942db23 | 2021-02-13 18:14:48 +0100 | [diff] [blame] | 1792 | prepend, e.g.: > |
| 1793 | set clipboard^=unnamed |
Bram Moolenaar | 9fbdbb8 | 2022-09-27 17:30:34 +0100 | [diff] [blame] | 1794 | < When using the GUI see |'go-A'|. |
| 1795 | These names are recognized: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1796 | |
Bram Moolenaar | c0885aa | 2012-07-10 16:49:23 +0200 | [diff] [blame] | 1797 | *clipboard-unnamed* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1798 | unnamed When included, Vim will use the clipboard register '*' |
| 1799 | for all yank, delete, change and put operations which |
| 1800 | would normally go to the unnamed register. When a |
| 1801 | register is explicitly specified, it will always be |
| 1802 | used regardless of whether "unnamed" is in 'clipboard' |
| 1803 | or not. The clipboard register can always be |
| 1804 | explicitly accessed using the "* notation. Also see |
| 1805 | |gui-clipboard|. |
| 1806 | |
Bram Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 1807 | *clipboard-unnamedplus* |
Bram Moolenaar | 0015450 | 2013-02-13 16:15:55 +0100 | [diff] [blame] | 1808 | unnamedplus A variant of the "unnamed" flag which uses the |
| 1809 | clipboard register '+' (|quoteplus|) instead of |
| 1810 | register '*' for all yank, delete, change and put |
| 1811 | operations which would normally go to the unnamed |
| 1812 | register. When "unnamed" is also included to the |
Hirohito Higashi | 73b9650 | 2025-06-28 18:18:21 +0200 | [diff] [blame] | 1813 | option, yank operations (but not delete, change or put) |
| 1814 | will additionally copy the text into register '*'. If |
| 1815 | wayland is being used and the compositor does not |
| 1816 | support the primary-selection-unstable-v1 protocol, |
| 1817 | then the regular selection is used in its place. Only |
| 1818 | available with the |+X11| or |+wayland_clipboard| |
| 1819 | feature. Availability can be checked with: > |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 1820 | if has('unnamedplus') |
Bram Moolenaar | bf9680e | 2010-12-02 21:43:16 +0100 | [diff] [blame] | 1821 | < |
Bram Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 1822 | *clipboard-autoselect* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1823 | autoselect Works like the 'a' flag in 'guioptions': If present, |
| 1824 | then whenever Visual mode is started, or the Visual |
| 1825 | area extended, Vim tries to become the owner of the |
| 1826 | windowing system's global selection or put the |
| 1827 | selected text on the clipboard used by the selection |
Bram Moolenaar | ba3ff53 | 2018-11-04 14:45:49 +0100 | [diff] [blame] | 1828 | register "*. See |'go-a'| and |quotestar| for details. |
| 1829 | When the GUI is active, the 'a' flag in 'guioptions' |
| 1830 | is used, when the GUI is not active, this "autoselect" |
| 1831 | flag is used. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1832 | Also applies to the modeless selection. |
| 1833 | |
Bram Moolenaar | c0885aa | 2012-07-10 16:49:23 +0200 | [diff] [blame] | 1834 | *clipboard-autoselectplus* |
| 1835 | autoselectplus Like "autoselect" but using the + register instead of |
| 1836 | the * register. Compare to the 'P' flag in |
| 1837 | 'guioptions'. |
| 1838 | |
| 1839 | *clipboard-autoselectml* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1840 | autoselectml Like "autoselect", but for the modeless selection |
| 1841 | only. Compare to the 'A' flag in 'guioptions'. |
| 1842 | |
Bram Moolenaar | c0885aa | 2012-07-10 16:49:23 +0200 | [diff] [blame] | 1843 | *clipboard-html* |
Bram Moolenaar | 3a6eaa5 | 2009-06-16 13:23:06 +0000 | [diff] [blame] | 1844 | html When the clipboard contains HTML, use this when |
| 1845 | pasting. When putting text on the clipboard, mark it |
| 1846 | as HTML. This works to copy rendered HTML from |
| 1847 | Firefox, paste it as raw HTML in Vim, select the HTML |
| 1848 | in Vim and paste it in a rich edit box in Firefox. |
Bram Moolenaar | 20a825a | 2010-05-31 21:27:30 +0200 | [diff] [blame] | 1849 | You probably want to add this only temporarily, |
| 1850 | possibly use BufEnter autocommands. |
Bram Moolenaar | 3a6eaa5 | 2009-06-16 13:23:06 +0000 | [diff] [blame] | 1851 | Only supported for GTK version 2 and later. |
Bram Moolenaar | 3a6eaa5 | 2009-06-16 13:23:06 +0000 | [diff] [blame] | 1852 | |
Bram Moolenaar | c0885aa | 2012-07-10 16:49:23 +0200 | [diff] [blame] | 1853 | *clipboard-exclude* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1854 | exclude:{pattern} |
| 1855 | Defines a pattern that is matched against the name of |
| 1856 | the terminal 'term'. If there is a match, no |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 1857 | connection will be made to the X server or wayland |
| 1858 | compositor. This is useful in this situation: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1859 | - Running Vim in a console. |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 1860 | - $DISPLAY/$WAYLAND_DISPLAY is set to start |
Hirohito Higashi | 73b9650 | 2025-06-28 18:18:21 +0200 | [diff] [blame] | 1861 | applications on another display. |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 1862 | - You do not want to connect to the X server/Wayland |
| 1863 | compositor in the console, but do want this in a |
| 1864 | terminal emulator. |
| 1865 | To never connect to the X server/Wayland compositor |
| 1866 | use: > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1867 | exclude:.* |
Hirohito Higashi | 73b9650 | 2025-06-28 18:18:21 +0200 | [diff] [blame] | 1868 | < This has the same effect as using the |-X| or |-Y| |
| 1869 | argument. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1870 | Note that when there is no connection to the X server |
| 1871 | the window title won't be restored and the clipboard |
Hirohito Higashi | 73b9650 | 2025-06-28 18:18:21 +0200 | [diff] [blame] | 1872 | cannot be accessed. This is the same for Wayland, |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 1873 | except there is no title restoring. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1874 | The value of 'magic' is ignored, {pattern} is |
| 1875 | interpreted as if 'magic' was on. |
| 1876 | The rest of the option value will be used for |
| 1877 | {pattern}, this must be the last entry. |
| 1878 | |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 1879 | *'clipmethod'* *'cpm'* |
| 1880 | 'clipmethod' 'cpm' string (default for Unix: "wayland,x11", |
| 1881 | for VMS: "x11", |
| 1882 | otherwise: "") |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 1883 | global |
Hirohito Higashi | 73b9650 | 2025-06-28 18:18:21 +0200 | [diff] [blame] | 1884 | {only when the |+xterm_clipboard| or |
| 1885 | |+wayland_clipboard| features are included} |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 1886 | Specifies which method of accessing the system clipboard is used, |
| 1887 | depending on which method works first or is available. Supported |
| 1888 | methods are: |
| 1889 | wayland Wayland selections |
| 1890 | x11 X11 selections |
| 1891 | |
| 1892 | Note: This option is ignored when either the GUI is running or if Vim |
| 1893 | is run on a system without wayland or X11 support, such as Windows or |
| 1894 | macOS. The GUI or system way of accessing the clipboard is always |
| 1895 | used instead. |
| 1896 | |
Hirohito Higashi | 73b9650 | 2025-06-28 18:18:21 +0200 | [diff] [blame] | 1897 | The option value is a list of comma separated items. The list is |
| 1898 | parsed left to right in order, and the first method that Vim |
| 1899 | determines is available or is working is used as the actual method for |
| 1900 | accessing the clipboard. |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 1901 | |
| 1902 | The current method that is being used can be found in the |v:clipmethod| |
| 1903 | variable. |
| 1904 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1905 | *'cmdheight'* *'ch'* |
| 1906 | 'cmdheight' 'ch' number (default 1) |
Shougo Matsushita | f39cfb7 | 2022-07-30 16:54:05 +0100 | [diff] [blame] | 1907 | global or local to tab page |
Bram Moolenaar | a2a8973 | 2022-08-31 14:46:18 +0100 | [diff] [blame] | 1908 | Number of screen lines to use for the command-line. A larger value |
| 1909 | helps avoiding |hit-enter| prompts. |
Bram Moolenaar | c6fe919 | 2006-04-09 21:54:49 +0000 | [diff] [blame] | 1910 | The value of this option is stored with the tab page, so that each tab |
| 1911 | page can have a different value. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1912 | |
| 1913 | *'cmdwinheight'* *'cwh'* |
| 1914 | 'cmdwinheight' 'cwh' number (default 7) |
| 1915 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1916 | Number of screen lines to use for the command-line window. |cmdwin| |
| 1917 | |
Bram Moolenaar | 483c5d8 | 2010-10-20 18:45:33 +0200 | [diff] [blame] | 1918 | *'colorcolumn'* *'cc'* |
| 1919 | 'colorcolumn' 'cc' string (default "") |
| 1920 | local to window |
Bram Moolenaar | 483c5d8 | 2010-10-20 18:45:33 +0200 | [diff] [blame] | 1921 | {not available when compiled without the |+syntax| |
| 1922 | feature} |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 1923 | 'colorcolumn' is a comma-separated list of screen columns that are |
Bram Moolenaar | 483c5d8 | 2010-10-20 18:45:33 +0200 | [diff] [blame] | 1924 | highlighted with ColorColumn |hl-ColorColumn|. Useful to align |
| 1925 | text. Will make screen redrawing slower. |
| 1926 | The screen column can be an absolute number, or a number preceded with |
| 1927 | '+' or '-', which is added to or subtracted from 'textwidth'. > |
| 1928 | |
Bram Moolenaar | 10e8ff9 | 2023-06-10 21:40:39 +0100 | [diff] [blame] | 1929 | :set cc=+1 " highlight column after 'textwidth' |
Bram Moolenaar | 483c5d8 | 2010-10-20 18:45:33 +0200 | [diff] [blame] | 1930 | :set cc=+1,+2,+3 " highlight three columns after 'textwidth' |
| 1931 | :hi ColorColumn ctermbg=lightgrey guibg=lightgrey |
| 1932 | < |
| 1933 | When 'textwidth' is zero then the items with '-' and '+' are not used. |
| 1934 | A maximum of 256 columns are highlighted. |
| 1935 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1936 | *'columns'* *'co'* *E594* |
| 1937 | 'columns' 'co' number (default 80 or terminal width) |
| 1938 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1939 | Number of columns of the screen. Normally this is set by the terminal |
Bram Moolenaar | 7c62692 | 2005-02-07 22:01:03 +0000 | [diff] [blame] | 1940 | initialization and does not have to be set by hand. Also see |
| 1941 | |posix-screen-size|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1942 | When Vim is running in the GUI or in a resizable window, setting this |
| 1943 | option will cause the window size to be changed. When you only want |
| 1944 | to use the size for the GUI, put the command in your |gvimrc| file. |
| 1945 | When you set this option and Vim is unable to change the physical |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 1946 | number of columns of the display, the display may be messed up. For |
| 1947 | the GUI it is always possible and Vim limits the number of columns to |
| 1948 | what fits on the screen. You can use this command to get the widest |
| 1949 | window possible: > |
| 1950 | :set columns=9999 |
| 1951 | < Minimum value is 12, maximum value is 10000. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1952 | |
| 1953 | *'comments'* *'com'* *E524* *E525* |
| 1954 | 'comments' 'com' string (default |
| 1955 | "s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-") |
| 1956 | local to buffer |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 1957 | A comma-separated list of strings that can start a comment line. See |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1958 | |format-comments|. See |option-backslash| about using backslashes to |
| 1959 | insert a space. |
| 1960 | |
| 1961 | *'commentstring'* *'cms'* *E537* |
Riley Bruins | 0a08306 | 2024-06-03 20:40:45 +0200 | [diff] [blame] | 1962 | 'commentstring' 'cms' string (default "/* %s */") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1963 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1964 | {not available when compiled without the |+folding| |
| 1965 | feature} |
| 1966 | A template for a comment. The "%s" in the value is replaced with the |
Riley Bruins | 0a08306 | 2024-06-03 20:40:45 +0200 | [diff] [blame] | 1967 | comment text, and should be padded with a space when possible. |
h-east | 84ac212 | 2024-06-17 18:12:30 +0200 | [diff] [blame] | 1968 | Currently used to add markers for folding, see |fold-marker|. Also |
Riley Bruins | 0a08306 | 2024-06-03 20:40:45 +0200 | [diff] [blame] | 1969 | commonly used by commenting plugins (e.g. |comment-install|). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1970 | |
| 1971 | *'compatible'* *'cp'* *'nocompatible'* *'nocp'* |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 1972 | 'compatible' 'cp' boolean (default on, off when a |vimrc| or |gvimrc| |
Bram Moolenaar | 8c08b5b | 2016-07-28 22:24:15 +0200 | [diff] [blame] | 1973 | file is found, reset in |defaults.vim|) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1974 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1975 | This option has the effect of making Vim either more Vi-compatible, or |
| 1976 | make Vim behave in a more useful way. |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 1977 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1978 | This is a special kind of option, because when it's set or reset, |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 1979 | other options are also changed as a side effect. |
| 1980 | NOTE: Setting or resetting this option can have a lot of unexpected |
| 1981 | effects: Mappings are interpreted in another way, undo behaves |
| 1982 | differently, etc. If you set this option in your vimrc file, you |
| 1983 | should probably put it at the very start. |
| 1984 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1985 | By default this option is on and the Vi defaults are used for the |
| 1986 | options. This default was chosen for those people who want to use Vim |
| 1987 | just like Vi, and don't even (want to) know about the 'compatible' |
| 1988 | option. |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 1989 | When a |vimrc| or |gvimrc| file is found while Vim is starting up, |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 1990 | this option is switched off, and all options that have not been |
| 1991 | modified will be set to the Vim defaults. Effectively, this means |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 1992 | that when a |vimrc| or |gvimrc| file exists, Vim will use the Vim |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 1993 | defaults, otherwise it will use the Vi defaults. (Note: This doesn't |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 1994 | happen for the system-wide vimrc or gvimrc file, nor for a file given |
| 1995 | with the |-u| argument). Also see |compatible-default| and |
| 1996 | |posix-compliance|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1997 | You can also set this option with the "-C" argument, and reset it with |
| 1998 | "-N". See |-C| and |-N|. |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 1999 | See 'cpoptions' for more fine tuning of Vi compatibility. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2000 | |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2001 | When this option is set, numerous other options are set to make Vim as |
| 2002 | Vi-compatible as possible. When this option is unset, various options |
| 2003 | are set to make Vim more useful. The table below lists all the |
| 2004 | options affected. |
| 2005 | The {?} column indicates when the options are affected: |
| 2006 | + Means that the option is set to the value given in {set value} when |
| 2007 | 'compatible' is set. |
| 2008 | & Means that the option is set to the value given in {set value} when |
| 2009 | 'compatible' is set AND is set to its Vim default value when |
| 2010 | 'compatible' is unset. |
| 2011 | - Means the option is NOT changed when setting 'compatible' but IS |
| 2012 | set to its Vim default when 'compatible' is unset. |
| 2013 | The {effect} column summarises the change when 'compatible' is set. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2014 | |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 2015 | option ? set value effect ~ |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2016 | |
| 2017 | 'allowrevins' + off no CTRL-_ command |
| 2018 | 'antialias' + off don't use antialiased fonts |
Bram Moolenaar | be4e016 | 2023-02-02 13:59:48 +0000 | [diff] [blame] | 2019 | 'arabic' + off reset arabic-related options |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2020 | 'arabicshape' + on correct character shapes |
| 2021 | 'backspace' + "" normal backspace |
| 2022 | 'backup' + off no backup file |
| 2023 | 'backupcopy' & Unix: "yes" backup file is a copy |
| 2024 | else: "auto" copy or rename backup file |
| 2025 | 'balloonexpr' + "" text to show in evaluation balloon |
| 2026 | 'breakindent' + off don't indent when wrapping lines |
| 2027 | 'cedit' - {unchanged} {set vim default only on resetting 'cp'} |
Bram Moolenaar | 7b1463b | 2021-12-11 17:24:39 +0000 | [diff] [blame] | 2028 | 'cdhome' + off ":cd" don't chdir to home on non-Unix |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2029 | 'cindent' + off no C code indentation |
| 2030 | 'compatible' - {unchanged} {set vim default only on resetting 'cp'} |
| 2031 | 'copyindent' + off don't copy indent structure |
| 2032 | 'cpoptions' & (all flags) Vi-compatible flags |
| 2033 | 'cscopepathcomp'+ 0 don't show directories in tags list |
Bram Moolenaar | 22f1d0e | 2018-02-27 14:53:30 +0100 | [diff] [blame] | 2034 | 'cscoperelative'+ off don't use basename of path as prefix |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2035 | 'cscopetag' + off don't use cscope for ":tag" |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 2036 | 'cscopetagorder'+ 0 see |cscopetagorder| |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2037 | 'cscopeverbose' + off see |cscopeverbose| |
| 2038 | 'delcombine' + off unicode: delete whole char combination |
| 2039 | 'digraph' + off no digraphs |
| 2040 | 'esckeys' & off no <Esc>-keys in Insert mode |
Christian Brabandt | 5f5131d | 2023-10-25 21:44:26 +0200 | [diff] [blame] | 2041 | this also disables |modifyOtherKeys| |
| 2042 | and |xterm-bracketed-paste| |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2043 | 'expandtab' + off tabs not expanded to spaces |
| 2044 | 'fileformats' & "" no automatic file format detection, |
Bram Moolenaar | 6f345a1 | 2019-12-17 21:27:18 +0100 | [diff] [blame] | 2045 | "dos,unix" except for MS-Windows |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2046 | 'formatexpr' + "" use 'formatprg' for auto-formatting |
| 2047 | 'formatoptions' & "vt" Vi compatible formatting |
| 2048 | 'gdefault' + off no default 'g' flag for ":s" |
| 2049 | 'history' & 0 no commandline history |
| 2050 | 'hkmap' + off no Hebrew keyboard mapping |
| 2051 | 'hkmapp' + off no phonetic Hebrew keyboard mapping |
| 2052 | 'hlsearch' + off no highlighting of search matches |
| 2053 | 'incsearch' + off no incremental searching |
| 2054 | 'indentexpr' + "" no indenting by expression |
| 2055 | 'insertmode' + off do not start in Insert mode |
| 2056 | 'iskeyword' & "@,48-57,_" keywords contain alphanumeric |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2057 | characters and '_' |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2058 | 'joinspaces' + on insert 2 spaces after period |
| 2059 | 'modeline' & off no modelines |
| 2060 | 'more' & off no pauses in listings |
| 2061 | 'mzquantum' - {unchanged} {set vim default only on resetting 'cp'} |
| 2062 | 'numberwidth' & 8 min number of columns for line number |
| 2063 | 'preserveindent'+ off don't preserve current indent structure |
| 2064 | when changing it |
| 2065 | 'revins' + off no reverse insert |
| 2066 | 'ruler' + off no ruler |
| 2067 | 'scrolljump' + 1 no jump scroll |
| 2068 | 'scrolloff' + 0 no scroll offset |
| 2069 | 'shelltemp' - {unchanged} {set vim default only on resetting 'cp'} |
| 2070 | 'shiftround' + off indent not rounded to shiftwidth |
Bram Moolenaar | 9dfa313 | 2019-05-04 21:08:40 +0200 | [diff] [blame] | 2071 | 'shortmess' & "S" no shortening of messages |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2072 | 'showcmd' & off command characters not shown |
| 2073 | 'showmode' & off current mode not shown |
| 2074 | 'sidescrolloff' + 0 cursor moves to edge of screen in scroll |
| 2075 | 'smartcase' + off no automatic ignore case switch |
| 2076 | 'smartindent' + off no smart indentation |
| 2077 | 'smarttab' + off no smart tab size |
Damien Lejay | 91af4c4 | 2025-06-12 21:56:19 +0200 | [diff] [blame] | 2078 | 'softtabstop' + 0 no soft tab stops |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2079 | 'startofline' + on goto startofline with some commands |
| 2080 | 'tagcase' & "followic" 'ignorecase' when searching tags file |
| 2081 | 'tagrelative' & off tag file names are not relative |
| 2082 | 'termguicolors' + off don't use highlight-(guifg|guibg) |
| 2083 | 'textauto' & off no automatic textmode detection |
| 2084 | 'textwidth' + 0 no automatic line wrap |
| 2085 | 'tildeop' + off tilde is not an operator |
| 2086 | 'ttimeout' + off no terminal timeout |
| 2087 | 'undofile' + off don't use an undo file |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 2088 | 'viminfo' - {unchanged} {set Vim default only on resetting 'cp'} |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2089 | 'virtualedit' + "" cursor can only be placed on characters |
| 2090 | 'whichwrap' & "" left-right movements don't wrap |
| 2091 | 'wildchar' & CTRL-E only when the current value is <Tab> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2092 | use CTRL-E for cmdline completion |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2093 | 'writebackup' + on or off depends on the |+writebackup| feature |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2094 | |
| 2095 | *'complete'* *'cpt'* *E535* |
| 2096 | 'complete' 'cpt' string (default: ".,w,b,u,t,i") |
| 2097 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2098 | This option specifies how keyword completion |ins-completion| works |
| 2099 | when CTRL-P or CTRL-N are used. It is also used for whole-line |
| 2100 | completion |i_CTRL-X_CTRL-L|. It indicates the type of completion |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 2101 | and the places to scan. It is a comma-separated list of flags: |
Bram Moolenaar | 3848e00 | 2016-03-19 18:42:29 +0100 | [diff] [blame] | 2102 | . scan the current buffer ('wrapscan' is ignored) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2103 | w scan buffers from other windows |
| 2104 | b scan other loaded buffers that are in the buffer list |
| 2105 | u scan the unloaded buffers that are in the buffer list |
| 2106 | U scan the buffers that are not in the buffer list |
| 2107 | k scan the files given with the 'dictionary' option |
Bram Moolenaar | 0b23879 | 2006-03-02 22:49:12 +0000 | [diff] [blame] | 2108 | kspell use the currently active spell checking |spell| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2109 | k{dict} scan the file {dict}. Several "k" flags can be given, |
| 2110 | patterns are valid too. For example: > |
| 2111 | :set cpt=k/usr/dict/*,k~/spanish |
| 2112 | < s scan the files given with the 'thesaurus' option |
| 2113 | s{tsr} scan the file {tsr}. Several "s" flags can be given, patterns |
| 2114 | are valid too. |
| 2115 | i scan current and included files |
| 2116 | d scan current and included files for defined name or macro |
| 2117 | |i_CTRL-X_CTRL-D| |
| 2118 | ] tag completion |
| 2119 | t same as "]" |
Girish Palya | 14f6da5 | 2025-05-26 19:04:25 +0200 | [diff] [blame] | 2120 | F{func} call the function {func}. Multiple "F" flags may be specified. |
Girish Palya | cbe5319 | 2025-04-14 22:13:15 +0200 | [diff] [blame] | 2121 | Refer to |complete-functions| for details on how the function |
| 2122 | is invoked and what it should return. The value can be the |
| 2123 | name of a function or a |Funcref|. For |Funcref| values, |
| 2124 | spaces must be escaped with a backslash ('\'), and commas with |
| 2125 | double backslashes ('\\') (see |option-backslash|). |
| 2126 | If the Dict returned by the {func} includes {"refresh": "always"}, |
| 2127 | the function will be invoked again whenever the leading text |
| 2128 | changes. |
| 2129 | Completion matches are always inserted at the keyword |
| 2130 | boundary, regardless of the column returned by {func} when |
| 2131 | a:findstart is 1. This ensures compatibility with other |
| 2132 | completion sources. |
| 2133 | To make further modifications to the inserted text, {func} |
| 2134 | can make use of |CompleteDonePre|. |
| 2135 | If generating matches is potentially slow, |complete_check()| |
| 2136 | should be used to avoid blocking and preserve editor |
| 2137 | responsiveness. |
Girish Palya | 14f6da5 | 2025-05-26 19:04:25 +0200 | [diff] [blame] | 2138 | F equivalent to using "F{func}", where the function is taken from |
Girish Palya | cbe5319 | 2025-04-14 22:13:15 +0200 | [diff] [blame] | 2139 | the 'completefunc' option. |
Girish Palya | 14f6da5 | 2025-05-26 19:04:25 +0200 | [diff] [blame] | 2140 | o equivalent to using "F{func}", where the function is taken from |
Girish Palya | cbe5319 | 2025-04-14 22:13:15 +0200 | [diff] [blame] | 2141 | the 'omnifunc' option. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2142 | |
| 2143 | Unloaded buffers are not loaded, thus their autocmds |:autocmd| are |
| 2144 | not executed, this may lead to unexpected completions from some files |
| 2145 | (gzipped files for example). Unloaded buffers are not scanned for |
| 2146 | whole-line completion. |
| 2147 | |
| 2148 | The default is ".,w,b,u,t,i", which means to scan: |
| 2149 | 1. the current buffer |
| 2150 | 2. buffers in other windows |
| 2151 | 3. other loaded buffers |
| 2152 | 4. unloaded buffers |
| 2153 | 5. tags |
| 2154 | 6. included files |
| 2155 | |
| 2156 | As you can see, CTRL-N and CTRL-P can be used to do any 'iskeyword'- |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 2157 | based expansion (e.g., dictionary |i_CTRL-X_CTRL-K|, included patterns |
| 2158 | |i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2159 | |
Girish Palya | 0ac1eb3 | 2025-04-16 20:18:33 +0200 | [diff] [blame] | 2160 | An optional match limit can be specified for a completion source by |
| 2161 | appending a caret ("^") followed by a {count} to the source flag. |
| 2162 | For example: ".^9,w,u,t^5" limits matches from the current buffer |
Hirohito Higashi | fa8b7db | 2025-04-30 19:12:37 +0200 | [diff] [blame] | 2163 | to 9 and from tags to 5. Other sources remain unlimited. |
| 2164 | Note: The match limit takes effect only during forward completion |
| 2165 | (CTRL-N) and is ignored during backward completion (CTRL-P). |
Girish Palya | 0ac1eb3 | 2025-04-16 20:18:33 +0200 | [diff] [blame] | 2166 | |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 2167 | *'completefunc'* *'cfu'* |
| 2168 | 'completefunc' 'cfu' string (default: empty) |
| 2169 | local to buffer |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 2170 | {not available when compiled without the |+eval| |
Bram Moolenaar | e2c453d | 2019-08-21 14:37:09 +0200 | [diff] [blame] | 2171 | feature} |
Bram Moolenaar | c7486e0 | 2005-12-29 22:48:26 +0000 | [diff] [blame] | 2172 | This option specifies a function to be used for Insert mode completion |
| 2173 | with CTRL-X CTRL-U. |i_CTRL-X_CTRL-U| |
Bram Moolenaar | 280f126 | 2006-01-30 00:14:18 +0000 | [diff] [blame] | 2174 | See |complete-functions| for an explanation of how the function is |
Yegappan Lakshmanan | 8658c75 | 2021-12-03 11:09:29 +0000 | [diff] [blame] | 2175 | invoked and what it should return. The value can be the name of a |
| 2176 | function, a |lambda| or a |Funcref|. See |option-value-function| for |
| 2177 | more information. |
Bram Moolenaar | 166af9b | 2010-11-16 20:34:40 +0100 | [diff] [blame] | 2178 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 2179 | security reasons. |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 2180 | |
glepnir | f31cfa2 | 2025-03-06 21:59:13 +0100 | [diff] [blame] | 2181 | *'completefuzzycollect'* *'cfc'* |
| 2182 | 'completefuzzycollect' 'cfc' string (default: empty) |
| 2183 | global |
zeertzjq | 1dc731a | 2025-03-13 21:30:10 +0100 | [diff] [blame] | 2184 | A comma-separated list of strings to enable fuzzy collection for |
| 2185 | specific |ins-completion| modes, affecting how matches are gathered |
| 2186 | during completion. For specified modes, fuzzy matching is used to |
| 2187 | find completion candidates instead of the standard prefix-based |
| 2188 | matching. This option can contain the following values: |
glepnir | 53b1457 | 2025-03-12 21:28:39 +0100 | [diff] [blame] | 2189 | |
glepnir | 5876016 | 2025-03-13 21:39:51 +0100 | [diff] [blame] | 2190 | keyword keywords in the current file |i_CTRL-X_CTRL-N| |
| 2191 | keywords with flags ".", "w", |i_CTRL-N| |i_CTRL-P| |
| 2192 | "b", "u", "U" and "k{dict}" in 'complete' |
| 2193 | keywords in 'dictionary' |i_CTRL-X_CTRL-K| |
glepnir | 53b1457 | 2025-03-12 21:28:39 +0100 | [diff] [blame] | 2194 | |
glepnir | 5876016 | 2025-03-13 21:39:51 +0100 | [diff] [blame] | 2195 | files file names |i_CTRL-X_CTRL-F| |
glepnir | 53b1457 | 2025-03-12 21:28:39 +0100 | [diff] [blame] | 2196 | |
glepnir | 5876016 | 2025-03-13 21:39:51 +0100 | [diff] [blame] | 2197 | whole_line whole lines |i_CTRL-X_CTRL-L| |
glepnir | 53b1457 | 2025-03-12 21:28:39 +0100 | [diff] [blame] | 2198 | |
Christian Brabandt | f22580e | 2025-03-14 12:05:52 +0100 | [diff] [blame] | 2199 | When using the 'completeopt' "longest" option value, fuzzy collection |
glepnir | 5876016 | 2025-03-13 21:39:51 +0100 | [diff] [blame] | 2200 | can identify the longest common string among the best fuzzy matches |
| 2201 | and insert it automatically. |
glepnir | f31cfa2 | 2025-03-06 21:59:13 +0100 | [diff] [blame] | 2202 | |
glepnir | 6a89c94 | 2024-10-01 20:32:12 +0200 | [diff] [blame] | 2203 | *'completeitemalign'* *'cia'* |
| 2204 | 'completeitemalign' 'cia' string (default: "abbr,kind,menu") |
| 2205 | global |
zeertzjq | 85a50fe | 2025-02-27 19:24:32 +0100 | [diff] [blame] | 2206 | A comma-separated list of strings that controls the alignment and |
| 2207 | display order of items in the popup menu during Insert mode |
| 2208 | completion. The supported values are "abbr", "kind", and "menu". |
| 2209 | These values allow customizing how |complete-items| are shown in the |
glepnir | 6a89c94 | 2024-10-01 20:32:12 +0200 | [diff] [blame] | 2210 | popup menu. Note: must always contain those three values in any |
| 2211 | order. |
| 2212 | |
Bram Moolenaar | 1c7715d | 2005-10-03 22:02:18 +0000 | [diff] [blame] | 2213 | *'completeopt'* *'cot'* |
Bram Moolenaar | 96d2c5b | 2006-03-11 21:27:59 +0000 | [diff] [blame] | 2214 | 'completeopt' 'cot' string (default: "menu,preview") |
zeertzjq | 529b9ad | 2024-06-05 20:27:06 +0200 | [diff] [blame] | 2215 | global or local to buffer |global-local| |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 2216 | A comma-separated list of options for Insert mode completion |
Bram Moolenaar | c7453f5 | 2006-02-10 23:20:28 +0000 | [diff] [blame] | 2217 | |ins-completion|. The supported values are: |
Bram Moolenaar | 1c7715d | 2005-10-03 22:02:18 +0000 | [diff] [blame] | 2218 | |
glepnir | a2c5559 | 2025-02-28 17:43:42 +0100 | [diff] [blame] | 2219 | fuzzy Enable |fuzzy-matching| for completion candidates. This |
| 2220 | allows for more flexible and intuitive matching, where |
| 2221 | characters can be skipped and matches can be found even |
zeertzjq | 53d59ec | 2025-03-07 19:09:09 +0100 | [diff] [blame] | 2222 | if the exact sequence is not typed. Note: This option |
glepnir | f31cfa2 | 2025-03-06 21:59:13 +0100 | [diff] [blame] | 2223 | does not affect the collection of candidate list, it only |
| 2224 | controls how completion candidates are reduced from the |
zeertzjq | 53d59ec | 2025-03-07 19:09:09 +0100 | [diff] [blame] | 2225 | list of alternatives. If you want to use |fuzzy-matching| |
glepnir | f31cfa2 | 2025-03-06 21:59:13 +0100 | [diff] [blame] | 2226 | to gather more alternatives for your candidate list, |
| 2227 | see |'completefuzzycollect'|. |
glepnir | a2c5559 | 2025-02-28 17:43:42 +0100 | [diff] [blame] | 2228 | |
| 2229 | longest Only insert the longest common text of the matches. If |
| 2230 | the menu is displayed you can use CTRL-L to add more |
| 2231 | characters. Whether case is ignored depends on the kind |
| 2232 | of completion. For buffer text the 'ignorecase' option is |
| 2233 | used. |
| 2234 | |
Bram Moolenaar | 1c7715d | 2005-10-03 22:02:18 +0000 | [diff] [blame] | 2235 | menu Use a popup menu to show the possible completions. The |
| 2236 | menu is only shown when there is more than one match and |
| 2237 | sufficient colors are available. |ins-completion-menu| |
| 2238 | |
Bram Moolenaar | 65c923a | 2006-03-03 22:56:30 +0000 | [diff] [blame] | 2239 | menuone Use the popup menu also when there is only one match. |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 2240 | Useful when there is additional information about the |
Bram Moolenaar | 65c923a | 2006-03-03 22:56:30 +0000 | [diff] [blame] | 2241 | match, e.g., what file it comes from. |
| 2242 | |
Girish Palya | cb3b752 | 2025-04-18 18:52:28 +0200 | [diff] [blame] | 2243 | nearest Matches are listed based on their proximity to the cursor |
| 2244 | position, unlike the default behavior, which only |
| 2245 | considers proximity for matches appearing below the |
| 2246 | cursor. This applies only to matches from the current |
Girish Palya | b156588 | 2025-04-15 20:16:00 +0200 | [diff] [blame] | 2247 | buffer. No effect if "fuzzy" is present. |
| 2248 | |
glepnir | a2c5559 | 2025-02-28 17:43:42 +0100 | [diff] [blame] | 2249 | noinsert Do not insert any text for a match until the user selects |
zeertzjq | 659cb28 | 2025-03-03 20:18:04 +0100 | [diff] [blame] | 2250 | a match from the menu. Only works in combination with |
| 2251 | "menu" or "menuone". No effect if "longest" is present. |
Bram Moolenaar | c7453f5 | 2006-02-10 23:20:28 +0000 | [diff] [blame] | 2252 | |
glepnir | a2c5559 | 2025-02-28 17:43:42 +0100 | [diff] [blame] | 2253 | noselect Same as "noinsert", except that no menu item is |
zeertzjq | 659cb28 | 2025-03-03 20:18:04 +0100 | [diff] [blame] | 2254 | pre-selected. If both "noinsert" and "noselect" are |
glepnir | a2c5559 | 2025-02-28 17:43:42 +0100 | [diff] [blame] | 2255 | present, "noselect" has precedence. |
| 2256 | |
| 2257 | nosort Disable sorting of completion candidates based on fuzzy |
zeertzjq | 659cb28 | 2025-03-03 20:18:04 +0100 | [diff] [blame] | 2258 | scores when "fuzzy" is enabled. Candidates will appear |
glepnir | a2c5559 | 2025-02-28 17:43:42 +0100 | [diff] [blame] | 2259 | in their original order. |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 2260 | |
Bram Moolenaar | 576a4a6 | 2019-08-18 15:25:17 +0200 | [diff] [blame] | 2261 | popup Show extra information about the currently selected |
| 2262 | completion in a popup window. Only works in combination |
| 2263 | with "menu" or "menuone". Overrides "preview". |
Bram Moolenaar | 62a0cb4 | 2019-08-18 16:35:23 +0200 | [diff] [blame] | 2264 | See |'completepopup'| for specifying properties. |
Bram Moolenaar | 2e693a8 | 2019-10-16 22:35:02 +0200 | [diff] [blame] | 2265 | {only works when compiled with the |+textprop| feature} |
Bram Moolenaar | 576a4a6 | 2019-08-18 15:25:17 +0200 | [diff] [blame] | 2266 | |
Bram Moolenaar | dca7abe | 2019-10-20 18:17:57 +0200 | [diff] [blame] | 2267 | popuphidden |
Bram Moolenaar | 0c0734d | 2019-11-26 21:44:46 +0100 | [diff] [blame] | 2268 | Just like "popup" but initially hide the popup. Use a |
Bram Moolenaar | dca7abe | 2019-10-20 18:17:57 +0200 | [diff] [blame] | 2269 | |CompleteChanged| autocommand to fetch the info and call |
| 2270 | |popup_show()| once the popup has been filled. |
| 2271 | See the example at |complete-popuphidden|. |
| 2272 | {only works when compiled with the |+textprop| feature} |
| 2273 | |
glepnir | edd4ac3 | 2025-01-29 18:53:51 +0100 | [diff] [blame] | 2274 | preinsert |
| 2275 | Preinsert the portion of the first candidate word that is |
| 2276 | not part of the current completion leader and using the |
glepnir | 94a045e | 2025-03-01 16:12:23 +0100 | [diff] [blame] | 2277 | |hl-ComplMatchIns| highlight group. In order for it to |
zeertzjq | 659cb28 | 2025-03-03 20:18:04 +0100 | [diff] [blame] | 2278 | work, "fuzzy" must not be set and "menuone" must be set. |
glepnir | a2c5559 | 2025-02-28 17:43:42 +0100 | [diff] [blame] | 2279 | |
| 2280 | preview Show extra information about the currently selected |
| 2281 | completion in the preview window. Only works in |
| 2282 | combination with "menu" or "menuone". |
glepnir | edd4ac3 | 2025-01-29 18:53:51 +0100 | [diff] [blame] | 2283 | |
Ilya Grigoriev | 053aee0 | 2025-06-11 21:07:35 +0200 | [diff] [blame] | 2284 | This option does not apply to |cmdline-completion|. See 'wildoptions' |
| 2285 | for that. |
| 2286 | |
Bram Moolenaar | 62a0cb4 | 2019-08-18 16:35:23 +0200 | [diff] [blame] | 2287 | *'completepopup'* *'cpp'* |
| 2288 | 'completepopup' 'cpp' string (default empty) |
| 2289 | global |
| 2290 | {not available when compiled without the |+textprop| |
| 2291 | or |+quickfix| feature} |
| 2292 | When 'completeopt' contains "popup" then this option is used for the |
Bram Moolenaar | 447bfba | 2020-07-18 16:07:16 +0200 | [diff] [blame] | 2293 | properties of the info popup when it is created. If an info popup |
| 2294 | window already exists it is closed, so that the option value is |
| 2295 | applied when it is created again. |
| 2296 | You can also use |popup_findinfo()| and then set properties for an |
| 2297 | existing info popup with |popup_setoptions()|. See |complete-popup|. |
Bram Moolenaar | 62a0cb4 | 2019-08-18 16:35:23 +0200 | [diff] [blame] | 2298 | |
laburnumT | 3f7855a | 2023-12-05 18:37:03 +0100 | [diff] [blame] | 2299 | *'completeslash'* *'csl'* |
| 2300 | 'completeslash' 'csl' string (default: "") |
| 2301 | local to buffer |
| 2302 | {only for MS-Windows} |
| 2303 | When this option is set it overrules 'shellslash' for completion: |
| 2304 | - When this option is set to "slash", a forward slash is used for path |
| 2305 | completion in insert mode. This is useful when editing HTML tag, or |
| 2306 | Makefile with 'noshellslash' on MS-Windows. |
| 2307 | - When this option is set to "backslash", backslash is used. This is |
| 2308 | useful when editing a batch file with 'shellslash' set on MS-Windows. |
| 2309 | - When this option is empty, same character is used as for |
| 2310 | 'shellslash'. |
| 2311 | For Insert mode completion the buffer-local value is used. For |
| 2312 | command line completion the global value is used. |
Bram Moolenaar | 62a0cb4 | 2019-08-18 16:35:23 +0200 | [diff] [blame] | 2313 | |
Bram Moolenaar | f5963f7 | 2010-07-23 22:10:27 +0200 | [diff] [blame] | 2314 | *'concealcursor'* *'cocu'* |
| 2315 | 'concealcursor' 'cocu' string (default: "") |
| 2316 | local to window |
Bram Moolenaar | f5963f7 | 2010-07-23 22:10:27 +0200 | [diff] [blame] | 2317 | {not available when compiled without the |+conceal| |
| 2318 | feature} |
| 2319 | Sets the modes in which text in the cursor line can also be concealed. |
| 2320 | When the current mode is listed then concealing happens just like in |
| 2321 | other lines. |
| 2322 | n Normal mode |
| 2323 | v Visual mode |
| 2324 | i Insert mode |
Bram Moolenaar | ca8c986 | 2010-07-24 15:00:38 +0200 | [diff] [blame] | 2325 | c Command line editing, for 'incsearch' |
Bram Moolenaar | f5963f7 | 2010-07-23 22:10:27 +0200 | [diff] [blame] | 2326 | |
Bram Moolenaar | e6dc573 | 2010-07-24 23:52:26 +0200 | [diff] [blame] | 2327 | 'v' applies to all lines in the Visual area, not only the cursor. |
Bram Moolenaar | ca8c986 | 2010-07-24 15:00:38 +0200 | [diff] [blame] | 2328 | A useful value is "nc". This is used in help files. So long as you |
Bram Moolenaar | f5963f7 | 2010-07-23 22:10:27 +0200 | [diff] [blame] | 2329 | are moving around text is concealed, but when starting to insert text |
| 2330 | or selecting a Visual area the concealed text is displayed, so that |
| 2331 | you can see what you are doing. |
Bram Moolenaar | f70e3d6 | 2010-07-24 13:15:07 +0200 | [diff] [blame] | 2332 | Keep in mind that the cursor position is not always where it's |
| 2333 | displayed. E.g., when moving vertically it may change column. |
Bram Moolenaar | f5963f7 | 2010-07-23 22:10:27 +0200 | [diff] [blame] | 2334 | |
Bram Moolenaar | 95bafa2 | 2018-10-02 13:26:25 +0200 | [diff] [blame] | 2335 | *'conceallevel'* *'cole'* |
| 2336 | 'conceallevel' 'cole' number (default 0) |
Bram Moolenaar | 860cae1 | 2010-06-05 23:22:07 +0200 | [diff] [blame] | 2337 | local to window |
Bram Moolenaar | 860cae1 | 2010-06-05 23:22:07 +0200 | [diff] [blame] | 2338 | {not available when compiled without the |+conceal| |
| 2339 | feature} |
Bram Moolenaar | 6df6f47 | 2010-07-18 18:04:50 +0200 | [diff] [blame] | 2340 | Determine how text with the "conceal" syntax attribute |:syn-conceal| |
| 2341 | is shown: |
Bram Moolenaar | 860cae1 | 2010-06-05 23:22:07 +0200 | [diff] [blame] | 2342 | |
Bram Moolenaar | 6df6f47 | 2010-07-18 18:04:50 +0200 | [diff] [blame] | 2343 | Value Effect ~ |
Bram Moolenaar | 860cae1 | 2010-06-05 23:22:07 +0200 | [diff] [blame] | 2344 | 0 Text is shown normally |
Bram Moolenaar | 477db06 | 2010-07-28 18:17:41 +0200 | [diff] [blame] | 2345 | 1 Each block of concealed text is replaced with one |
| 2346 | character. If the syntax item does not have a custom |
| 2347 | replacement character defined (see |:syn-cchar|) the |
| 2348 | character defined in 'listchars' is used (default is a |
| 2349 | space). |
| 2350 | It is highlighted with the "Conceal" highlight group. |
Bram Moolenaar | 860cae1 | 2010-06-05 23:22:07 +0200 | [diff] [blame] | 2351 | 2 Concealed text is completely hidden unless it has a |
| 2352 | custom replacement character defined (see |
Bram Moolenaar | 477db06 | 2010-07-28 18:17:41 +0200 | [diff] [blame] | 2353 | |:syn-cchar|). |
Bram Moolenaar | a7781e0 | 2010-07-19 20:13:22 +0200 | [diff] [blame] | 2354 | 3 Concealed text is completely hidden. |
Bram Moolenaar | 860cae1 | 2010-06-05 23:22:07 +0200 | [diff] [blame] | 2355 | |
Bram Moolenaar | a7781e0 | 2010-07-19 20:13:22 +0200 | [diff] [blame] | 2356 | Note: in the cursor line concealed text is not hidden, so that you can |
Bram Moolenaar | f5963f7 | 2010-07-23 22:10:27 +0200 | [diff] [blame] | 2357 | edit and copy the text. This can be changed with the 'concealcursor' |
| 2358 | option. |
Bram Moolenaar | 860cae1 | 2010-06-05 23:22:07 +0200 | [diff] [blame] | 2359 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2360 | *'confirm'* *'cf'* *'noconfirm'* *'nocf'* |
| 2361 | 'confirm' 'cf' boolean (default off) |
| 2362 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2363 | When 'confirm' is on, certain operations that would normally |
| 2364 | fail because of unsaved changes to a buffer, e.g. ":q" and ":e", |
| 2365 | instead raise a |dialog| asking if you wish to save the current |
| 2366 | file(s). You can still use a ! to unconditionally |abandon| a buffer. |
| 2367 | If 'confirm' is off you can still activate confirmation for one |
| 2368 | command only (this is most useful in mappings) with the |:confirm| |
| 2369 | command. |
| 2370 | Also see the |confirm()| function and the 'v' flag in 'guioptions'. |
| 2371 | |
| 2372 | *'conskey'* *'consk'* *'noconskey'* *'noconsk'* |
| 2373 | 'conskey' 'consk' boolean (default off) |
| 2374 | global |
Bram Moolenaar | f391327 | 2016-02-25 00:00:01 +0100 | [diff] [blame] | 2375 | This was for MS-DOS and is no longer supported. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2376 | |
| 2377 | *'copyindent'* *'ci'* *'nocopyindent'* *'noci'* |
| 2378 | 'copyindent' 'ci' boolean (default off) |
| 2379 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2380 | Copy the structure of the existing lines indent when autoindenting a |
| 2381 | new line. Normally the new indent is reconstructed by a series of |
| 2382 | tabs followed by spaces as required (unless |'expandtab'| is enabled, |
| 2383 | in which case only spaces are used). Enabling this option makes the |
| 2384 | new line copy whatever characters were used for indenting on the |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 2385 | existing line. 'expandtab' has no effect on these characters, a Tab |
| 2386 | remains a Tab. If the new indent is greater than on the existing |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2387 | line, the remaining space is filled in the normal manner. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 2388 | NOTE: This option is reset when 'compatible' is set. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2389 | Also see 'preserveindent'. |
| 2390 | |
Bram Moolenaar | e0fa374 | 2016-02-20 15:47:01 +0100 | [diff] [blame] | 2391 | *'cpoptions'* *'cpo'* *cpo* |
Illia Bobyr | 03d20aa | 2024-07-16 20:10:16 +0200 | [diff] [blame] | 2392 | 'cpoptions' 'cpo' string (Vim default: "aABceFsz", |
| 2393 | Vi default: all flags, except "#{|&/\." |
h-east | 90e1fe4 | 2024-08-12 18:26:08 +0200 | [diff] [blame] | 2394 | |$VIM_POSIX|: all flags) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2395 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2396 | A sequence of single character flags. When a character is present |
Bram Moolenaar | 7cba6c0 | 2013-09-05 22:13:31 +0200 | [diff] [blame] | 2397 | this indicates Vi-compatible behavior. This is used for things where |
| 2398 | not being Vi-compatible is mostly or sometimes preferred. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2399 | 'cpoptions' stands for "compatible-options". |
| 2400 | Commas can be added for readability. |
| 2401 | To avoid problems with flags that are added in the future, use the |
| 2402 | "+=" and "-=" feature of ":set" |add-option-flags|. |
Bram Moolenaar | 71eb3ad | 2021-12-26 12:07:30 +0000 | [diff] [blame] | 2403 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2404 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 2405 | set and to the Vim default value when 'compatible' is reset. |
Bram Moolenaar | 71eb3ad | 2021-12-26 12:07:30 +0000 | [diff] [blame] | 2406 | |
| 2407 | NOTE: In a |Vim9| script, when `vim9script` is encountered, the value |
| 2408 | is saved, 'cpoptions' is set to the Vim default, and the saved value |
| 2409 | is restored at the end of the script. Changes to the value of |
| 2410 | 'cpoptions' will be applied to the saved value, but keep in mind that |
| 2411 | removing a flag that is not present when 'cpoptions' is changed has no |
| 2412 | effect. In the |.vimrc| file the value is not restored, thus using |
| 2413 | `vim9script` in the |.vimrc| file results in using the Vim default. |
| 2414 | |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 2415 | NOTE: This option is set to the POSIX default value at startup when |
| 2416 | the Vi default value would be used and the $VIM_POSIX environment |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 2417 | variable exists |posix|. This means Vim tries to behave like the |
| 2418 | POSIX specification. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2419 | |
| 2420 | contains behavior ~ |
| 2421 | *cpo-a* |
| 2422 | a When included, a ":read" command with a file name |
| 2423 | argument will set the alternate file name for the |
| 2424 | current window. |
| 2425 | *cpo-A* |
| 2426 | A When included, a ":write" command with a file name |
| 2427 | argument will set the alternate file name for the |
| 2428 | current window. |
| 2429 | *cpo-b* |
| 2430 | b "\|" in a ":map" command is recognized as the end of |
| 2431 | the map command. The '\' is included in the mapping, |
| 2432 | the text after the '|' is interpreted as the next |
| 2433 | command. Use a CTRL-V instead of a backslash to |
| 2434 | include the '|' in the mapping. Applies to all |
| 2435 | mapping, abbreviation, menu and autocmd commands. |
| 2436 | See also |map_bar|. |
| 2437 | *cpo-B* |
| 2438 | B A backslash has no special meaning in mappings, |
Bram Moolenaar | a9604e6 | 2018-07-21 05:56:22 +0200 | [diff] [blame] | 2439 | abbreviations, user commands and the "to" part of the |
| 2440 | menu commands. Remove this flag to be able to use a |
| 2441 | backslash like a CTRL-V. For example, the command |
| 2442 | ":map X \<Esc>" results in X being mapped to: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2443 | 'B' included: "\^[" (^[ is a real <Esc>) |
| 2444 | 'B' excluded: "<Esc>" (5 characters) |
| 2445 | ('<' excluded in both cases) |
| 2446 | *cpo-c* |
| 2447 | c Searching continues at the end of any match at the |
| 2448 | cursor position, but not further than the start of the |
| 2449 | next line. When not present searching continues |
| 2450 | one character from the cursor position. With 'c' |
| 2451 | "abababababab" only gets three matches when repeating |
| 2452 | "/abab", without 'c' there are five matches. |
| 2453 | *cpo-C* |
| 2454 | C Do not concatenate sourced lines that start with a |
| 2455 | backslash. See |line-continuation|. |
| 2456 | *cpo-d* |
| 2457 | d Using "./" in the 'tags' option doesn't mean to use |
| 2458 | the tags file relative to the current file, but the |
| 2459 | tags file in the current directory. |
| 2460 | *cpo-D* |
| 2461 | D Can't use CTRL-K to enter a digraph after Normal mode |
| 2462 | commands with a character argument, like |r|, |f| and |
| 2463 | |t|. |
| 2464 | *cpo-e* |
| 2465 | e When executing a register with ":@r", always add a |
| 2466 | <CR> to the last line, also when the register is not |
| 2467 | linewise. If this flag is not present, the register |
| 2468 | is not linewise and the last line does not end in a |
| 2469 | <CR>, then the last line is put on the command-line |
| 2470 | and can be edited before hitting <CR>. |
| 2471 | *cpo-E* |
| 2472 | E It is an error when using "y", "d", "c", "g~", "gu" or |
| 2473 | "gU" on an Empty region. The operators only work when |
Bram Moolenaar | 15142e2 | 2018-04-30 22:19:58 +0200 | [diff] [blame] | 2474 | at least one character is to be operated on. Example: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2475 | This makes "y0" fail in the first column. |
| 2476 | *cpo-f* |
| 2477 | f When included, a ":read" command with a file name |
| 2478 | argument will set the file name for the current buffer, |
| 2479 | if the current buffer doesn't have a file name yet. |
| 2480 | *cpo-F* |
| 2481 | F When included, a ":write" command with a file name |
| 2482 | argument will set the file name for the current |
| 2483 | buffer, if the current buffer doesn't have a file name |
Bram Moolenaar | b348038 | 2005-12-11 21:33:32 +0000 | [diff] [blame] | 2484 | yet. Also see |cpo-P|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2485 | *cpo-g* |
| 2486 | g Goto line 1 when using ":edit" without argument. |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 2487 | *cpo-H* |
| 2488 | H When using "I" on a line with only blanks, insert |
| 2489 | before the last blank. Without this flag insert after |
| 2490 | the last blank. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2491 | *cpo-i* |
| 2492 | i When included, interrupting the reading of a file will |
| 2493 | leave it modified. |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 2494 | *cpo-I* |
| 2495 | I When moving the cursor up or down just after inserting |
| 2496 | indent for 'autoindent', do not delete the indent. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2497 | *cpo-j* |
| 2498 | j When joining lines, only add two spaces after a '.', |
| 2499 | not after '!' or '?'. Also see 'joinspaces'. |
| 2500 | *cpo-J* |
| 2501 | J A |sentence| has to be followed by two spaces after |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 2502 | the '.', '!' or '?'. A <Tab> is not recognized as |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2503 | white space. |
| 2504 | *cpo-k* |
| 2505 | k Disable the recognition of raw key codes in |
| 2506 | mappings, abbreviations, and the "to" part of menu |
| 2507 | commands. For example, if <Key> sends ^[OA (where ^[ |
| 2508 | is <Esc>), the command ":map X ^[OA" results in X |
| 2509 | being mapped to: |
| 2510 | 'k' included: "^[OA" (3 characters) |
| 2511 | 'k' excluded: "<Key>" (one key code) |
| 2512 | Also see the '<' flag below. |
| 2513 | *cpo-K* |
| 2514 | K Don't wait for a key code to complete when it is |
| 2515 | halfway a mapping. This breaks mapping <F1><F1> when |
| 2516 | only part of the second <F1> has been read. It |
| 2517 | enables cancelling the mapping by typing <F1><Esc>. |
| 2518 | *cpo-l* |
| 2519 | l Backslash in a [] range in a search pattern is taken |
Bram Moolenaar | 26a60b4 | 2005-02-22 08:49:11 +0000 | [diff] [blame] | 2520 | literally, only "\]", "\^", "\-" and "\\" are special. |
| 2521 | See |/[]| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2522 | 'l' included: "/[ \t]" finds <Space>, '\' and 't' |
| 2523 | 'l' excluded: "/[ \t]" finds <Space> and <Tab> |
Bram Moolenaar | 26a60b4 | 2005-02-22 08:49:11 +0000 | [diff] [blame] | 2524 | Also see |cpo-\|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2525 | *cpo-L* |
| 2526 | L When the 'list' option is set, 'wrapmargin', |
| 2527 | 'textwidth', 'softtabstop' and Virtual Replace mode |
| 2528 | (see |gR|) count a <Tab> as two characters, instead of |
| 2529 | the normal behavior of a <Tab>. |
| 2530 | *cpo-m* |
| 2531 | m When included, a showmatch will always wait half a |
| 2532 | second. When not included, a showmatch will wait half |
| 2533 | a second or until a character is typed. |'showmatch'| |
| 2534 | *cpo-M* |
| 2535 | M When excluded, "%" matching will take backslashes into |
| 2536 | account. Thus in "( \( )" and "\( ( \)" the outer |
| 2537 | parenthesis match. When included "%" ignores |
| 2538 | backslashes, which is Vi compatible. |
| 2539 | *cpo-n* |
Bram Moolenaar | 6448667 | 2010-05-16 15:46:46 +0200 | [diff] [blame] | 2540 | n When included, the column used for 'number' and |
| 2541 | 'relativenumber' will also be used for text of wrapped |
| 2542 | lines. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2543 | *cpo-o* |
| 2544 | o Line offset to search command is not remembered for |
| 2545 | next search. |
| 2546 | *cpo-O* |
| 2547 | O Don't complain if a file is being overwritten, even |
| 2548 | when it didn't exist when editing it. This is a |
| 2549 | protection against a file unexpectedly created by |
| 2550 | someone else. Vi didn't complain about this. |
| 2551 | *cpo-p* |
| 2552 | p Vi compatible Lisp indenting. When not present, a |
| 2553 | slightly better algorithm is used. |
Bram Moolenaar | b348038 | 2005-12-11 21:33:32 +0000 | [diff] [blame] | 2554 | *cpo-P* |
| 2555 | P When included, a ":write" command that appends to a |
| 2556 | file will set the file name for the current buffer, if |
| 2557 | the current buffer doesn't have a file name yet and |
| 2558 | the 'F' flag is also included |cpo-F|. |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 2559 | *cpo-q* |
| 2560 | q When joining multiple lines leave the cursor at the |
| 2561 | position where it would be when joining two lines. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2562 | *cpo-r* |
| 2563 | r Redo ("." command) uses "/" to repeat a search |
| 2564 | command, instead of the actually used search string. |
| 2565 | *cpo-R* |
| 2566 | R Remove marks from filtered lines. Without this flag |
| 2567 | marks are kept like |:keepmarks| was used. |
| 2568 | *cpo-s* |
| 2569 | s Set buffer options when entering the buffer for the |
| 2570 | first time. This is like it is in Vim version 3.0. |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 2571 | And it is the default. If not present the options are |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2572 | set when the buffer is created. |
| 2573 | *cpo-S* |
| 2574 | S Set buffer options always when entering a buffer |
| 2575 | (except 'readonly', 'fileformat', 'filetype' and |
| 2576 | 'syntax'). This is the (most) Vi compatible setting. |
| 2577 | The options are set to the values in the current |
| 2578 | buffer. When you change an option and go to another |
| 2579 | buffer, the value is copied. Effectively makes the |
| 2580 | buffer options global to all buffers. |
| 2581 | |
| 2582 | 's' 'S' copy buffer options |
| 2583 | no no when buffer created |
| 2584 | yes no when buffer first entered (default) |
| 2585 | X yes each time when buffer entered (vi comp.) |
| 2586 | *cpo-t* |
| 2587 | t Search pattern for the tag command is remembered for |
| 2588 | "n" command. Otherwise Vim only puts the pattern in |
| 2589 | the history for search pattern, but doesn't change the |
| 2590 | last used search pattern. |
| 2591 | *cpo-u* |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 2592 | u Undo is Vi compatible. See |undo-two-ways|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2593 | *cpo-v* |
| 2594 | v Backspaced characters remain visible on the screen in |
| 2595 | Insert mode. Without this flag the characters are |
| 2596 | erased from the screen right away. With this flag the |
| 2597 | screen newly typed text overwrites backspaced |
| 2598 | characters. |
| 2599 | *cpo-w* |
| 2600 | w When using "cw" on a blank character, only change one |
| 2601 | character and not all blanks until the start of the |
| 2602 | next word. |
| 2603 | *cpo-W* |
| 2604 | W Don't overwrite a readonly file. When omitted, ":w!" |
| 2605 | overwrites a readonly file, if possible. |
| 2606 | *cpo-x* |
| 2607 | x <Esc> on the command-line executes the command-line. |
| 2608 | The default in Vim is to abandon the command-line, |
| 2609 | because <Esc> normally aborts a command. |c_<Esc>| |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 2610 | *cpo-X* |
| 2611 | X When using a count with "R" the replaced text is |
| 2612 | deleted only once. Also when repeating "R" with "." |
| 2613 | and a count. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2614 | *cpo-y* |
Bram Moolenaar | d09091d | 2019-01-17 16:07:22 +0100 | [diff] [blame] | 2615 | y A yank command can be redone with ".". Think twice if |
| 2616 | you really want to use this, it may break some |
| 2617 | plugins, since most people expect "." to only repeat a |
| 2618 | change. |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 2619 | *cpo-Z* |
| 2620 | Z When using "w!" while the 'readonly' option is set, |
| 2621 | don't reset 'readonly'. |
Christian Brabandt | 22105fd | 2024-07-15 20:51:11 +0200 | [diff] [blame] | 2622 | *cpo-z* |
| 2623 | z Special casing the "cw" and "d" command (see |cw| and |
| 2624 | |d-special|). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2625 | *cpo-!* |
| 2626 | ! When redoing a filter command, use the last used |
| 2627 | external command, whatever it was. Otherwise the last |
| 2628 | used -filter- command is used. |
| 2629 | *cpo-$* |
| 2630 | $ When making a change to one line, don't redisplay the |
| 2631 | line, but put a '$' at the end of the changed text. |
| 2632 | The changed text will be overwritten when you type the |
| 2633 | new text. The line is redisplayed if you type any |
| 2634 | command that moves the cursor from the insertion |
| 2635 | point. |
| 2636 | *cpo-%* |
| 2637 | % Vi-compatible matching is done for the "%" command. |
| 2638 | Does not recognize "#if", "#endif", etc. |
| 2639 | Does not recognize "/*" and "*/". |
| 2640 | Parens inside single and double quotes are also |
| 2641 | counted, causing a string that contains a paren to |
| 2642 | disturb the matching. For example, in a line like |
| 2643 | "if (strcmp("foo(", s))" the first paren does not |
| 2644 | match the last one. When this flag is not included, |
| 2645 | parens inside single and double quotes are treated |
| 2646 | specially. When matching a paren outside of quotes, |
| 2647 | everything inside quotes is ignored. When matching a |
| 2648 | paren inside quotes, it will find the matching one (if |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 2649 | there is one). This works very well for C programs. |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 2650 | This flag is also used for other features, such as |
| 2651 | C-indenting. |
Bram Moolenaar | 7c62692 | 2005-02-07 22:01:03 +0000 | [diff] [blame] | 2652 | *cpo--* |
| 2653 | - When included, a vertical movement command fails when |
Bram Moolenaar | 8ada17c | 2006-01-19 22:16:24 +0000 | [diff] [blame] | 2654 | it would go above the first line or below the last |
| 2655 | line. Without it the cursor moves to the first or |
| 2656 | last line, unless it already was in that line. |
Bram Moolenaar | 7c62692 | 2005-02-07 22:01:03 +0000 | [diff] [blame] | 2657 | Applies to the commands "-", "k", CTRL-P, "+", "j", |
Bram Moolenaar | 8ada17c | 2006-01-19 22:16:24 +0000 | [diff] [blame] | 2658 | CTRL-N, CTRL-J and ":1234". |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 2659 | *cpo-+* |
| 2660 | + When included, a ":write file" command will reset the |
| 2661 | 'modified' flag of the buffer, even though the buffer |
| 2662 | itself may still be different from its file. |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 2663 | *cpo-star* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2664 | * Use ":*" in the same way as ":@". When not included, |
| 2665 | ":*" is an alias for ":'<,'>", select the Visual area. |
| 2666 | *cpo-<* |
| 2667 | < Disable the recognition of special key codes in |<>| |
| 2668 | form in mappings, abbreviations, and the "to" part of |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 2669 | menu commands. For example, the command |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2670 | ":map X <Tab>" results in X being mapped to: |
| 2671 | '<' included: "<Tab>" (5 characters) |
| 2672 | '<' excluded: "^I" (^I is a real <Tab>) |
| 2673 | Also see the 'k' flag above. |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 2674 | *cpo->* |
| 2675 | > When appending to a register, put a line break before |
| 2676 | the appended text. |
Bram Moolenaar | 8b3e033 | 2011-06-26 05:36:34 +0200 | [diff] [blame] | 2677 | *cpo-;* |
| 2678 | ; When using |,| or |;| to repeat the last |t| search |
| 2679 | and the cursor is right in front of the searched |
| 2680 | character, the cursor won't move. When not included, |
| 2681 | the cursor would skip over it and jump to the |
Bram Moolenaar | c873442 | 2012-06-01 22:38:45 +0200 | [diff] [blame] | 2682 | following occurrence. |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 2683 | |
| 2684 | POSIX flags. These are not included in the Vi default value, except |
| 2685 | when $VIM_POSIX was set on startup. |posix| |
| 2686 | |
| 2687 | contains behavior ~ |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 2688 | *cpo-#* |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 2689 | # A count before "D", "o" and "O" has no effect. |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 2690 | *cpo-&* |
| 2691 | & When ":preserve" was used keep the swap file when |
| 2692 | exiting normally while this buffer is still loaded. |
| 2693 | This flag is tested when exiting. |
Bram Moolenaar | 26a60b4 | 2005-02-22 08:49:11 +0000 | [diff] [blame] | 2694 | *cpo-\* |
| 2695 | \ Backslash in a [] range in a search pattern is taken |
| 2696 | literally, only "\]" is special See |/[]| |
Bram Moolenaar | 90915b5 | 2005-08-21 22:17:52 +0000 | [diff] [blame] | 2697 | '\' included: "/[ \-]" finds <Space>, '\' and '-' |
| 2698 | '\' excluded: "/[ \-]" finds <Space> and '-' |
| 2699 | Also see |cpo-l|. |
Bram Moolenaar | 26a60b4 | 2005-02-22 08:49:11 +0000 | [diff] [blame] | 2700 | *cpo-/* |
| 2701 | / When "%" is used as the replacement string in a |:s| |
| 2702 | command, use the previous replacement string. |:s%| |
| 2703 | *cpo-{* |
| 2704 | { The |{| and |}| commands also stop at a "{" character |
| 2705 | at the start of a line. |
| 2706 | *cpo-.* |
| 2707 | . The ":chdir" and ":cd" commands fail if the current |
| 2708 | buffer is modified, unless ! is used. Vim doesn't |
| 2709 | need this, since it remembers the full path of an |
| 2710 | opened file. |
| 2711 | *cpo-bar* |
| 2712 | | The value of the $LINES and $COLUMNS environment |
| 2713 | variables overrule the terminal size values obtained |
| 2714 | with system specific functions. |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 2715 | |
Bram Moolenaar | 40e6a71 | 2010-05-16 22:32:54 +0200 | [diff] [blame] | 2716 | *'cryptmethod'* *'cm'* |
Bram Moolenaar | a86187b | 2018-12-16 18:20:00 +0100 | [diff] [blame] | 2717 | 'cryptmethod' 'cm' string (default "blowfish2") |
Bram Moolenaar | 49771f4 | 2010-07-20 17:32:38 +0200 | [diff] [blame] | 2718 | global or local to buffer |global-local| |
Bram Moolenaar | 40e6a71 | 2010-05-16 22:32:54 +0200 | [diff] [blame] | 2719 | Method used for encryption when the buffer is written to a file: |
Bram Moolenaar | 0bbabe8 | 2010-05-17 20:32:55 +0200 | [diff] [blame] | 2720 | *pkzip* |
Bram Moolenaar | 49771f4 | 2010-07-20 17:32:38 +0200 | [diff] [blame] | 2721 | zip PkZip compatible method. A weak kind of encryption. |
Bram Moolenaar | f50a253 | 2010-05-21 15:36:08 +0200 | [diff] [blame] | 2722 | Backwards compatible with Vim 7.2 and older. |
Christian Brabandt | aae5834 | 2023-04-23 17:50:22 +0100 | [diff] [blame] | 2723 | Only use if you need to be backwards compatible. |
Bram Moolenaar | 0bbabe8 | 2010-05-17 20:32:55 +0200 | [diff] [blame] | 2724 | *blowfish* |
Bram Moolenaar | 8f4ac01 | 2014-08-10 13:38:34 +0200 | [diff] [blame] | 2725 | blowfish Blowfish method. Medium strong encryption but it has |
| 2726 | an implementation flaw. Requires Vim 7.3 or later, |
| 2727 | files can NOT be read by Vim 7.2 and older. This adds |
| 2728 | a "seed" to the file, every time you write the file |
| 2729 | the encrypted bytes will be different. |
Christian Brabandt | aae5834 | 2023-04-23 17:50:22 +0100 | [diff] [blame] | 2730 | Obsolete, please do no longer use. |
Bram Moolenaar | 8f4ac01 | 2014-08-10 13:38:34 +0200 | [diff] [blame] | 2731 | *blowfish2* |
| 2732 | blowfish2 Blowfish method. Medium strong encryption. Requires |
Bram Moolenaar | 5e9b2fa | 2016-02-01 22:37:05 +0100 | [diff] [blame] | 2733 | Vim 7.4.401 or later, files can NOT be read by Vim 7.3 |
Bram Moolenaar | 8f4ac01 | 2014-08-10 13:38:34 +0200 | [diff] [blame] | 2734 | and older. This adds a "seed" to the file, every time |
| 2735 | you write the file the encrypted bytes will be |
| 2736 | different. The whole undo file is encrypted, not just |
| 2737 | the pieces of text. |
Bram Moolenaar | a2baa73 | 2022-02-04 16:09:54 +0000 | [diff] [blame] | 2738 | *E1193* *E1194* *E1195* *E1196* *E1230* |
Christian Brabandt | f573c6e | 2021-06-20 14:02:16 +0200 | [diff] [blame] | 2739 | *E1197* *E1198* *E1199* *E1200* *E1201* |
| 2740 | xchacha20 XChaCha20 Cipher with Poly1305 Message Authentication |
clach04 | 2afdb3a | 2025-04-06 17:37:12 +0200 | [diff] [blame] | 2741 | Code. Medium strong to strong encryption. |
Christian Brabandt | f573c6e | 2021-06-20 14:02:16 +0200 | [diff] [blame] | 2742 | Encryption is provided by the libsodium library, it |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 2743 | requires Vim to be built with |+sodium|. |
Christian Brabandt | f573c6e | 2021-06-20 14:02:16 +0200 | [diff] [blame] | 2744 | It adds a seed and a message authentication code (MAC) |
| 2745 | to the file. This needs at least a Vim 8.2.3022 to |
| 2746 | read the encrypted file. |
| 2747 | Encryption of swap files is not supported, therefore |
| 2748 | no swap file will be used when xchacha20 encryption is |
| 2749 | enabled. |
| 2750 | Encryption of undo files is not yet supported, |
| 2751 | therefore no undo file will currently be written. |
Christian Brabandt | aae5834 | 2023-04-23 17:50:22 +0100 | [diff] [blame] | 2752 | CAREFUL: Files written with this method might have to |
| 2753 | be read back with the same version of Vim if the |
| 2754 | binary format changes later. |
| 2755 | Obsolete, please do no longer use. |
| 2756 | xchacha20v2 Same algorithm as with "xchacha20" that correctly |
| 2757 | stores the key derivation parameters together with the |
| 2758 | encrypted file. Should work better in case the |
| 2759 | parameters in the libsodium library ever change. |
| 2760 | STILL EXPERIMENTAL: Files written with this method |
Christian Brabandt | f573c6e | 2021-06-20 14:02:16 +0200 | [diff] [blame] | 2761 | might have to be read back with the same version of |
| 2762 | Vim if the binary format changes later. |
Bram Moolenaar | f50a253 | 2010-05-21 15:36:08 +0200 | [diff] [blame] | 2763 | |
Christian Brabandt | aae5834 | 2023-04-23 17:50:22 +0100 | [diff] [blame] | 2764 | You should use "blowfish2", also to re-encrypt older files. The |
| 2765 | "xchacha20" method provides better encryption, but it does not work |
| 2766 | with all versions of Vim. |
Bram Moolenaar | 4f3f668 | 2016-03-26 23:01:59 +0100 | [diff] [blame] | 2767 | |
Bram Moolenaar | 40e6a71 | 2010-05-16 22:32:54 +0200 | [diff] [blame] | 2768 | When reading an encrypted file 'cryptmethod' will be set automatically |
Bram Moolenaar | f50a253 | 2010-05-21 15:36:08 +0200 | [diff] [blame] | 2769 | to the detected method of the file being read. Thus if you write it |
| 2770 | without changing 'cryptmethod' the same method will be used. |
| 2771 | Changing 'cryptmethod' does not mark the file as modified, you have to |
Bram Moolenaar | 49771f4 | 2010-07-20 17:32:38 +0200 | [diff] [blame] | 2772 | explicitly write it, you don't get a warning unless there are other |
| 2773 | modifications. Also see |:X|. |
| 2774 | |
| 2775 | When setting the global value to an empty string, it will end up with |
Bram Moolenaar | a86187b | 2018-12-16 18:20:00 +0100 | [diff] [blame] | 2776 | the value "blowfish2". When setting the local value to an empty |
| 2777 | string the buffer will use the global value. |
Bram Moolenaar | 49771f4 | 2010-07-20 17:32:38 +0200 | [diff] [blame] | 2778 | |
Bram Moolenaar | f50a253 | 2010-05-21 15:36:08 +0200 | [diff] [blame] | 2779 | When a new encryption method is added in a later version of Vim, and |
| 2780 | the current version does not recognize it, you will get *E821* . |
Bram Moolenaar | 49771f4 | 2010-07-20 17:32:38 +0200 | [diff] [blame] | 2781 | You need to edit this file with the later version of Vim. |
Bram Moolenaar | 40e6a71 | 2010-05-16 22:32:54 +0200 | [diff] [blame] | 2782 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2783 | *'cscopepathcomp'* *'cspc'* |
| 2784 | 'cscopepathcomp' 'cspc' number (default 0) |
| 2785 | global |
| 2786 | {not available when compiled without the |+cscope| |
| 2787 | feature} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2788 | Determines how many components of the path to show in a list of tags. |
| 2789 | See |cscopepathcomp|. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 2790 | NOTE: This option is set to 0 when 'compatible' is set. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2791 | |
| 2792 | *'cscopeprg'* *'csprg'* |
| 2793 | 'cscopeprg' 'csprg' string (default "cscope") |
| 2794 | global |
| 2795 | {not available when compiled without the |+cscope| |
| 2796 | feature} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2797 | Specifies the command to execute cscope. See |cscopeprg|. |
| 2798 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 2799 | security reasons. |
| 2800 | |
| 2801 | *'cscopequickfix'* *'csqf'* |
| 2802 | 'cscopequickfix' 'csqf' string (default "") |
| 2803 | global |
| 2804 | {not available when compiled without the |+cscope| |
| 2805 | or |+quickfix| features} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2806 | Specifies whether to use quickfix window to show cscope results. |
| 2807 | See |cscopequickfix|. |
| 2808 | |
Bram Moolenaar | ec7944a | 2013-06-12 21:29:15 +0200 | [diff] [blame] | 2809 | *'cscoperelative'* *'csre'* *'nocscoperelative'* *'nocsre'* |
Bram Moolenaar | 2f982e4 | 2011-06-12 20:42:22 +0200 | [diff] [blame] | 2810 | 'cscoperelative' 'csre' boolean (default off) |
| 2811 | global |
| 2812 | {not available when compiled without the |+cscope| |
| 2813 | feature} |
Bram Moolenaar | 2f982e4 | 2011-06-12 20:42:22 +0200 | [diff] [blame] | 2814 | In the absence of a prefix (-P) for cscope. setting this option enables |
| 2815 | to use the basename of cscope.out path as the prefix. |
| 2816 | See |cscoperelative|. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 2817 | NOTE: This option is reset when 'compatible' is set. |
Bram Moolenaar | 2f982e4 | 2011-06-12 20:42:22 +0200 | [diff] [blame] | 2818 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2819 | *'cscopetag'* *'cst'* *'nocscopetag'* *'nocst'* |
| 2820 | 'cscopetag' 'cst' boolean (default off) |
| 2821 | global |
| 2822 | {not available when compiled without the |+cscope| |
| 2823 | feature} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2824 | Use cscope for tag commands. See |cscope-options|. |
| 2825 | NOTE: This option is reset when 'compatible' is set. |
| 2826 | |
| 2827 | *'cscopetagorder'* *'csto'* |
| 2828 | 'cscopetagorder' 'csto' number (default 0) |
| 2829 | global |
| 2830 | {not available when compiled without the |+cscope| |
| 2831 | feature} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2832 | Determines the order in which ":cstag" performs a search. See |
| 2833 | |cscopetagorder|. |
| 2834 | NOTE: This option is set to 0 when 'compatible' is set. |
| 2835 | |
| 2836 | *'cscopeverbose'* *'csverb'* |
| 2837 | *'nocscopeverbose'* *'nocsverb'* |
| 2838 | 'cscopeverbose' 'csverb' boolean (default off) |
| 2839 | global |
| 2840 | {not available when compiled without the |+cscope| |
| 2841 | feature} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2842 | Give messages when adding a cscope database. See |cscopeverbose|. |
| 2843 | NOTE: This option is reset when 'compatible' is set. |
| 2844 | |
Bram Moolenaar | 860cae1 | 2010-06-05 23:22:07 +0200 | [diff] [blame] | 2845 | *'cursorbind'* *'crb'* *'nocursorbind'* *'nocrb'* |
| 2846 | 'cursorbind' 'crb' boolean (default off) |
| 2847 | local to window |
Bram Moolenaar | 860cae1 | 2010-06-05 23:22:07 +0200 | [diff] [blame] | 2848 | When this option is set, as the cursor in the current |
| 2849 | window moves other cursorbound windows (windows that also have |
| 2850 | this option set) move their cursors to the corresponding line and |
| 2851 | column. This option is useful for viewing the |
| 2852 | differences between two versions of a file (see 'diff'); in diff mode, |
| 2853 | inserted and deleted lines (though not characters within a line) are |
Bram Moolenaar | 1a38442 | 2010-07-14 19:53:30 +0200 | [diff] [blame] | 2854 | taken into account. |
Bram Moolenaar | 860cae1 | 2010-06-05 23:22:07 +0200 | [diff] [blame] | 2855 | |
Bram Moolenaar | 600dddc | 2006-03-12 22:05:10 +0000 | [diff] [blame] | 2856 | *'cursorcolumn'* *'cuc'* *'nocursorcolumn'* *'nocuc'* |
| 2857 | 'cursorcolumn' 'cuc' boolean (default off) |
| 2858 | local to window |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 2859 | {not available when compiled without the |+syntax| |
Bram Moolenaar | 600dddc | 2006-03-12 22:05:10 +0000 | [diff] [blame] | 2860 | feature} |
| 2861 | Highlight the screen column of the cursor with CursorColumn |
| 2862 | |hl-CursorColumn|. Useful to align text. Will make screen redrawing |
| 2863 | slower. |
Bram Moolenaar | 4c3f536 | 2006-04-11 21:38:50 +0000 | [diff] [blame] | 2864 | If you only want the highlighting in the current window you can use |
| 2865 | these autocommands: > |
| 2866 | au WinLeave * set nocursorline nocursorcolumn |
| 2867 | au WinEnter * set cursorline cursorcolumn |
| 2868 | < |
Bram Moolenaar | 600dddc | 2006-03-12 22:05:10 +0000 | [diff] [blame] | 2869 | |
| 2870 | *'cursorline'* *'cul'* *'nocursorline'* *'nocul'* |
| 2871 | 'cursorline' 'cul' boolean (default off) |
| 2872 | local to window |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 2873 | {not available when compiled without the |+syntax| |
Bram Moolenaar | 600dddc | 2006-03-12 22:05:10 +0000 | [diff] [blame] | 2874 | feature} |
Bram Moolenaar | 410e98a | 2019-09-09 22:05:49 +0200 | [diff] [blame] | 2875 | Highlight the text line of the cursor with CursorLine |hl-CursorLine|. |
| 2876 | Useful to easily spot the cursor. Will make screen redrawing slower. |
Bram Moolenaar | e2f98b9 | 2006-03-29 21:18:24 +0000 | [diff] [blame] | 2877 | When Visual mode is active the highlighting isn't used to make it |
Bram Moolenaar | 779b74b | 2006-04-10 14:55:34 +0000 | [diff] [blame] | 2878 | easier to see the selected text. |
Bram Moolenaar | 600dddc | 2006-03-12 22:05:10 +0000 | [diff] [blame] | 2879 | |
Bram Moolenaar | 410e98a | 2019-09-09 22:05:49 +0200 | [diff] [blame] | 2880 | *'cursorlineopt'* *'culopt'* |
Bram Moolenaar | 017ba07 | 2019-09-14 21:01:23 +0200 | [diff] [blame] | 2881 | 'cursorlineopt' 'culopt' string (default: "number,line") |
Bram Moolenaar | 410e98a | 2019-09-09 22:05:49 +0200 | [diff] [blame] | 2882 | local to window |
Bram Moolenaar | 410e98a | 2019-09-09 22:05:49 +0200 | [diff] [blame] | 2883 | {not available when compiled without the |+syntax| |
| 2884 | feature} |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 2885 | Comma-separated list of settings for how 'cursorline' is displayed. |
Bram Moolenaar | 017ba07 | 2019-09-14 21:01:23 +0200 | [diff] [blame] | 2886 | Valid values: |
| 2887 | "line" Highlight the text line of the cursor with |
Bram Moolenaar | 410e98a | 2019-09-09 22:05:49 +0200 | [diff] [blame] | 2888 | CursorLine |hl-CursorLine|. |
Bram Moolenaar | 017ba07 | 2019-09-14 21:01:23 +0200 | [diff] [blame] | 2889 | "screenline" Highlight only the screen line of the cursor with |
| 2890 | CursorLine |hl-CursorLine|. |
| 2891 | "number" Highlight the line number of the cursor with |
Bram Moolenaar | 410e98a | 2019-09-09 22:05:49 +0200 | [diff] [blame] | 2892 | CursorLineNr |hl-CursorLineNr|. |
Bram Moolenaar | 017ba07 | 2019-09-14 21:01:23 +0200 | [diff] [blame] | 2893 | |
| 2894 | Special value: |
| 2895 | "both" Alias for the values "line,number". |
| 2896 | |
| 2897 | "line" and "screenline" cannot be used together. |
Bram Moolenaar | 410e98a | 2019-09-09 22:05:49 +0200 | [diff] [blame] | 2898 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2899 | *'debug'* |
| 2900 | 'debug' string (default "") |
| 2901 | global |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 2902 | These values can be used: |
| 2903 | msg Error messages that would otherwise be omitted will be given |
| 2904 | anyway. |
| 2905 | throw Error messages that would otherwise be omitted will be given |
| 2906 | anyway and also throw an exception and set |v:errmsg|. |
| 2907 | beep A message will be given when otherwise only a beep would be |
| 2908 | produced. |
Bram Moolenaar | 26a60b4 | 2005-02-22 08:49:11 +0000 | [diff] [blame] | 2909 | The values can be combined, separated by a comma. |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 2910 | "msg" and "throw" are useful for debugging 'foldexpr', 'formatexpr' or |
| 2911 | 'indentexpr'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2912 | |
| 2913 | *'define'* *'def'* |
| 2914 | 'define' 'def' string (default "^\s*#\s*define") |
| 2915 | global or local to buffer |global-local| |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 2916 | Pattern to be used to find a macro definition. It is a search |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2917 | pattern, just like for the "/" command. This option is used for the |
| 2918 | commands like "[i" and "[d" |include-search|. The 'isident' option is |
| 2919 | used to recognize the defined name after the match: |
| 2920 | {match with 'define'}{non-ID chars}{defined name}{non-ID char} |
| 2921 | See |option-backslash| about inserting backslashes to include a space |
| 2922 | or backslash. |
| 2923 | The default value is for C programs. For C++ this value would be |
| 2924 | useful, to include const type declarations: > |
| 2925 | ^\(#\s*define\|[a-z]*\s*const\s*[a-z]*\) |
Bram Moolenaar | 63b74a8 | 2019-03-24 15:09:13 +0100 | [diff] [blame] | 2926 | < You can also use "\ze" just before the name and continue the pattern |
| 2927 | to check what is following. E.g. for Javascript, if a function is |
| 2928 | defined with "func_name = function(args)": > |
| 2929 | ^\s*\ze\i\+\s*=\s*function( |
| 2930 | < If the function is defined with "func_name : function() {...": > |
| 2931 | ^\s*\ze\i\+\s*[:]\s*(*function\s*( |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2932 | < When using the ":set" command, you need to double the backslashes! |
Bram Moolenaar | 63b74a8 | 2019-03-24 15:09:13 +0100 | [diff] [blame] | 2933 | To avoid that use `:let` with a single quote string: > |
| 2934 | let &l:define = '^\s*\ze\k\+\s*=\s*function(' |
Bram Moolenaar | 911ead1 | 2019-04-21 00:03:35 +0200 | [diff] [blame] | 2935 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2936 | |
| 2937 | *'delcombine'* *'deco'* *'nodelcombine'* *'nodeco'* |
| 2938 | 'delcombine' 'deco' boolean (default off) |
| 2939 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2940 | If editing Unicode and this option is set, backspace and Normal mode |
| 2941 | "x" delete each combining character on its own. When it is off (the |
| 2942 | default) the character along with its combining characters are |
| 2943 | deleted. |
Bram Moolenaar | 4f4d51a | 2020-10-11 13:57:40 +0200 | [diff] [blame] | 2944 | Note: When 'delcombine' is set "xx" may work differently from "2x"! |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2945 | |
| 2946 | This is useful for Arabic, Hebrew and many other languages where one |
| 2947 | may have combining characters overtop of base characters, and want |
| 2948 | to remove only the combining ones. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 2949 | NOTE: This option is reset when 'compatible' is set. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2950 | |
| 2951 | *'dictionary'* *'dict'* |
| 2952 | 'dictionary' 'dict' string (default "") |
| 2953 | global or local to buffer |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2954 | List of file names, separated by commas, that are used to lookup words |
| 2955 | for keyword completion commands |i_CTRL-X_CTRL-K|. Each file should |
| 2956 | contain a list of words. This can be one word per line, or several |
| 2957 | words per line, separated by non-keyword characters (white space is |
| 2958 | preferred). Maximum line length is 510 bytes. |
Bram Moolenaar | 259f26a | 2018-05-15 22:25:40 +0200 | [diff] [blame] | 2959 | |
| 2960 | When this option is empty or an entry "spell" is present, and spell |
| 2961 | checking is enabled, words in the word lists for the currently active |
| 2962 | 'spelllang' are used. See |spell|. |
| 2963 | |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 2964 | To include a comma in a file name precede it with a backslash. Spaces |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2965 | after a comma are ignored, otherwise spaces are included in the file |
| 2966 | name. See |option-backslash| about using backslashes. |
Bram Moolenaar | d8b0273 | 2005-01-14 21:48:43 +0000 | [diff] [blame] | 2967 | This has nothing to do with the |Dictionary| variable type. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2968 | Where to find a list of words? |
| 2969 | - On FreeBSD, there is the file "/usr/share/dict/words". |
| 2970 | - In the Simtel archive, look in the "msdos/linguist" directory. |
| 2971 | - In "miscfiles" of the GNU collection. |
| 2972 | The use of |:set+=| and |:set-=| is preferred when adding or removing |
| 2973 | directories from the list. This avoids problems when a future version |
| 2974 | uses another default. |
| 2975 | Backticks cannot be used in this option for security reasons. |
| 2976 | |
| 2977 | *'diff'* *'nodiff'* |
| 2978 | 'diff' boolean (default off) |
| 2979 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2980 | {not available when compiled without the |+diff| |
| 2981 | feature} |
| 2982 | Join the current window in the group of windows that shows differences |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 2983 | between files. See |vimdiff|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2984 | |
| 2985 | *'dex'* *'diffexpr'* |
| 2986 | 'diffexpr' 'dex' string (default "") |
| 2987 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2988 | {not available when compiled without the |+diff| |
| 2989 | feature} |
Bram Moolenaar | e828b76 | 2018-09-10 17:51:58 +0200 | [diff] [blame] | 2990 | Expression which is evaluated to obtain a diff file (either ed-style |
| 2991 | or unified-style) from two versions of a file. See |diff-diffexpr|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2992 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 2993 | security reasons. |
| 2994 | |
| 2995 | *'dip'* *'diffopt'* |
Yee Cheng Chin | 9943d47 | 2025-03-26 19:41:02 +0100 | [diff] [blame] | 2996 | 'diffopt' 'dip' string (default |
| 2997 | "internal,filler,closeoff,inline:simple") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2998 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2999 | {not available when compiled without the |+diff| |
| 3000 | feature} |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 3001 | Option settings for diff mode. It can consist of the following items. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3002 | All are optional. Items must be separated by a comma. |
| 3003 | |
Jonathon | 7c7a4e6 | 2025-01-12 09:58:00 +0100 | [diff] [blame] | 3004 | algorithm:{text} Use the specified diff algorithm with the |
| 3005 | internal diff engine. Currently supported |
| 3006 | algorithms are: |
| 3007 | myers the default algorithm |
| 3008 | minimal spend extra time to generate the |
| 3009 | smallest possible diff |
| 3010 | patience patience diff algorithm |
| 3011 | histogram histogram diff algorithm |
| 3012 | |
| 3013 | closeoff When a window is closed where 'diff' is set |
| 3014 | and there is only one window remaining in the |
| 3015 | same tab page with 'diff' set, execute |
| 3016 | `:diffoff` in that window. This undoes a |
| 3017 | `:diffsplit` command. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3018 | |
| 3019 | context:{n} Use a context of {n} lines between a change |
| 3020 | and a fold that contains unchanged lines. |
| 3021 | When omitted a context of six lines is used. |
Bram Moolenaar | f6b4010 | 2019-02-22 15:24:03 +0100 | [diff] [blame] | 3022 | When using zero the context is actually one, |
| 3023 | since folds require a line in between, also |
dundargoc | 20f48d5 | 2023-10-02 21:49:23 +0200 | [diff] [blame] | 3024 | for a deleted line. Set it to a very large |
| 3025 | value (999999) to disable folding completely. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3026 | See |fold-diff|. |
| 3027 | |
Jonathon | 7c7a4e6 | 2025-01-12 09:58:00 +0100 | [diff] [blame] | 3028 | filler Show filler lines, to keep the text |
| 3029 | synchronized with a window that has inserted |
| 3030 | lines at the same position. Mostly useful |
| 3031 | when windows are side-by-side and 'scrollbind' |
| 3032 | is set. |
| 3033 | |
| 3034 | foldcolumn:{n} Set the 'foldcolumn' option to {n} when |
| 3035 | starting diff mode. Without this 2 is used. |
| 3036 | |
| 3037 | followwrap Follow the 'wrap' option and leave as it is. |
| 3038 | |
| 3039 | horizontal Start diff mode with horizontal splits (unless |
| 3040 | explicitly specified otherwise). |
| 3041 | |
| 3042 | hiddenoff Do not use diff mode for a buffer when it |
| 3043 | becomes hidden. |
| 3044 | |
Bram Moolenaar | 95bafa2 | 2018-10-02 13:26:25 +0200 | [diff] [blame] | 3045 | iblank Ignore changes where lines are all blank. Adds |
| 3046 | the "-B" flag to the "diff" command if |
| 3047 | 'diffexpr' is empty. Check the documentation |
| 3048 | of the "diff" command for what this does |
| 3049 | exactly. |
| 3050 | NOTE: the diff windows will get out of sync, |
| 3051 | because no differences between blank lines are |
| 3052 | taken into account. |
| 3053 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3054 | icase Ignore changes in case of text. "a" and "A" |
| 3055 | are considered the same. Adds the "-i" flag |
| 3056 | to the "diff" command if 'diffexpr' is empty. |
| 3057 | |
Jonathon | 7c7a4e6 | 2025-01-12 09:58:00 +0100 | [diff] [blame] | 3058 | indent-heuristic |
| 3059 | Use the indent heuristic for the internal |
| 3060 | diff library. |
| 3061 | |
Yee Cheng Chin | 9943d47 | 2025-03-26 19:41:02 +0100 | [diff] [blame] | 3062 | inline:{text} Highlight inline differences within a change. |
| 3063 | See |view-diffs|. Supported values are: |
| 3064 | |
| 3065 | none Do not perform inline highlighting. |
| 3066 | simple Highlight from first different |
| 3067 | character to the last one in each |
zeertzjq | 5a307c3 | 2025-03-28 19:01:32 +0100 | [diff] [blame] | 3068 | line. This is the default if no |
| 3069 | `inline:` value is set. |
Yee Cheng Chin | 9943d47 | 2025-03-26 19:41:02 +0100 | [diff] [blame] | 3070 | char Use internal diff to perform a |
| 3071 | character-wise diff and highlight the |
| 3072 | difference. |
| 3073 | word Use internal diff to perform a |
| 3074 | |word|-wise diff and highlight the |
Yee Cheng Chin | 9aa120f | 2025-04-04 19:16:21 +0200 | [diff] [blame] | 3075 | difference. Non-alphanumeric |
| 3076 | multi-byte characters such as emoji |
| 3077 | and CJK characters are considered |
| 3078 | individual words. |
Yee Cheng Chin | 9943d47 | 2025-03-26 19:41:02 +0100 | [diff] [blame] | 3079 | |
Jonathon | 7c7a4e6 | 2025-01-12 09:58:00 +0100 | [diff] [blame] | 3080 | internal Use the internal diff library. This is |
| 3081 | ignored when 'diffexpr' is set. *E960* |
| 3082 | When running out of memory when writing a |
| 3083 | buffer this item will be ignored for diffs |
| 3084 | involving that buffer. Set the 'verbose' |
| 3085 | option to see when this happens. |
| 3086 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3087 | iwhite Ignore changes in amount of white space. Adds |
| 3088 | the "-b" flag to the "diff" command if |
| 3089 | 'diffexpr' is empty. Check the documentation |
| 3090 | of the "diff" command for what this does |
| 3091 | exactly. It should ignore adding trailing |
| 3092 | white space, but not leading white space. |
| 3093 | |
Bram Moolenaar | 95bafa2 | 2018-10-02 13:26:25 +0200 | [diff] [blame] | 3094 | iwhiteall Ignore all white space changes. Adds |
| 3095 | the "-w" flag to the "diff" command if |
| 3096 | 'diffexpr' is empty. Check the documentation |
| 3097 | of the "diff" command for what this does |
| 3098 | exactly. |
| 3099 | |
| 3100 | iwhiteeol Ignore white space changes at end of line. |
| 3101 | Adds the "-Z" flag to the "diff" command if |
| 3102 | 'diffexpr' is empty. Check the documentation |
| 3103 | of the "diff" command for what this does |
| 3104 | exactly. |
| 3105 | |
Jonathon | 7c7a4e6 | 2025-01-12 09:58:00 +0100 | [diff] [blame] | 3106 | linematch:{n} Align and mark changes between the most |
| 3107 | similar lines between the buffers. When the |
| 3108 | total number of lines in the diff hunk exceeds |
| 3109 | {n}, the lines will not be aligned because for |
| 3110 | very large diff hunks there will be a |
| 3111 | noticeable lag. A reasonable setting is |
| 3112 | "linematch:60", as this will enable alignment |
| 3113 | for a 2 buffer diff hunk of 30 lines each, |
| 3114 | or a 3 buffer diff hunk of 20 lines each. |
Bram Moolenaar | 7d47b6e | 2006-03-15 22:59:18 +0000 | [diff] [blame] | 3115 | |
| 3116 | vertical Start diff mode with vertical splits (unless |
| 3117 | explicitly specified otherwise). |
| 3118 | |
Bram Moolenaar | e828b76 | 2018-09-10 17:51:58 +0200 | [diff] [blame] | 3119 | Examples: > |
| 3120 | :set diffopt=internal,filler,context:4 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3121 | :set diffopt= |
Bram Moolenaar | e828b76 | 2018-09-10 17:51:58 +0200 | [diff] [blame] | 3122 | :set diffopt=internal,filler,foldcolumn:3 |
| 3123 | :set diffopt-=internal " do NOT use the internal diff parser |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3124 | < |
| 3125 | *'digraph'* *'dg'* *'nodigraph'* *'nodg'* |
| 3126 | 'digraph' 'dg' boolean (default off) |
| 3127 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3128 | {not available when compiled without the |+digraphs| |
| 3129 | feature} |
| 3130 | Enable the entering of digraphs in Insert mode with {char1} <BS> |
| 3131 | {char2}. See |digraphs|. |
| 3132 | NOTE: This option is reset when 'compatible' is set. |
| 3133 | |
| 3134 | *'directory'* *'dir'* |
| 3135 | 'directory' 'dir' string (default for Amiga: ".,t:", |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 3136 | for Win32: ".,$TEMP,c:\tmp,c:\temp" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3137 | for Unix: ".,~/tmp,/var/tmp,/tmp") |
| 3138 | global |
| 3139 | List of directory names for the swap file, separated with commas. |
Bram Moolenaar | e7b1ea0 | 2020-08-07 19:54:59 +0200 | [diff] [blame] | 3140 | Recommended value: ".,~/vimswap//" - this will put the swap file next |
| 3141 | to the edited file if possible, and in your personal swap directory |
| 3142 | otherwise. Make sure "~/vimswap//" is only readable for you. |
| 3143 | |
| 3144 | Possible items: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3145 | - The swap file will be created in the first directory where this is |
| 3146 | possible. |
| 3147 | - Empty means that no swap file will be used (recovery is |
Bram Moolenaar | 00e192b | 2019-10-19 17:01:28 +0200 | [diff] [blame] | 3148 | impossible!) and no |E303| error will be given. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3149 | - A directory "." means to put the swap file in the same directory as |
| 3150 | the edited file. On Unix, a dot is prepended to the file name, so |
| 3151 | it doesn't show in a directory listing. On MS-Windows the "hidden" |
| 3152 | attribute is set and a dot prepended if possible. |
Bram Moolenaar | 8024f93 | 2020-01-14 19:29:13 +0100 | [diff] [blame] | 3153 | - A directory starting with "./" (or ".\" for MS-Windows) means to put |
| 3154 | the swap file relative to where the edited file is. The leading "." |
| 3155 | is replaced with the path name of the edited file. |
Bram Moolenaar | b782ba4 | 2018-08-07 21:39:28 +0200 | [diff] [blame] | 3156 | - For Unix and Win32, if a directory ends in two path separators "//", |
| 3157 | the swap file name will be built from the complete path to the file |
Bram Moolenaar | 207f009 | 2020-08-30 17:20:20 +0200 | [diff] [blame] | 3158 | with all path separators replaced by percent '%' signs (including |
| 3159 | the colon following the drive letter on Win32). This will ensure |
| 3160 | file name uniqueness in the preserve directory. |
Bram Moolenaar | b782ba4 | 2018-08-07 21:39:28 +0200 | [diff] [blame] | 3161 | On Win32, it is also possible to end with "\\". However, When a |
| 3162 | separating comma is following, you must use "//", since "\\" will |
| 3163 | include the comma in the file name. Therefore it is recommended to |
| 3164 | use '//', instead of '\\'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3165 | - Spaces after the comma are ignored, other spaces are considered part |
| 3166 | of the directory name. To have a space at the start of a directory |
| 3167 | name, precede it with a backslash. |
| 3168 | - To include a comma in a directory name precede it with a backslash. |
| 3169 | - A directory name may end in an ':' or '/'. |
| 3170 | - Environment variables are expanded |:set_env|. |
| 3171 | - Careful with '\' characters, type one before a space, type two to |
| 3172 | get one in the option (see |option-backslash|), for example: > |
| 3173 | :set dir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces |
| 3174 | < - For backwards compatibility with Vim version 3.0 a '>' at the start |
| 3175 | of the option is removed. |
| 3176 | Using "." first in the list is recommended. This means that editing |
| 3177 | the same file twice will result in a warning. Using "/tmp" on Unix is |
| 3178 | discouraged: When the system crashes you lose the swap file. |
| 3179 | "/var/tmp" is often not cleared when rebooting, thus is a better |
Bram Moolenaar | e7b1ea0 | 2020-08-07 19:54:59 +0200 | [diff] [blame] | 3180 | choice than "/tmp". But others on the computer may be able to see the |
| 3181 | files, and it can contain a lot of files, your swap files get lost in |
| 3182 | the crowd. That is why a "tmp" directory in your home directory is |
| 3183 | tried first. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3184 | The use of |:set+=| and |:set-=| is preferred when adding or removing |
| 3185 | directories from the list. This avoids problems when a future version |
| 3186 | uses another default. |
| 3187 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 3188 | security reasons. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3189 | |
| 3190 | *'display'* *'dy'* |
Bram Moolenaar | bc8801c | 2016-08-02 21:04:33 +0200 | [diff] [blame] | 3191 | 'display' 'dy' string (default "", set to "truncate" in |
| 3192 | |defaults.vim|) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3193 | global |
Bram Moolenaar | f269eab | 2022-10-03 18:04:35 +0100 | [diff] [blame] | 3194 | Change the way text is displayed. This is a comma-separated list of |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3195 | flags: |
| 3196 | lastline When included, as much as possible of the last line |
Bram Moolenaar | ad9c2a0 | 2016-07-27 23:26:04 +0200 | [diff] [blame] | 3197 | in a window will be displayed. "@@@" is put in the |
| 3198 | last columns of the last screen line to indicate the |
| 3199 | rest of the line is not displayed. |
| 3200 | truncate Like "lastline", but "@@@" is displayed in the first |
| 3201 | column of the last screen line. Overrules "lastline". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3202 | uhex Show unprintable characters hexadecimal as <xx> |
| 3203 | instead of using ^C and ~C. |
| 3204 | |
Bram Moolenaar | d079690 | 2016-09-16 20:02:31 +0200 | [diff] [blame] | 3205 | When neither "lastline" nor "truncate" is included, a last line that |
Bram Moolenaar | ad9c2a0 | 2016-07-27 23:26:04 +0200 | [diff] [blame] | 3206 | doesn't fit is replaced with "@" lines. |
| 3207 | |
Bram Moolenaar | 4ba5f1d | 2022-10-04 14:36:29 +0100 | [diff] [blame] | 3208 | The "@" character can be changed by setting the "lastline" item in |
| 3209 | 'fillchars'. The character is highlighted with |hl-NonText|. |
| 3210 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3211 | *'eadirection'* *'ead'* |
| 3212 | 'eadirection' 'ead' string (default "both") |
| 3213 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3214 | Tells when the 'equalalways' option applies: |
| 3215 | ver vertically, width of windows is not affected |
| 3216 | hor horizontally, height of windows is not affected |
| 3217 | both width and height of windows is affected |
| 3218 | |
| 3219 | *'ed'* *'edcompatible'* *'noed'* *'noedcompatible'* |
| 3220 | 'edcompatible' 'ed' boolean (default off) |
| 3221 | global |
| 3222 | Makes the 'g' and 'c' flags of the ":substitute" command to be |
| 3223 | toggled each time the flag is given. See |complex-change|. See |
| 3224 | also 'gdefault' option. |
Bram Moolenaar | b4d6c3e | 2017-05-27 16:45:17 +0200 | [diff] [blame] | 3225 | Switching this option on may break plugins! |
Bram Moolenaar | 4072ba5 | 2020-12-23 13:56:35 +0100 | [diff] [blame] | 3226 | This option is not used in |Vim9| script. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3227 | |
Bram Moolenaar | 03413f4 | 2016-04-12 21:07:15 +0200 | [diff] [blame] | 3228 | *'emoji'* *'emo'* *'noemoji'* *'noemo'* |
Bram Moolenaar | 3848e00 | 2016-03-19 18:42:29 +0100 | [diff] [blame] | 3229 | 'emoji' 'emo' boolean (default: on) |
| 3230 | global |
Bram Moolenaar | 3848e00 | 2016-03-19 18:42:29 +0100 | [diff] [blame] | 3231 | When on all Unicode emoji characters are considered to be full width. |
Bram Moolenaar | 1d59aa1 | 2020-09-19 18:50:13 +0200 | [diff] [blame] | 3232 | This excludes "text emoji" characters, which are normally displayed as |
| 3233 | single width. Unfortunately there is no good specification for this |
| 3234 | and it has been determined on trial-and-error basis. Use the |
| 3235 | |setcellwidths()| function to change the behavior. |
Bram Moolenaar | 3848e00 | 2016-03-19 18:42:29 +0100 | [diff] [blame] | 3236 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3237 | *'encoding'* *'enc'* *E543* |
K.Takata | f883d90 | 2021-05-30 18:04:19 +0200 | [diff] [blame] | 3238 | 'encoding' 'enc' string (default for MS-Windows: "utf-8", |
| 3239 | otherwise: value from $LANG or "latin1") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3240 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3241 | Sets the character encoding used inside Vim. It applies to text in |
| 3242 | the buffers, registers, Strings in expressions, text stored in the |
| 3243 | viminfo file, etc. It sets the kind of characters which Vim can work |
| 3244 | with. See |encoding-names| for the possible values. |
| 3245 | |
| 3246 | NOTE: Changing this option will not change the encoding of the |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 3247 | existing text in Vim. It may cause non-ASCII text to become invalid. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3248 | It should normally be kept at its default value, or set when Vim |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 3249 | starts up. See |multibyte|. To reload the menus see |:menutrans|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3250 | |
Bram Moolenaar | 865242e | 2010-07-14 21:12:05 +0200 | [diff] [blame] | 3251 | This option cannot be set from a |modeline|. It would most likely |
| 3252 | corrupt the text. |
| 3253 | |
Bram Moolenaar | 3df0173 | 2017-02-17 22:47:16 +0100 | [diff] [blame] | 3254 | NOTE: For GTK+ 2 or later, it is highly recommended to set 'encoding' |
| 3255 | to "utf-8". Although care has been taken to allow different values of |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3256 | 'encoding', "utf-8" is the natural choice for the environment and |
| 3257 | avoids unnecessary conversion overhead. "utf-8" has not been made |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 3258 | the default to prevent different behavior of the GUI and terminal |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3259 | versions, and to avoid changing the encoding of newly created files |
| 3260 | without your knowledge (in case 'fileencodings' is empty). |
| 3261 | |
| 3262 | The character encoding of files can be different from 'encoding'. |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 3263 | This is specified with 'fileencoding'. The conversion is done with |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3264 | iconv() or as specified with 'charconvert'. |
| 3265 | |
Bram Moolenaar | 207f009 | 2020-08-30 17:20:20 +0200 | [diff] [blame] | 3266 | If you need to know whether 'encoding' is a multibyte encoding, you |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3267 | can use: > |
| 3268 | if has("multi_byte_encoding") |
| 3269 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3270 | Normally 'encoding' will be equal to your current locale. This will |
| 3271 | be the default if Vim recognizes your environment settings. If |
| 3272 | 'encoding' is not set to the current locale, 'termencoding' must be |
| 3273 | set to convert typed and displayed text. See |encoding-table|. |
| 3274 | |
| 3275 | When you set this option, it fires the |EncodingChanged| autocommand |
| 3276 | event so that you can set up fonts if necessary. |
| 3277 | |
| 3278 | When the option is set, the value is converted to lowercase. Thus |
| 3279 | you can set it with uppercase values too. Underscores are translated |
| 3280 | to '-' signs. |
| 3281 | When the encoding is recognized, it is changed to the standard name. |
| 3282 | For example "Latin-1" becomes "latin1", "ISO_88592" becomes |
| 3283 | "iso-8859-2" and "utf8" becomes "utf-8". |
| 3284 | |
| 3285 | Note: "latin1" is also used when the encoding could not be detected. |
| 3286 | This only works when editing files in the same encoding! When the |
| 3287 | actual character set is not latin1, make sure 'fileencoding' and |
| 3288 | 'fileencodings' are empty. When conversion is needed, switch to using |
| 3289 | utf-8. |
| 3290 | |
| 3291 | When "unicode", "ucs-2" or "ucs-4" is used, Vim internally uses utf-8. |
| 3292 | You don't notice this while editing, but it does matter for the |
| 3293 | |viminfo-file|. And Vim expects the terminal to use utf-8 too. Thus |
| 3294 | setting 'encoding' to one of these values instead of utf-8 only has |
| 3295 | effect for encoding used for files when 'fileencoding' is empty. |
| 3296 | |
Bram Moolenaar | 661b182 | 2005-07-28 22:36:45 +0000 | [diff] [blame] | 3297 | When 'encoding' is set to a Unicode encoding, and 'fileencodings' was |
| 3298 | not set yet, the default for 'fileencodings' is changed. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3299 | |
Bram Moolenaar | 6ebe4f9 | 2022-10-28 20:47:54 +0100 | [diff] [blame] | 3300 | *'endoffile'* *'eof'* *'noendoffile'* *'noeof'* |
Bram Moolenaar | 0aad88f | 2022-11-12 11:54:26 +0000 | [diff] [blame] | 3301 | 'endoffile' 'eof' boolean (default off) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3302 | local to buffer |
Bram Moolenaar | 6ebe4f9 | 2022-10-28 20:47:54 +0100 | [diff] [blame] | 3303 | Indicates that a CTRL-Z character was found at the end of the file |
| 3304 | when reading it. Normally only happens when 'fileformat' is "dos". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3305 | When writing a file and this option is off and the 'binary' option |
Bram Moolenaar | 6ebe4f9 | 2022-10-28 20:47:54 +0100 | [diff] [blame] | 3306 | is on, or 'fixeol' option is off, no CTRL-Z will be written at the |
Bram Moolenaar | fb0cf23 | 2022-10-22 11:25:19 +0100 | [diff] [blame] | 3307 | end of the file. |
K.Takata | 3af9821 | 2022-11-01 20:36:19 +0000 | [diff] [blame] | 3308 | See |eol-and-eof| for example settings. |
Bram Moolenaar | fb0cf23 | 2022-10-22 11:25:19 +0100 | [diff] [blame] | 3309 | |
| 3310 | *'endofline'* *'eol'* *'noendofline'* *'noeol'* |
| 3311 | 'endofline' 'eol' boolean (default on) |
| 3312 | local to buffer |
| 3313 | When writing a file and this option is off and the 'binary' option |
Bram Moolenaar | 34d72d4 | 2015-07-17 14:18:08 +0200 | [diff] [blame] | 3314 | is on, or 'fixeol' option is off, no <EOL> will be written for the |
| 3315 | last line in the file. This option is automatically set or reset when |
| 3316 | starting to edit a new file, depending on whether file has an <EOL> |
| 3317 | for the last line in the file. Normally you don't have to set or |
| 3318 | reset this option. |
| 3319 | When 'binary' is off and 'fixeol' is on the value is not used when |
| 3320 | writing the file. When 'binary' is on or 'fixeol' is off it is used |
| 3321 | to remember the presence of a <EOL> for the last line in the file, so |
| 3322 | that when you write the file the situation from the original file can |
| 3323 | be kept. But you can change it if you want to. |
K.Takata | 3af9821 | 2022-11-01 20:36:19 +0000 | [diff] [blame] | 3324 | See |eol-and-eof| for example settings. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3325 | |
| 3326 | *'equalalways'* *'ea'* *'noequalalways'* *'noea'* |
| 3327 | 'equalalways' 'ea' boolean (default on) |
| 3328 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3329 | When on, all the windows are automatically made the same size after |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 3330 | splitting or closing a window. This also happens the moment the |
| 3331 | option is switched on. When off, splitting a window will reduce the |
| 3332 | size of the current window and leave the other windows the same. When |
| 3333 | closing a window the extra lines are given to the window next to it |
| 3334 | (depending on 'splitbelow' and 'splitright'). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3335 | When mixing vertically and horizontally split windows, a minimal size |
| 3336 | is computed and some windows may be larger if there is room. The |
| 3337 | 'eadirection' option tells in which direction the size is affected. |
Bram Moolenaar | 67f7131 | 2007-08-12 14:55:56 +0000 | [diff] [blame] | 3338 | Changing the height and width of a window can be avoided by setting |
| 3339 | 'winfixheight' and 'winfixwidth', respectively. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3340 | If a window size is specified when creating a new window sizes are |
| 3341 | currently not equalized (it's complicated, but may be implemented in |
| 3342 | the future). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3343 | |
| 3344 | *'equalprg'* *'ep'* |
| 3345 | 'equalprg' 'ep' string (default "") |
| 3346 | global or local to buffer |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3347 | External program to use for "=" command. When this option is empty |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3348 | the internal formatting functions are used; either 'lisp', 'cindent' |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3349 | or 'indentexpr'. When Vim was compiled without internal formatting, |
| 3350 | the "indent" program is used. |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 3351 | Environment variables are expanded |:set_env|. See |option-backslash| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3352 | about including spaces and backslashes. |
| 3353 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 3354 | security reasons. |
| 3355 | |
| 3356 | *'errorbells'* *'eb'* *'noerrorbells'* *'noeb'* |
| 3357 | 'errorbells' 'eb' boolean (default off) |
| 3358 | global |
| 3359 | Ring the bell (beep or screen flash) for error messages. This only |
| 3360 | makes a difference for error messages, the bell will be used always |
| 3361 | for a lot of errors without a message (e.g., hitting <Esc> in Normal |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 3362 | mode). See 'visualbell' on how to make the bell behave like a beep, |
Bram Moolenaar | 165bc69 | 2015-07-21 17:53:25 +0200 | [diff] [blame] | 3363 | screen flash or do nothing. See 'belloff' to finetune when to ring the |
| 3364 | bell. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3365 | |
| 3366 | *'errorfile'* *'ef'* |
| 3367 | 'errorfile' 'ef' string (Amiga default: "AztecC.Err", |
| 3368 | others: "errors.err") |
| 3369 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3370 | {not available when compiled without the |+quickfix| |
| 3371 | feature} |
| 3372 | Name of the errorfile for the QuickFix mode (see |:cf|). |
| 3373 | When the "-q" command-line argument is used, 'errorfile' is set to the |
| 3374 | following argument. See |-q|. |
| 3375 | NOT used for the ":make" command. See 'makeef' for that. |
| 3376 | Environment variables are expanded |:set_env|. |
| 3377 | See |option-backslash| about including spaces and backslashes. |
| 3378 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 3379 | security reasons. |
| 3380 | |
| 3381 | *'errorformat'* *'efm'* |
| 3382 | 'errorformat' 'efm' string (default is very long) |
| 3383 | global or local to buffer |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3384 | {not available when compiled without the |+quickfix| |
| 3385 | feature} |
| 3386 | Scanf-like description of the format for the lines in the error file |
| 3387 | (see |errorformat|). |
| 3388 | |
| 3389 | *'esckeys'* *'ek'* *'noesckeys'* *'noek'* |
| 3390 | 'esckeys' 'ek' boolean (Vim default: on, Vi default: off) |
| 3391 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3392 | Function keys that start with an <Esc> are recognized in Insert |
| 3393 | mode. When this option is off, the cursor and function keys cannot be |
| 3394 | used in Insert mode if they start with an <Esc>. The advantage of |
| 3395 | this is that the single <Esc> is recognized immediately, instead of |
| 3396 | after one second. Instead of resetting this option, you might want to |
| 3397 | try changing the values for 'timeoutlen' and 'ttimeoutlen'. Note that |
| 3398 | when 'esckeys' is off, you can still map anything, but the cursor keys |
| 3399 | won't work by default. |
| 3400 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 3401 | set and to the Vim default value when 'compatible' is reset. |
Christian Brabandt | 5f5131d | 2023-10-25 21:44:26 +0200 | [diff] [blame] | 3402 | NOTE: when this option is off then the |modifyOtherKeys| and |
| 3403 | |xterm-bracketed-paste| functionality is disabled while in Insert mode |
| 3404 | to avoid ending Insert mode with any key that has a modifier. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3405 | |
| 3406 | *'eventignore'* *'ei'* |
| 3407 | 'eventignore' 'ei' string (default "") |
| 3408 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3409 | A list of autocommand event names, which are to be ignored. |
Bram Moolenaar | f193fff | 2006-04-27 00:02:13 +0000 | [diff] [blame] | 3410 | When set to "all" or when "all" is one of the items, all autocommand |
| 3411 | events are ignored, autocommands will not be executed. |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 3412 | Otherwise this is a comma-separated list of event names. Example: > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3413 | :set ei=WinEnter,WinLeave |
| 3414 | < |
Luuk van Baal | 8cc6d8b | 2025-05-31 12:10:31 +0200 | [diff] [blame] | 3415 | To ignore all but some events, a "-" prefix can be used: > |
| 3416 | :set ei=all,-WinLeave |
| 3417 | < |
Luuk van Baal | b7147f8 | 2025-02-08 18:52:39 +0100 | [diff] [blame] | 3418 | *'eventignorewin'* *'eiw'* |
| 3419 | 'eventignorewin' 'eiw' string (default "") |
| 3420 | window-local |
| 3421 | Similar to 'eventignore' but applies to a particular window and its |
| 3422 | buffers, for which window and buffer related autocommands can be |
| 3423 | ignored indefinitely without affecting the global 'eventignore'. |
| 3424 | |
glepnir | 631a50c | 2025-06-15 16:05:10 +0200 | [diff] [blame] | 3425 | Note: The following events are considered to happen outside of a |
| 3426 | window context and thus cannot be ignored by 'eventignorewin': |
| 3427 | |
| 3428 | |CmdlineChanged|, |
| 3429 | |CmdlineEnter|, |
| 3430 | |CmdlineLeave|, |
| 3431 | |CmdlineLeavePre|, |
| 3432 | |CmdUndefined|, |
| 3433 | |CmdwinEnter|, |
| 3434 | |CmdwinLeave|, |
| 3435 | |ColorScheme|, |
| 3436 | |ColorSchemePre|, |
| 3437 | |CompleteChanged|, |
| 3438 | |CompleteDone|, |
| 3439 | |CompleteDonePre|, |
| 3440 | |DiffUpdated|, |
| 3441 | |DirChanged|, |
| 3442 | |DirChangedPre|, |
| 3443 | |EncodingChanged|, |
| 3444 | |ExitPre|, |
| 3445 | |FocusGained|, |
| 3446 | |FocusLost|, |
| 3447 | |FuncUndefined|, |
| 3448 | |GUIEnter|, |
| 3449 | |GUIFailed|, |
| 3450 | |KeyInputPre|, |
| 3451 | |MenuPopup|, |
| 3452 | |ModeChanged|, |
| 3453 | |OptionSet|, |
| 3454 | |QuickFixCmdPost|, |
| 3455 | |QuickFixCmdPre|, |
| 3456 | |QuitPre|, |
| 3457 | |RemoteReply|, |
| 3458 | |SafeState|, |
| 3459 | |SafeStateAgain|, |
| 3460 | |SessionLoadPost|, |
| 3461 | |SessionWritePost|, |
| 3462 | |ShellCmdPost|, |
| 3463 | |SigUSR1|, |
| 3464 | |SourceCmd|, |
| 3465 | |SourcePost|, |
| 3466 | |SourcePre|, |
| 3467 | |SpellFileMissing|, |
| 3468 | |StdinReadPost|, |
| 3469 | |StdinReadPre|, |
| 3470 | |SwapExists|, |
| 3471 | |Syntax|, |
| 3472 | |TabClosed|, |
| 3473 | |TabClosedPre|, |
| 3474 | |TabEnter|, |
| 3475 | |TabLeave|, |
| 3476 | |TabNew|, |
| 3477 | |TermChanged|, |
| 3478 | |TerminalOpen|, |
| 3479 | |TerminalWinOpen|, |
| 3480 | |TermResponse|, |
| 3481 | |TermResponseAll|, |
| 3482 | |User|, |
| 3483 | |VimEnter|, |
| 3484 | |VimLeave|, |
| 3485 | |VimLeavePre|, |
| 3486 | |VimResized|, |
| 3487 | |VimResume|, |
| 3488 | |VimSuspend|, |
| 3489 | |WinNew|, |
| 3490 | |WinNewPre| |
| 3491 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3492 | *'expandtab'* *'et'* *'noexpandtab'* *'noet'* |
| 3493 | 'expandtab' 'et' boolean (default off) |
| 3494 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3495 | In Insert mode: Use the appropriate number of spaces to insert a |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 3496 | <Tab>. Spaces are used in indents with the '>' and '<' commands and |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3497 | when 'autoindent' is on. To insert a real tab when 'expandtab' is |
| 3498 | on, use CTRL-V<Tab>. See also |:retab| and |ins-expandtab|. |
Bram Moolenaar | ca63501 | 2015-09-25 20:34:21 +0200 | [diff] [blame] | 3499 | This option is reset when the 'paste' option is set and restored when |
| 3500 | the 'paste' option is reset. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3501 | NOTE: This option is reset when 'compatible' is set. |
| 3502 | |
| 3503 | *'exrc'* *'ex'* *'noexrc'* *'noex'* |
| 3504 | 'exrc' 'ex' boolean (default off) |
| 3505 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3506 | Enables the reading of .vimrc, .exrc and .gvimrc in the current |
Bram Moolenaar | 36f44c2 | 2016-08-28 18:17:20 +0200 | [diff] [blame] | 3507 | directory. |
| 3508 | |
| 3509 | Setting this option is a potential security leak. E.g., consider |
| 3510 | unpacking a package or fetching files from github, a .vimrc in there |
| 3511 | might be a trojan horse. BETTER NOT SET THIS OPTION! |
| 3512 | Instead, define an autocommand in your .vimrc to set options for a |
| 3513 | matching directory. |
| 3514 | |
| 3515 | If you do switch this option on you should also consider setting the |
| 3516 | 'secure' option (see |initialization|). |
| 3517 | Also see |.vimrc| and |gui-init|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3518 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 3519 | security reasons. |
| 3520 | |
| 3521 | *'fileencoding'* *'fenc'* *E213* |
| 3522 | 'fileencoding' 'fenc' string (default: "") |
| 3523 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3524 | Sets the character encoding for the file of this buffer. |
Bram Moolenaar | 865242e | 2010-07-14 21:12:05 +0200 | [diff] [blame] | 3525 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3526 | When 'fileencoding' is different from 'encoding', conversion will be |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3527 | done when writing the file. For reading see below. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3528 | When 'fileencoding' is empty, the same value as 'encoding' will be |
| 3529 | used (no conversion when reading or writing a file). |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 3530 | No error will be given when the value is set, only when it is used, |
| 3531 | only when writing a file. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3532 | Conversion will also be done when 'encoding' and 'fileencoding' are |
| 3533 | both a Unicode encoding and 'fileencoding' is not utf-8. That's |
| 3534 | because internally Unicode is always stored as utf-8. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3535 | WARNING: Conversion can cause loss of information! When |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3536 | 'encoding' is "utf-8" or another Unicode encoding, conversion |
| 3537 | is most likely done in a way that the reverse conversion |
| 3538 | results in the same text. When 'encoding' is not "utf-8" some |
| 3539 | characters may be lost! |
Bram Moolenaar | 865242e | 2010-07-14 21:12:05 +0200 | [diff] [blame] | 3540 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3541 | See 'encoding' for the possible values. Additionally, values may be |
| 3542 | specified that can be handled by the converter, see |
| 3543 | |mbyte-conversion|. |
Bram Moolenaar | 865242e | 2010-07-14 21:12:05 +0200 | [diff] [blame] | 3544 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3545 | When reading a file 'fileencoding' will be set from 'fileencodings'. |
| 3546 | To read a file in a certain encoding it won't work by setting |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 3547 | 'fileencoding', use the |++enc| argument. One exception: when |
| 3548 | 'fileencodings' is empty the value of 'fileencoding' is used. |
Bram Moolenaar | a23ccb8 | 2006-02-27 00:08:02 +0000 | [diff] [blame] | 3549 | For a new file the global value of 'fileencoding' is used. |
Bram Moolenaar | 865242e | 2010-07-14 21:12:05 +0200 | [diff] [blame] | 3550 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3551 | Prepending "8bit-" and "2byte-" has no meaning here, they are ignored. |
| 3552 | When the option is set, the value is converted to lowercase. Thus |
| 3553 | you can set it with uppercase values too. '_' characters are |
| 3554 | replaced with '-'. If a name is recognized from the list for |
| 3555 | 'encoding', it is replaced by the standard name. For example |
| 3556 | "ISO8859-2" becomes "iso-8859-2". |
Bram Moolenaar | 865242e | 2010-07-14 21:12:05 +0200 | [diff] [blame] | 3557 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3558 | When this option is set, after starting to edit a file, the 'modified' |
| 3559 | option is set, because the file would be different when written. |
Bram Moolenaar | 865242e | 2010-07-14 21:12:05 +0200 | [diff] [blame] | 3560 | |
| 3561 | Keep in mind that changing 'fenc' from a modeline happens |
| 3562 | AFTER the text has been read, thus it applies to when the file will be |
| 3563 | written. If you do set 'fenc' in a modeline, you might want to set |
| 3564 | 'nomodified' to avoid not being able to ":q". |
| 3565 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3566 | This option can not be changed when 'modifiable' is off. |
| 3567 | |
| 3568 | *'fe'* |
| 3569 | NOTE: Before version 6.0 this option specified the encoding for the |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 3570 | whole of Vim, this was a mistake. Now use 'encoding' instead. The |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3571 | old short name was 'fe', which is no longer used. |
| 3572 | |
| 3573 | *'fileencodings'* *'fencs'* |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 3574 | 'fileencodings' 'fencs' string (default: "ucs-bom", |
| 3575 | "ucs-bom,utf-8,default,latin1" when |
| 3576 | 'encoding' is set to a Unicode value) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3577 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3578 | This is a list of character encodings considered when starting to edit |
| 3579 | an existing file. When a file is read, Vim tries to use the first |
| 3580 | mentioned character encoding. If an error is detected, the next one |
| 3581 | in the list is tried. When an encoding is found that works, |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 3582 | 'fileencoding' is set to it. If all fail, 'fileencoding' is set to |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3583 | an empty string, which means the value of 'encoding' is used. |
| 3584 | WARNING: Conversion can cause loss of information! When |
| 3585 | 'encoding' is "utf-8" (or one of the other Unicode variants) |
| 3586 | conversion is most likely done in a way that the reverse |
| 3587 | conversion results in the same text. When 'encoding' is not |
Bram Moolenaar | c6d8db7 | 2005-12-13 20:04:55 +0000 | [diff] [blame] | 3588 | "utf-8" some non-ASCII characters may be lost! You can use |
| 3589 | the |++bad| argument to specify what is done with characters |
| 3590 | that can't be converted. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3591 | For an empty file or a file with only ASCII characters most encodings |
| 3592 | will work and the first entry of 'fileencodings' will be used (except |
| 3593 | "ucs-bom", which requires the BOM to be present). If you prefer |
| 3594 | another encoding use an BufReadPost autocommand event to test if your |
| 3595 | preferred encoding is to be used. Example: > |
| 3596 | au BufReadPost * if search('\S', 'w') == 0 | |
| 3597 | \ set fenc=iso-2022-jp | endif |
| 3598 | < This sets 'fileencoding' to "iso-2022-jp" if the file does not contain |
| 3599 | non-blank characters. |
Bram Moolenaar | c6d8db7 | 2005-12-13 20:04:55 +0000 | [diff] [blame] | 3600 | When the |++enc| argument is used then the value of 'fileencodings' is |
| 3601 | not used. |
Bram Moolenaar | a23ccb8 | 2006-02-27 00:08:02 +0000 | [diff] [blame] | 3602 | Note that 'fileencodings' is not used for a new file, the global value |
| 3603 | of 'fileencoding' is used instead. You can set it with: > |
| 3604 | :setglobal fenc=iso-8859-2 |
| 3605 | < This means that a non-existing file may get a different encoding than |
| 3606 | an empty file. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3607 | The special value "ucs-bom" can be used to check for a Unicode BOM |
| 3608 | (Byte Order Mark) at the start of the file. It must not be preceded |
| 3609 | by "utf-8" or another Unicode encoding for this to work properly. |
| 3610 | An entry for an 8-bit encoding (e.g., "latin1") should be the last, |
| 3611 | because Vim cannot detect an error, thus the encoding is always |
| 3612 | accepted. |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 3613 | The special value "default" can be used for the encoding from the |
K.Takata | ef8706f | 2021-05-31 18:40:49 +0200 | [diff] [blame] | 3614 | environment. On MS-Windows this is the system encoding. Otherwise |
| 3615 | this is the default value for 'encoding'. It is useful when |
| 3616 | 'encoding' is set to "utf-8" and your environment uses a non-latin1 |
| 3617 | encoding, such as Russian. |
Bram Moolenaar | ca003e1 | 2006-03-17 23:19:38 +0000 | [diff] [blame] | 3618 | When 'encoding' is "utf-8" and a file contains an illegal byte |
| 3619 | sequence it won't be recognized as UTF-8. You can use the |8g8| |
| 3620 | command to find the illegal byte sequence. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3621 | WRONG VALUES: WHAT'S WRONG: |
| 3622 | latin1,utf-8 "latin1" will always be used |
| 3623 | utf-8,ucs-bom,latin1 BOM won't be recognized in an utf-8 |
| 3624 | file |
| 3625 | cp1250,latin1 "cp1250" will always be used |
| 3626 | If 'fileencodings' is empty, 'fileencoding' is not modified. |
| 3627 | See 'fileencoding' for the possible values. |
| 3628 | Setting this option does not have an effect until the next time a file |
| 3629 | is read. |
| 3630 | |
| 3631 | *'fileformat'* *'ff'* |
Bram Moolenaar | 0059074 | 2019-02-15 21:06:09 +0100 | [diff] [blame] | 3632 | 'fileformat' 'ff' string (MS-Windows default: "dos", |
Yee Cheng Chin | 92b59c6 | 2024-10-22 21:16:43 +0200 | [diff] [blame] | 3633 | Unix default: "unix") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3634 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3635 | This gives the <EOL> of the current buffer, which is used for |
| 3636 | reading/writing the buffer from/to a file: |
Bram Moolenaar | 4072ba5 | 2020-12-23 13:56:35 +0100 | [diff] [blame] | 3637 | dos <CR><NL> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3638 | unix <NL> |
| 3639 | mac <CR> |
| 3640 | When "dos" is used, CTRL-Z at the end of a file is ignored. |
| 3641 | See |file-formats| and |file-read|. |
| 3642 | For the character encoding of the file see 'fileencoding'. |
| 3643 | When 'binary' is set, the value of 'fileformat' is ignored, file I/O |
Bram Moolenaar | bf88493 | 2013-04-05 22:26:15 +0200 | [diff] [blame] | 3644 | works like it was set to "unix". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3645 | This option is set automatically when starting to edit a file and |
| 3646 | 'fileformats' is not empty and 'binary' is off. |
| 3647 | When this option is set, after starting to edit a file, the 'modified' |
| 3648 | option is set, because the file would be different when written. |
| 3649 | This option can not be changed when 'modifiable' is off. |
| 3650 | For backwards compatibility: When this option is set to "dos", |
| 3651 | 'textmode' is set, otherwise 'textmode' is reset. |
| 3652 | |
| 3653 | *'fileformats'* *'ffs'* |
| 3654 | 'fileformats' 'ffs' string (default: |
Bram Moolenaar | 0059074 | 2019-02-15 21:06:09 +0100 | [diff] [blame] | 3655 | Vim+Vi MS-Windows: "dos,unix", |
Yee Cheng Chin | 92b59c6 | 2024-10-22 21:16:43 +0200 | [diff] [blame] | 3656 | Vim Unix: "unix,dos", |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3657 | Vi Cygwin: "unix,dos", |
| 3658 | Vi others: "") |
| 3659 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3660 | This gives the end-of-line (<EOL>) formats that will be tried when |
| 3661 | starting to edit a new buffer and when reading a file into an existing |
| 3662 | buffer: |
| 3663 | - When empty, the format defined with 'fileformat' will be used |
| 3664 | always. It is not set automatically. |
| 3665 | - When set to one name, that format will be used whenever a new buffer |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 3666 | is opened. 'fileformat' is set accordingly for that buffer. The |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3667 | 'fileformats' name will be used when a file is read into an existing |
| 3668 | buffer, no matter what 'fileformat' for that buffer is set to. |
| 3669 | - When more than one name is present, separated by commas, automatic |
| 3670 | <EOL> detection will be done when reading a file. When starting to |
| 3671 | edit a file, a check is done for the <EOL>: |
| 3672 | 1. If all lines end in <CR><NL>, and 'fileformats' includes "dos", |
| 3673 | 'fileformat' is set to "dos". |
| 3674 | 2. If a <NL> is found and 'fileformats' includes "unix", 'fileformat' |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 3675 | is set to "unix". Note that when a <NL> is found without a |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3676 | preceding <CR>, "unix" is preferred over "dos". |
Bram Moolenaar | 2b8388b | 2015-02-28 13:11:45 +0100 | [diff] [blame] | 3677 | 3. If 'fileformat' has not yet been set, and if a <CR> is found, and |
| 3678 | if 'fileformats' includes "mac", 'fileformat' is set to "mac". |
Bram Moolenaar | 0065906 | 2010-09-21 22:34:02 +0200 | [diff] [blame] | 3679 | This means that "mac" is only chosen when: |
| 3680 | "unix" is not present or no <NL> is found in the file, and |
| 3681 | "dos" is not present or no <CR><NL> is found in the file. |
| 3682 | Except: if "unix" was chosen, but there is a <CR> before |
| 3683 | the first <NL>, and there appear to be more <CR>s than <NL>s in |
Bram Moolenaar | 166af9b | 2010-11-16 20:34:40 +0100 | [diff] [blame] | 3684 | the first few lines, "mac" is used. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3685 | 4. If 'fileformat' is still not set, the first name from |
| 3686 | 'fileformats' is used. |
| 3687 | When reading a file into an existing buffer, the same is done, but |
| 3688 | this happens like 'fileformat' has been set appropriately for that |
| 3689 | file only, the option is not changed. |
| 3690 | When 'binary' is set, the value of 'fileformats' is not used. |
| 3691 | |
Bram Moolenaar | 4f3f668 | 2016-03-26 23:01:59 +0100 | [diff] [blame] | 3692 | When Vim starts up with an empty buffer the first item is used. You |
| 3693 | can overrule this by setting 'fileformat' in your .vimrc. |
Bram Moolenaar | 81af925 | 2010-12-10 20:35:50 +0100 | [diff] [blame] | 3694 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3695 | For systems with a Dos-like <EOL> (<CR><NL>), when reading files that |
| 3696 | are ":source"ed and for vimrc files, automatic <EOL> detection may be |
| 3697 | done: |
| 3698 | - When 'fileformats' is empty, there is no automatic detection. Dos |
| 3699 | format will be used. |
| 3700 | - When 'fileformats' is set to one or more names, automatic detection |
| 3701 | is done. This is based on the first <NL> in the file: If there is a |
| 3702 | <CR> in front of it, Dos format is used, otherwise Unix format is |
| 3703 | used. |
| 3704 | Also see |file-formats|. |
| 3705 | For backwards compatibility: When this option is set to an empty |
| 3706 | string or one format (no comma is included), 'textauto' is reset, |
| 3707 | otherwise 'textauto' is set. |
| 3708 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 3709 | set and to the Vim default value when 'compatible' is reset. |
| 3710 | |
Bram Moolenaar | bf88493 | 2013-04-05 22:26:15 +0200 | [diff] [blame] | 3711 | *'fileignorecase'* *'fic'* *'nofileignorecase'* *'nofic'* |
| 3712 | 'fileignorecase' 'fic' boolean (default on for systems where case in file |
| 3713 | names is normally ignored) |
Bram Moolenaar | 71afbfe | 2013-03-19 16:49:16 +0100 | [diff] [blame] | 3714 | global |
Bram Moolenaar | 71afbfe | 2013-03-19 16:49:16 +0100 | [diff] [blame] | 3715 | When set case is ignored when using file names and directories. |
| 3716 | See 'wildignorecase' for only ignoring case when doing completion. |
| 3717 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3718 | *'filetype'* *'ft'* |
| 3719 | 'filetype' 'ft' string (default: "") |
Christian Brabandt | 596ad66 | 2023-08-16 00:11:09 +0200 | [diff] [blame] | 3720 | local to buffer |local-noglobal| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3721 | When this option is set, the FileType autocommand event is triggered. |
| 3722 | All autocommands that match with the value of this option will be |
| 3723 | executed. Thus the value of 'filetype' is used in place of the file |
| 3724 | name. |
| 3725 | Otherwise this option does not always reflect the current file type. |
| 3726 | This option is normally set when the file type is detected. To enable |
| 3727 | this use the ":filetype on" command. |:filetype| |
| 3728 | Setting this option to a different value is most useful in a modeline, |
| 3729 | for a file for which the file type is not automatically recognized. |
Bram Moolenaar | 97b2ad3 | 2006-03-18 21:40:56 +0000 | [diff] [blame] | 3730 | Example, for in an IDL file: |
| 3731 | /* vim: set filetype=idl : */ ~ |
| 3732 | |FileType| |filetypes| |
| 3733 | When a dot appears in the value then this separates two filetype |
Milly | ae62fe5 | 2024-10-02 19:30:41 +0200 | [diff] [blame] | 3734 | names, it should therefore not be used for a filetype. Example: |
Bram Moolenaar | 97b2ad3 | 2006-03-18 21:40:56 +0000 | [diff] [blame] | 3735 | /* vim: set filetype=c.doxygen : */ ~ |
| 3736 | This will use the "c" filetype first, then the "doxygen" filetype. |
| 3737 | This works both for filetype plugins and for syntax files. More than |
| 3738 | one dot may appear. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3739 | This option is not copied to another buffer, independent of the 's' or |
| 3740 | 'S' flag in 'cpoptions'. |
Christian Brabandt | f0c7090 | 2025-05-26 21:18:19 +0200 | [diff] [blame] | 3741 | Only alphanumeric characters, '-' and '_' can be used (and a '.' is |
Doug Kearns | a6172f8 | 2025-05-26 20:32:35 +0200 | [diff] [blame] | 3742 | allowed as delimiter when combining different filetypes). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3743 | |
| 3744 | *'fillchars'* *'fcs'* |
Yee Cheng Chin | 39cd906 | 2024-11-06 20:20:57 +0100 | [diff] [blame] | 3745 | 'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~,lastline:@") |
Bram Moolenaar | 96ba25a | 2022-07-04 17:34:33 +0100 | [diff] [blame] | 3746 | global or local to window |global-local| |
glepnir | b876204 | 2025-04-07 20:57:14 +0200 | [diff] [blame] | 3747 | Characters to fill the statuslines, vertical separators, special |
| 3748 | lines in the window and truncated text in the |ins-completion-menu|. |
Bram Moolenaar | 96ba25a | 2022-07-04 17:34:33 +0100 | [diff] [blame] | 3749 | It is a comma-separated list of items. Each item has a name, a colon |
zeertzjq | 6a8d2e1 | 2024-01-17 20:54:49 +0100 | [diff] [blame] | 3750 | and the value of that item: |E1511| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3751 | |
Bram Moolenaar | 96ba25a | 2022-07-04 17:34:33 +0100 | [diff] [blame] | 3752 | item name default Used for ~ |
Christian Brabandt | 6a650bf | 2023-11-08 21:23:29 +0100 | [diff] [blame] | 3753 | stl ' ' statusline of the current window |
| 3754 | stlnc ' ' statusline of the non-current windows |
Bram Moolenaar | 96ba25a | 2022-07-04 17:34:33 +0100 | [diff] [blame] | 3755 | vert '|' vertical separators |:vsplit| |
| 3756 | fold '-' filling 'foldtext' |
| 3757 | foldopen '-' mark the beginning of a fold |
| 3758 | foldclose '+' show a closed fold |
| 3759 | foldsep '|' open fold middle character |
| 3760 | diff '-' deleted lines of the 'diff' option |
| 3761 | eob '~' empty lines below the end of a buffer |
Bram Moolenaar | 4ba5f1d | 2022-10-04 14:36:29 +0100 | [diff] [blame] | 3762 | lastline '@' 'display' contains lastline/truncate |
glepnir | b876204 | 2025-04-07 20:57:14 +0200 | [diff] [blame] | 3763 | trunc '>' truncated text in the |
| 3764 | |ins-completion-menu|. |
Hirohito Higashi | fa8b7db | 2025-04-30 19:12:37 +0200 | [diff] [blame] | 3765 | truncrl '<' same as "trunc" in 'rightleft' mode |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 3766 | tpl_vert '|' vertical separators of 'tabpanel' |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3767 | |
Christian Brabandt | 6a650bf | 2023-11-08 21:23:29 +0100 | [diff] [blame] | 3768 | Any one that is omitted will fall back to the default. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3769 | |
| 3770 | Example: > |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 3771 | :set fillchars=stl:\ ,stlnc:\ ,vert:\|,fold:-,diff:-,tpl_vert:\| |
Christian Brabandt | 6a650bf | 2023-11-08 21:23:29 +0100 | [diff] [blame] | 3772 | < |
Hirohito Higashi | 0553f2f | 2025-05-10 14:56:17 +0200 | [diff] [blame] | 3773 | All items support single-byte and multibyte characters. But |
| 3774 | double-width characters are not supported. |E1512| |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 3775 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3776 | The highlighting used for these items: |
Bram Moolenaar | 96ba25a | 2022-07-04 17:34:33 +0100 | [diff] [blame] | 3777 | item name highlight group ~ |
| 3778 | stl StatusLine |hl-StatusLine| |
| 3779 | stlnc StatusLineNC |hl-StatusLineNC| |
| 3780 | vert VertSplit |hl-VertSplit| |
| 3781 | fold Folded |hl-Folded| |
glepnir | b876204 | 2025-04-07 20:57:14 +0200 | [diff] [blame] | 3782 | foldopen FoldColumn |hl-FoldColumn| |
| 3783 | foldclose FoldColumn |hl-FoldColumn| |
| 3784 | foldsep FoldColumn |hl-FoldColumn| |
Bram Moolenaar | 96ba25a | 2022-07-04 17:34:33 +0100 | [diff] [blame] | 3785 | diff DiffDelete |hl-DiffDelete| |
| 3786 | eob EndOfBuffer |hl-EndOfBuffer| |
Bram Moolenaar | 4ba5f1d | 2022-10-04 14:36:29 +0100 | [diff] [blame] | 3787 | lastline NonText |hl-NonText| |
glepnir | b876204 | 2025-04-07 20:57:14 +0200 | [diff] [blame] | 3788 | trunc one of the many Popup menu highlighting groups like |
| 3789 | |hl-PmenuSel| |
glepnir | d4dbf82 | 2025-04-12 18:35:34 +0200 | [diff] [blame] | 3790 | truncrl same as "trunc" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3791 | |
Yegappan Lakshmanan | a13f3a4 | 2024-11-02 18:40:10 +0100 | [diff] [blame] | 3792 | *'findfunc'* *'ffu'* *E1514* |
| 3793 | 'findfunc' 'ffu' string (default empty) |
Yegappan Lakshmanan | aeb1c97 | 2024-10-22 23:42:20 +0200 | [diff] [blame] | 3794 | global or local to buffer |global-local| |
| 3795 | {not available when compiled without the |+eval| |
| 3796 | feature} |
Yegappan Lakshmanan | a13f3a4 | 2024-11-02 18:40:10 +0100 | [diff] [blame] | 3797 | Function that is called to obtain the filename(s) for the |:find| |
Yegappan Lakshmanan | aeb1c97 | 2024-10-22 23:42:20 +0200 | [diff] [blame] | 3798 | command. When this option is empty, the internal |file-searching| |
| 3799 | mechanism is used. |
| 3800 | |
Yegappan Lakshmanan | a13f3a4 | 2024-11-02 18:40:10 +0100 | [diff] [blame] | 3801 | The value can be the name of a function, a |lambda| or a |Funcref|. |
| 3802 | See |option-value-function| for more information. |
Yegappan Lakshmanan | aeb1c97 | 2024-10-22 23:42:20 +0200 | [diff] [blame] | 3803 | |
Yegappan Lakshmanan | a13f3a4 | 2024-11-02 18:40:10 +0100 | [diff] [blame] | 3804 | The function is called with two arguments. The first argument is a |
| 3805 | |String| and is the |:find| command argument. The second argument is |
| 3806 | a |Boolean| and is set to |v:true| when the function is called to get |
| 3807 | a List of command-line completion matches for the |:find| command. |
| 3808 | The function should return a List of strings. |
Yegappan Lakshmanan | aeb1c97 | 2024-10-22 23:42:20 +0200 | [diff] [blame] | 3809 | |
Yegappan Lakshmanan | a13f3a4 | 2024-11-02 18:40:10 +0100 | [diff] [blame] | 3810 | The function is called only once per |:find| command invocation. |
| 3811 | The function can process all the directories specified in 'path'. |
zeertzjq | 20e045f | 2024-10-28 22:05:26 +0100 | [diff] [blame] | 3812 | |
Yegappan Lakshmanan | a13f3a4 | 2024-11-02 18:40:10 +0100 | [diff] [blame] | 3813 | If a match is found, the function should return a |List| containing |
| 3814 | one or more file names. If a match is not found, the function |
Yegappan Lakshmanan | aeb1c97 | 2024-10-22 23:42:20 +0200 | [diff] [blame] | 3815 | should return an empty List. |
| 3816 | |
Yegappan Lakshmanan | a13f3a4 | 2024-11-02 18:40:10 +0100 | [diff] [blame] | 3817 | If any errors are encountered during the function invocation, an |
Yegappan Lakshmanan | aeb1c97 | 2024-10-22 23:42:20 +0200 | [diff] [blame] | 3818 | empty List is used as the return value. |
| 3819 | |
Yegappan Lakshmanan | aeb1c97 | 2024-10-22 23:42:20 +0200 | [diff] [blame] | 3820 | It is not allowed to change text or jump to another window while |
Yegappan Lakshmanan | a13f3a4 | 2024-11-02 18:40:10 +0100 | [diff] [blame] | 3821 | executing the 'findfunc' |textlock|. |
Yegappan Lakshmanan | aeb1c97 | 2024-10-22 23:42:20 +0200 | [diff] [blame] | 3822 | |
| 3823 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 3824 | security reasons. |
| 3825 | |
| 3826 | Examples: |
| 3827 | > |
| 3828 | " Use glob() |
Yegappan Lakshmanan | a13f3a4 | 2024-11-02 18:40:10 +0100 | [diff] [blame] | 3829 | func FindFuncGlob(cmdarg, cmdcomplete) |
| 3830 | let pat = a:cmdcomplete ? $'{a:cmdarg}*' : a:cmdarg |
zeertzjq | 20e045f | 2024-10-28 22:05:26 +0100 | [diff] [blame] | 3831 | return glob(pat, v:false, v:true) |
Yegappan Lakshmanan | aeb1c97 | 2024-10-22 23:42:20 +0200 | [diff] [blame] | 3832 | endfunc |
Yegappan Lakshmanan | a13f3a4 | 2024-11-02 18:40:10 +0100 | [diff] [blame] | 3833 | set findfunc=FindFuncGlob |
Yegappan Lakshmanan | aeb1c97 | 2024-10-22 23:42:20 +0200 | [diff] [blame] | 3834 | |
| 3835 | " Use the 'git ls-files' output |
Yegappan Lakshmanan | a13f3a4 | 2024-11-02 18:40:10 +0100 | [diff] [blame] | 3836 | func FindGitFiles(cmdarg, cmdcomplete) |
Yegappan Lakshmanan | aeb1c97 | 2024-10-22 23:42:20 +0200 | [diff] [blame] | 3837 | let fnames = systemlist('git ls-files') |
Yegappan Lakshmanan | a13f3a4 | 2024-11-02 18:40:10 +0100 | [diff] [blame] | 3838 | return fnames->filter('v:val =~? a:cmdarg') |
Yegappan Lakshmanan | aeb1c97 | 2024-10-22 23:42:20 +0200 | [diff] [blame] | 3839 | endfunc |
Yegappan Lakshmanan | a13f3a4 | 2024-11-02 18:40:10 +0100 | [diff] [blame] | 3840 | set findfunc=FindGitFiles |
Yegappan Lakshmanan | aeb1c97 | 2024-10-22 23:42:20 +0200 | [diff] [blame] | 3841 | < |
Bram Moolenaar | 34d72d4 | 2015-07-17 14:18:08 +0200 | [diff] [blame] | 3842 | *'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'* |
| 3843 | 'fixendofline' 'fixeol' boolean (default on) |
| 3844 | local to buffer |
Bram Moolenaar | 34d72d4 | 2015-07-17 14:18:08 +0200 | [diff] [blame] | 3845 | When writing a file and this option is on, <EOL> at the end of file |
Bram Moolenaar | fb0cf23 | 2022-10-22 11:25:19 +0100 | [diff] [blame] | 3846 | will be restored if missing. Turn this option off if you want to |
Bram Moolenaar | 34d72d4 | 2015-07-17 14:18:08 +0200 | [diff] [blame] | 3847 | preserve the situation from the original file. |
| 3848 | When the 'binary' option is set the value of this option doesn't |
| 3849 | matter. |
| 3850 | See the 'endofline' option. |
K.Takata | 3af9821 | 2022-11-01 20:36:19 +0000 | [diff] [blame] | 3851 | See |eol-and-eof| for example settings. |
Bram Moolenaar | 34d72d4 | 2015-07-17 14:18:08 +0200 | [diff] [blame] | 3852 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3853 | *'fkmap'* *'fk'* *'nofkmap'* *'nofk'* |
Bram Moolenaar | 98a29d0 | 2021-01-18 19:55:44 +0100 | [diff] [blame] | 3854 | 'fkmap' 'fk' boolean (default off) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3855 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3856 | {only available when compiled with the |+rightleft| |
| 3857 | feature} |
Bram Moolenaar | 14184a3 | 2019-02-16 15:10:30 +0100 | [diff] [blame] | 3858 | This option was for using Farsi, which has been removed. See |
| 3859 | |farsi.txt|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3860 | |
| 3861 | *'foldclose'* *'fcl'* |
| 3862 | 'foldclose' 'fcl' string (default "") |
| 3863 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3864 | {not available when compiled without the |+folding| |
| 3865 | feature} |
| 3866 | When set to "all", a fold is closed when the cursor isn't in it and |
| 3867 | its level is higher than 'foldlevel'. Useful if you want folds to |
| 3868 | automatically close when moving out of them. |
| 3869 | |
| 3870 | *'foldcolumn'* *'fdc'* |
| 3871 | 'foldcolumn' 'fdc' number (default 0) |
| 3872 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3873 | {not available when compiled without the |+folding| |
| 3874 | feature} |
| 3875 | When non-zero, a column with the specified width is shown at the side |
| 3876 | of the window which indicates open and closed folds. The maximum |
| 3877 | value is 12. |
| 3878 | See |folding|. |
| 3879 | |
| 3880 | *'foldenable'* *'fen'* *'nofoldenable'* *'nofen'* |
| 3881 | 'foldenable' 'fen' boolean (default on) |
| 3882 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3883 | {not available when compiled without the |+folding| |
| 3884 | feature} |
| 3885 | When off, all folds are open. This option can be used to quickly |
| 3886 | switch between showing all text unfolded and viewing the text with |
| 3887 | folds (including manually opened or closed folds). It can be toggled |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 3888 | with the |zi| command. The 'foldcolumn' will remain blank when |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3889 | 'foldenable' is off. |
| 3890 | This option is set by commands that create a new fold or close a fold. |
| 3891 | See |folding|. |
| 3892 | |
| 3893 | *'foldexpr'* *'fde'* |
| 3894 | 'foldexpr' 'fde' string (default: "0") |
| 3895 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3896 | {not available when compiled without the |+folding| |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 3897 | or |+eval| features} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3898 | The expression used for when 'foldmethod' is "expr". It is evaluated |
Bram Moolenaar | 6f4754b | 2022-01-23 12:07:04 +0000 | [diff] [blame] | 3899 | for each line to obtain its fold level. The context is set to the |
| 3900 | script where 'foldexpr' was set, script-local items can be accessed. |
| 3901 | See |fold-expr| for the usage. |
Bram Moolenaar | 97b2ad3 | 2006-03-18 21:40:56 +0000 | [diff] [blame] | 3902 | |
Bram Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 3903 | The expression will be evaluated in the |sandbox| if set from a |
| 3904 | modeline, see |sandbox-option|. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 3905 | This option can't be set from a |modeline| when the 'diff' option is |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 3906 | on or the 'modelineexpr' option is off. |
Bram Moolenaar | b71eaae | 2006-01-20 23:10:18 +0000 | [diff] [blame] | 3907 | |
| 3908 | It is not allowed to change text or jump to another window while |
| 3909 | evaluating 'foldexpr' |textlock|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3910 | |
| 3911 | *'foldignore'* *'fdi'* |
| 3912 | 'foldignore' 'fdi' string (default: "#") |
| 3913 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3914 | {not available when compiled without the |+folding| |
| 3915 | feature} |
| 3916 | Used only when 'foldmethod' is "indent". Lines starting with |
| 3917 | characters in 'foldignore' will get their fold level from surrounding |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 3918 | lines. White space is skipped before checking for this character. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3919 | The default "#" works well for C programs. See |fold-indent|. |
| 3920 | |
| 3921 | *'foldlevel'* *'fdl'* |
| 3922 | 'foldlevel' 'fdl' number (default: 0) |
| 3923 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3924 | {not available when compiled without the |+folding| |
| 3925 | feature} |
| 3926 | Sets the fold level: Folds with a higher level will be closed. |
| 3927 | Setting this option to zero will close all folds. Higher numbers will |
| 3928 | close fewer folds. |
| 3929 | This option is set by commands like |zm|, |zM| and |zR|. |
| 3930 | See |fold-foldlevel|. |
| 3931 | |
| 3932 | *'foldlevelstart'* *'fdls'* |
| 3933 | 'foldlevelstart' 'fdls' number (default: -1) |
| 3934 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3935 | {not available when compiled without the |+folding| |
| 3936 | feature} |
| 3937 | Sets 'foldlevel' when starting to edit another buffer in a window. |
| 3938 | Useful to always start editing with all folds closed (value zero), |
| 3939 | some folds closed (one) or no folds closed (99). |
| 3940 | This is done before reading any modeline, thus a setting in a modeline |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 3941 | overrules this option. Starting to edit a file for |diff-mode| also |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3942 | ignores this option and closes all folds. |
| 3943 | It is also done before BufReadPre autocommands, to allow an autocmd to |
| 3944 | overrule the 'foldlevel' value for specific files. |
| 3945 | When the value is negative, it is not used. |
| 3946 | |
| 3947 | *'foldmarker'* *'fmr'* *E536* |
| 3948 | 'foldmarker' 'fmr' string (default: "{{{,}}}") |
| 3949 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3950 | {not available when compiled without the |+folding| |
| 3951 | feature} |
| 3952 | The start and end marker used when 'foldmethod' is "marker". There |
| 3953 | must be one comma, which separates the start and end marker. The |
| 3954 | marker is a literal string (a regular expression would be too slow). |
| 3955 | See |fold-marker|. |
| 3956 | |
| 3957 | *'foldmethod'* *'fdm'* |
| 3958 | 'foldmethod' 'fdm' string (default: "manual") |
| 3959 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3960 | {not available when compiled without the |+folding| |
| 3961 | feature} |
| 3962 | The kind of folding used for the current window. Possible values: |
| 3963 | |fold-manual| manual Folds are created manually. |
| 3964 | |fold-indent| indent Lines with equal indent form a fold. |
| 3965 | |fold-expr| expr 'foldexpr' gives the fold level of a line. |
| 3966 | |fold-marker| marker Markers are used to specify folds. |
| 3967 | |fold-syntax| syntax Syntax highlighting items specify folds. |
| 3968 | |fold-diff| diff Fold text that is not changed. |
| 3969 | |
| 3970 | *'foldminlines'* *'fml'* |
| 3971 | 'foldminlines' 'fml' number (default: 1) |
| 3972 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3973 | {not available when compiled without the |+folding| |
| 3974 | feature} |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 3975 | Sets the number of screen lines above which a fold can be displayed |
| 3976 | closed. Also for manually closed folds. With the default value of |
| 3977 | one a fold can only be closed if it takes up two or more screen lines. |
| 3978 | Set to zero to be able to close folds of just one screen line. |
Bram Moolenaar | 446beb4 | 2011-05-10 17:18:44 +0200 | [diff] [blame] | 3979 | Note that this only has an effect on what is displayed. After using |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3980 | "zc" to close a fold, which is displayed open because it's smaller |
| 3981 | than 'foldminlines', a following "zc" may close a containing fold. |
| 3982 | |
| 3983 | *'foldnestmax'* *'fdn'* |
| 3984 | 'foldnestmax' 'fdn' number (default: 20) |
| 3985 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3986 | {not available when compiled without the |+folding| |
| 3987 | feature} |
| 3988 | Sets the maximum nesting of folds for the "indent" and "syntax" |
| 3989 | methods. This avoids that too many folds will be created. Using more |
| 3990 | than 20 doesn't work, because the internal limit is 20. |
| 3991 | |
| 3992 | *'foldopen'* *'fdo'* |
| 3993 | 'foldopen' 'fdo' string (default: "block,hor,mark,percent,quickfix, |
| 3994 | search,tag,undo") |
| 3995 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3996 | {not available when compiled without the |+folding| |
| 3997 | feature} |
| 3998 | Specifies for which type of commands folds will be opened, if the |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 3999 | command moves the cursor into a closed fold. It is a comma-separated |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4000 | list of items. |
Bram Moolenaar | 0536570 | 2010-10-27 18:34:44 +0200 | [diff] [blame] | 4001 | NOTE: When the command is part of a mapping this option is not used. |
| 4002 | Add the |zv| command to the mapping to get the same effect. |
| 4003 | (rationale: the mapping may want to control opening folds itself) |
| 4004 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4005 | item commands ~ |
| 4006 | all any |
| 4007 | block "(", "{", "[[", "[{", etc. |
| 4008 | hor horizontal movements: "l", "w", "fx", etc. |
| 4009 | insert any command in Insert mode |
| 4010 | jump far jumps: "G", "gg", etc. |
| 4011 | mark jumping to a mark: "'m", CTRL-O, etc. |
| 4012 | percent "%" |
| 4013 | quickfix ":cn", ":crew", ":make", etc. |
| 4014 | search search for a pattern: "/", "n", "*", "gd", etc. |
| 4015 | (not for a search pattern in a ":" command) |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 4016 | Also for |[s| and |]s|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4017 | tag jumping to a tag: ":ta", CTRL-T, etc. |
| 4018 | undo undo or redo: "u" and CTRL-R |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4019 | When a movement command is used for an operator (e.g., "dl" or "y%") |
| 4020 | this option is not used. This means the operator will include the |
| 4021 | whole closed fold. |
| 4022 | Note that vertical movements are not here, because it would make it |
| 4023 | very difficult to move onto a closed fold. |
| 4024 | In insert mode the folds containing the cursor will always be open |
| 4025 | when text is inserted. |
| 4026 | To close folds you can re-apply 'foldlevel' with the |zx| command or |
| 4027 | set the 'foldclose' option to "all". |
| 4028 | |
| 4029 | *'foldtext'* *'fdt'* |
| 4030 | 'foldtext' 'fdt' string (default: "foldtext()") |
| 4031 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4032 | {not available when compiled without the |+folding| |
| 4033 | feature} |
| 4034 | An expression which is used to specify the text displayed for a closed |
Bram Moolenaar | 6f4754b | 2022-01-23 12:07:04 +0000 | [diff] [blame] | 4035 | fold. The context is set to the script where 'foldexpr' was set, |
| 4036 | script-local items can be accessed. See |fold-foldtext| for the |
| 4037 | usage. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4038 | |
Bram Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 4039 | The expression will be evaluated in the |sandbox| if set from a |
| 4040 | modeline, see |sandbox-option|. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 4041 | This option cannot be set in a modeline when 'modelineexpr' is off. |
Bram Moolenaar | b71eaae | 2006-01-20 23:10:18 +0000 | [diff] [blame] | 4042 | |
| 4043 | It is not allowed to change text or jump to another window while |
| 4044 | evaluating 'foldtext' |textlock|. |
| 4045 | |
Bram Moolenaar | c95a302 | 2016-06-12 23:01:46 +0200 | [diff] [blame] | 4046 | *'formatexpr'* *'fex'* |
| 4047 | 'formatexpr' 'fex' string (default "") |
| 4048 | local to buffer |
Bram Moolenaar | c95a302 | 2016-06-12 23:01:46 +0200 | [diff] [blame] | 4049 | {not available when compiled without the |+eval| |
| 4050 | feature} |
| 4051 | Expression which is evaluated to format a range of lines for the |gq| |
| 4052 | operator or automatic formatting (see 'formatoptions'). When this |
| 4053 | option is empty 'formatprg' is used. |
| 4054 | |
| 4055 | The |v:lnum| variable holds the first line to be formatted. |
| 4056 | The |v:count| variable holds the number of lines to be formatted. |
| 4057 | The |v:char| variable holds the character that is going to be |
| 4058 | inserted if the expression is being evaluated due to |
| 4059 | automatic formatting. This can be empty. Don't insert |
| 4060 | it yet! |
| 4061 | |
| 4062 | Example: > |
| 4063 | :set formatexpr=mylang#Format() |
| 4064 | < This will invoke the mylang#Format() function in the |
| 4065 | autoload/mylang.vim file in 'runtimepath'. |autoload| |
| 4066 | |
Bram Moolenaar | a4e0b97 | 2022-10-01 19:43:52 +0100 | [diff] [blame] | 4067 | The advantage of using a function call without arguments is that it is |
| 4068 | faster, see |expr-option-function|. |
| 4069 | |
Bram Moolenaar | c95a302 | 2016-06-12 23:01:46 +0200 | [diff] [blame] | 4070 | The expression is also evaluated when 'textwidth' is set and adding |
| 4071 | text beyond that limit. This happens under the same conditions as |
| 4072 | when internal formatting is used. Make sure the cursor is kept in the |
| 4073 | same spot relative to the text then! The |mode()| function will |
| 4074 | return "i" or "R" in this situation. |
Bram Moolenaar | 22f1d0e | 2018-02-27 14:53:30 +0100 | [diff] [blame] | 4075 | |
Bram Moolenaar | c95a302 | 2016-06-12 23:01:46 +0200 | [diff] [blame] | 4076 | When the expression evaluates to non-zero Vim will fall back to using |
| 4077 | the internal format mechanism. |
| 4078 | |
Yegappan Lakshmanan | 8bb65f2 | 2021-12-26 10:51:39 +0000 | [diff] [blame] | 4079 | If the expression starts with s: or |<SID>|, then it is replaced with |
| 4080 | the script ID (|local-function|). Example: > |
| 4081 | set formatexpr=s:MyFormatExpr() |
| 4082 | set formatexpr=<SID>SomeFormatExpr() |
Bram Moolenaar | 6f4754b | 2022-01-23 12:07:04 +0000 | [diff] [blame] | 4083 | < Otherwise, the expression is evaluated in the context of the script |
| 4084 | where the option was set, thus script-local items are available. |
| 4085 | |
Bram Moolenaar | c95a302 | 2016-06-12 23:01:46 +0200 | [diff] [blame] | 4086 | The expression will be evaluated in the |sandbox| when set from a |
| 4087 | modeline, see |sandbox-option|. That stops the option from working, |
| 4088 | since changing the buffer text is not allowed. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 4089 | This option cannot be set in a modeline when 'modelineexpr' is off. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 4090 | NOTE: This option is set to "" when 'compatible' is set. |
Bram Moolenaar | c95a302 | 2016-06-12 23:01:46 +0200 | [diff] [blame] | 4091 | |
Bram Moolenaar | 86b6835 | 2004-12-27 21:59:20 +0000 | [diff] [blame] | 4092 | *'formatlistpat'* *'flp'* |
| 4093 | 'formatlistpat' 'flp' string (default: "^\s*\d\+[\]:.)}\t ]\s*") |
| 4094 | local to buffer |
Bram Moolenaar | 86b6835 | 2004-12-27 21:59:20 +0000 | [diff] [blame] | 4095 | A pattern that is used to recognize a list header. This is used for |
| 4096 | the "n" flag in 'formatoptions'. |
| 4097 | The pattern must match exactly the text that will be the indent for |
Bram Moolenaar | 677ee68 | 2005-01-27 14:41:15 +0000 | [diff] [blame] | 4098 | the line below it. You can use |/\ze| to mark the end of the match |
Bram Moolenaar | 86b6835 | 2004-12-27 21:59:20 +0000 | [diff] [blame] | 4099 | while still checking more characters. There must be a character |
| 4100 | following the pattern, when it matches the whole line it is handled |
| 4101 | like there is no match. |
| 4102 | The default recognizes a number, followed by an optional punctuation |
| 4103 | character and white space. |
| 4104 | |
Bram Moolenaar | 6c60f47 | 2019-04-28 16:00:35 +0200 | [diff] [blame] | 4105 | *'formatoptions'* *'fo'* |
| 4106 | 'formatoptions' 'fo' string (Vim default: "tcq", Vi default: "vt") |
| 4107 | local to buffer |
| 4108 | This is a sequence of letters which describes how automatic |
Christian Brabandt | 1b08d2c | 2023-11-11 15:50:13 +0100 | [diff] [blame] | 4109 | formatting is to be done. |
| 4110 | See |fo-table| for possible values and |gq| for how to format text. |
| 4111 | When the 'paste' option is on, no formatting is done (like |
| 4112 | 'formatoptions' is empty). Commas can be inserted for readability. |
Bram Moolenaar | 6c60f47 | 2019-04-28 16:00:35 +0200 | [diff] [blame] | 4113 | To avoid problems with flags that are added in the future, use the |
| 4114 | "+=" and "-=" feature of ":set" |add-option-flags|. |
| 4115 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 4116 | set and to the Vim default value when 'compatible' is reset. |
| 4117 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4118 | *'formatprg'* *'fp'* |
| 4119 | 'formatprg' 'fp' string (default "") |
Bram Moolenaar | 9be7c04 | 2017-01-14 14:28:30 +0100 | [diff] [blame] | 4120 | global or local to buffer |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4121 | The name of an external program that will be used to format the lines |
Bram Moolenaar | 1d2ba7f | 2006-02-14 22:29:30 +0000 | [diff] [blame] | 4122 | selected with the |gq| operator. The program must take the input on |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4123 | stdin and produce the output on stdout. The Unix program "fmt" is |
Bram Moolenaar | a5792f5 | 2005-11-23 21:25:05 +0000 | [diff] [blame] | 4124 | such a program. |
Bram Moolenaar | 1d2ba7f | 2006-02-14 22:29:30 +0000 | [diff] [blame] | 4125 | If the 'formatexpr' option is not empty it will be used instead. |
| 4126 | Otherwise, if 'formatprg' option is an empty string, the internal |
| 4127 | format function will be used |C-indenting|. |
Bram Moolenaar | a5792f5 | 2005-11-23 21:25:05 +0000 | [diff] [blame] | 4128 | Environment variables are expanded |:set_env|. See |option-backslash| |
| 4129 | about including spaces and backslashes. |
Bram Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 4130 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 4131 | security reasons. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4132 | |
Bram Moolenaar | d94464e | 2015-11-02 15:28:18 +0100 | [diff] [blame] | 4133 | *'fsync'* *'fs'* *'nofsync'* *'nofs'* |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 4134 | 'fsync' 'fs' boolean (default on) |
| 4135 | global |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 4136 | When on, the library function fsync() will be called after writing a |
| 4137 | file. This will flush a file to disk, ensuring that it is safely |
| 4138 | written even on filesystems which do metadata-only journaling. This |
| 4139 | will force the harddrive to spin up on Linux systems running in laptop |
| 4140 | mode, so it may be undesirable in some situations. Be warned that |
| 4141 | turning this off increases the chances of data loss after a crash. On |
| 4142 | systems without an fsync() implementation, this variable is always |
| 4143 | off. |
| 4144 | Also see 'swapsync' for controlling fsync() on swap files. |
Bram Moolenaar | 340dd0f | 2021-10-14 17:52:23 +0100 | [diff] [blame] | 4145 | 'fsync' also applies to |writefile()| (unless a flag is used to |
| 4146 | overrule it) and when writing undo files (see |undo-persistence|). |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 4147 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 4148 | security reasons. |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 4149 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4150 | *'gdefault'* *'gd'* *'nogdefault'* *'nogd'* |
| 4151 | 'gdefault' 'gd' boolean (default off) |
| 4152 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4153 | When on, the ":substitute" flag 'g' is default on. This means that |
| 4154 | all matches in a line are substituted instead of one. When a 'g' flag |
| 4155 | is given to a ":substitute" command, this will toggle the substitution |
| 4156 | of all or one match. See |complex-change|. |
| 4157 | |
| 4158 | command 'gdefault' on 'gdefault' off ~ |
| 4159 | :s/// subst. all subst. one |
| 4160 | :s///g subst. one subst. all |
| 4161 | :s///gg subst. all subst. one |
| 4162 | |
| 4163 | NOTE: This option is reset when 'compatible' is set. |
dundargoc | 82f1973 | 2023-12-16 14:53:52 +0100 | [diff] [blame] | 4164 | Setting this option may break plugins that rely on the default |
| 4165 | behavior of the 'g' flag. This will also make the 'g' flag have the |
| 4166 | opposite effect of that documented in |:s_g|. |
Bram Moolenaar | 4072ba5 | 2020-12-23 13:56:35 +0100 | [diff] [blame] | 4167 | This option is not used in |Vim9| script. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4168 | |
| 4169 | *'grepformat'* *'gfm'* |
Bram Moolenaar | 6e93246 | 2014-09-09 18:48:09 +0200 | [diff] [blame] | 4170 | 'grepformat' 'gfm' string (default "%f:%l:%m,%f:%l%m,%f %l%m") |
glepnir | 7b9eb63 | 2025-05-16 19:49:23 +0200 | [diff] [blame] | 4171 | global or local to buffer |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4172 | Format to recognize for the ":grep" command output. |
| 4173 | This is a scanf-like string that uses the same format as the |
| 4174 | 'errorformat' option: see |errorformat|. |
| 4175 | |
| 4176 | *'grepprg'* *'gp'* |
| 4177 | 'grepprg' 'gp' string (default "grep -n ", |
| 4178 | Unix: "grep -n $* /dev/null", |
| 4179 | Win32: "findstr /n" or "grep -n", |
| 4180 | VMS: "SEARCH/NUMBERS ") |
| 4181 | global or local to buffer |global-local| |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 4182 | Program to use for the |:grep| command. This option may contain '%' |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4183 | and '#' characters, which are expanded like when used in a command- |
| 4184 | line. The placeholder "$*" is allowed to specify where the arguments |
| 4185 | will be included. Environment variables are expanded |:set_env|. See |
| 4186 | |option-backslash| about including spaces and backslashes. |
| 4187 | When your "grep" accepts the "-H" argument, use this to make ":grep" |
| 4188 | also work well with a single file: > |
| 4189 | :set grepprg=grep\ -nH |
Bram Moolenaar | 7c62692 | 2005-02-07 22:01:03 +0000 | [diff] [blame] | 4190 | < Special value: When 'grepprg' is set to "internal" the |:grep| command |
Bram Moolenaar | a655760 | 2006-02-04 22:43:20 +0000 | [diff] [blame] | 4191 | works like |:vimgrep|, |:lgrep| like |:lvimgrep|, |:grepadd| like |
| 4192 | |:vimgrepadd| and |:lgrepadd| like |:lvimgrepadd|. |
Bram Moolenaar | 86b6835 | 2004-12-27 21:59:20 +0000 | [diff] [blame] | 4193 | See also the section |:make_makeprg|, since most of the comments there |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4194 | apply equally to 'grepprg'. |
| 4195 | For Win32, the default is "findstr /n" if "findstr.exe" can be found, |
| 4196 | otherwise it's "grep -n". |
| 4197 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 4198 | security reasons. |
| 4199 | |
| 4200 | *'guicursor'* *'gcr'* *E545* *E546* *E548* *E549* |
| 4201 | 'guicursor' 'gcr' string (default "n-v-c:block-Cursor/lCursor, |
| 4202 | ve:ver35-Cursor, |
| 4203 | o:hor50-Cursor, |
| 4204 | i-ci:ver25-Cursor/lCursor, |
| 4205 | r-cr:hor20-Cursor/lCursor, |
| 4206 | sm:block-Cursor |
| 4207 | -blinkwait175-blinkoff150-blinkon175", |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 4208 | for Win32 console: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4209 | "n-v-c:block,o:hor50,i-ci:hor15, |
| 4210 | r-cr:hor30,sm:block") |
| 4211 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4212 | {only available when compiled with GUI enabled, and |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 4213 | for Win32 console} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4214 | This option tells Vim what the cursor should look like in different |
Bram Moolenaar | 8024f93 | 2020-01-14 19:29:13 +0100 | [diff] [blame] | 4215 | modes. It fully works in the GUI. In a Win32 console, only the |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 4216 | height of the cursor can be changed. This can be done by specifying a |
| 4217 | block cursor, or a percentage for a vertical or horizontal cursor. |
Bram Moolenaar | 1e7813a | 2015-03-31 18:31:03 +0200 | [diff] [blame] | 4218 | For a console the 't_SI', 't_SR', and 't_EI' escape sequences are |
| 4219 | used. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4220 | |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 4221 | The option is a comma-separated list of parts. Each part consist of a |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4222 | mode-list and an argument-list: |
| 4223 | mode-list:argument-list,mode-list:argument-list,.. |
| 4224 | The mode-list is a dash separated list of these modes: |
| 4225 | n Normal mode |
| 4226 | v Visual mode |
| 4227 | ve Visual mode with 'selection' "exclusive" (same as 'v', |
| 4228 | if not specified) |
| 4229 | o Operator-pending mode |
| 4230 | i Insert mode |
| 4231 | r Replace mode |
| 4232 | c Command-line Normal (append) mode |
| 4233 | ci Command-line Insert mode |
| 4234 | cr Command-line Replace mode |
| 4235 | sm showmatch in Insert mode |
| 4236 | a all modes |
| 4237 | The argument-list is a dash separated list of these arguments: |
| 4238 | hor{N} horizontal bar, {N} percent of the character height |
| 4239 | ver{N} vertical bar, {N} percent of the character width |
| 4240 | block block cursor, fills the whole character |
| 4241 | [only one of the above three should be present] |
| 4242 | blinkwait{N} *cursor-blinking* |
| 4243 | blinkon{N} |
| 4244 | blinkoff{N} |
| 4245 | blink times for cursor: blinkwait is the delay before |
| 4246 | the cursor starts blinking, blinkon is the time that |
| 4247 | the cursor is shown and blinkoff is the time that the |
| 4248 | cursor is not shown. The times are in msec. When one |
| 4249 | of the numbers is zero, there is no blinking. The |
| 4250 | default is: "blinkwait700-blinkon400-blinkoff250". |
| 4251 | These numbers are used for a missing entry. This |
| 4252 | means that blinking is enabled by default. To switch |
| 4253 | blinking off you can use "blinkon0". The cursor only |
| 4254 | blinks when Vim is waiting for input, not while |
| 4255 | executing a command. |
| 4256 | To make the cursor blink in an xterm, see |
| 4257 | |xterm-blink|. |
| 4258 | {group-name} |
| 4259 | a highlight group name, that sets the color and font |
| 4260 | for the cursor |
| 4261 | {group-name}/{group-name} |
| 4262 | Two highlight group names, the first is used when |
| 4263 | no language mappings are used, the other when they |
| 4264 | are. |language-mapping| |
| 4265 | |
| 4266 | Examples of parts: |
| 4267 | n-c-v:block-nCursor in Normal, Command-line and Visual mode, use a |
| 4268 | block cursor with colors from the "nCursor" |
| 4269 | highlight group |
| 4270 | i-ci:ver30-iCursor-blinkwait300-blinkon200-blinkoff150 |
| 4271 | In Insert and Command-line Insert mode, use a |
| 4272 | 30% vertical bar cursor with colors from the |
| 4273 | "iCursor" highlight group. Blink a bit |
| 4274 | faster. |
| 4275 | |
| 4276 | The 'a' mode is different. It will set the given argument-list for |
| 4277 | all modes. It does not reset anything to defaults. This can be used |
| 4278 | to do a common setting for all modes. For example, to switch off |
| 4279 | blinking: "a:blinkon0" |
| 4280 | |
| 4281 | Examples of cursor highlighting: > |
| 4282 | :highlight Cursor gui=reverse guifg=NONE guibg=NONE |
| 4283 | :highlight Cursor gui=NONE guifg=bg guibg=fg |
| 4284 | < |
| 4285 | *'guifont'* *'gfn'* |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 4286 | *E235* *E596* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4287 | 'guifont' 'gfn' string (default "") |
| 4288 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4289 | {only available when compiled with GUI enabled} |
| 4290 | This is a list of fonts which will be used for the GUI version of Vim. |
Bram Moolenaar | f720d0a | 2019-04-28 14:02:47 +0200 | [diff] [blame] | 4291 | In its simplest form the value is just one font name. |
| 4292 | See |gui-font| for the details. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4293 | |
| 4294 | *'guifontset'* *'gfs'* |
| 4295 | *E250* *E252* *E234* *E597* *E598* |
| 4296 | 'guifontset' 'gfs' string (default "") |
| 4297 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4298 | {only available when compiled with GUI enabled and |
| 4299 | with the |+xfontset| feature} |
Bram Moolenaar | 3df0173 | 2017-02-17 22:47:16 +0100 | [diff] [blame] | 4300 | {not available in the GTK+ GUI} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4301 | When not empty, specifies two (or more) fonts to be used. The first |
| 4302 | one for normal English, the second one for your special language. See |
| 4303 | |xfontset|. |
Bram Moolenaar | f720d0a | 2019-04-28 14:02:47 +0200 | [diff] [blame] | 4304 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4305 | *'guifontwide'* *'gfw'* *E231* *E533* *E534* |
| 4306 | 'guifontwide' 'gfw' string (default "") |
| 4307 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4308 | {only available when compiled with GUI enabled} |
| 4309 | When not empty, specifies a comma-separated list of fonts to be used |
| 4310 | for double-width characters. The first font that can be loaded is |
Bram Moolenaar | f720d0a | 2019-04-28 14:02:47 +0200 | [diff] [blame] | 4311 | used. See |gui-fontwide|. |
Bram Moolenaar | 0f27212 | 2013-01-23 18:37:40 +0100 | [diff] [blame] | 4312 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4313 | *'guiheadroom'* *'ghr'* |
| 4314 | 'guiheadroom' 'ghr' number (default 50) |
| 4315 | global |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 4316 | {only for GTK and X11 GUI} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4317 | The number of pixels subtracted from the screen height when fitting |
| 4318 | the GUI window on the screen. Set this before the GUI is started, |
| 4319 | e.g., in your |gvimrc| file. When zero, the whole screen height will |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 4320 | be used by the window. When positive, the specified number of pixel |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4321 | lines will be left for window decorations and other items on the |
| 4322 | screen. Set it to a negative value to allow windows taller than the |
| 4323 | screen. |
| 4324 | |
Dusan Popovic | 4eeedc0 | 2021-10-16 20:52:05 +0100 | [diff] [blame] | 4325 | *'guiligatures'* *'gli'* *E1243* |
| 4326 | 'guiligatures' 'gli' string (default "") |
| 4327 | global |
Erik S. V. Jansson | 8b1e749 | 2024-02-24 14:26:52 +0100 | [diff] [blame] | 4328 | {only for GTK and Win32 GUI} |
Dusan Popovic | 4eeedc0 | 2021-10-16 20:52:05 +0100 | [diff] [blame] | 4329 | List of ASCII characters that, when combined together, can create more |
| 4330 | complex shapes. Each character must be a printable ASCII character |
| 4331 | with a value in the 32-127 range. |
| 4332 | Example: > |
| 4333 | :set guiligatures=!\"#$%&()*+-./:<=>?@[]^_{\|~ |
| 4334 | < Changing this option updates screen output immediately. Set it to an |
| 4335 | empty string to disable ligatures. |
| 4336 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4337 | *'guioptions'* *'go'* |
Bram Moolenaar | 2c64ca1 | 2018-10-19 16:22:31 +0200 | [diff] [blame] | 4338 | 'guioptions' 'go' string (default "egmrLtT" (MS-Windows, |
| 4339 | "t" is removed in |defaults.vim|), |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 4340 | "aegimrLtT" (GTK and Motif), |
Bram Moolenaar | 8c08b5b | 2016-07-28 22:24:15 +0200 | [diff] [blame] | 4341 | ) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4342 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4343 | {only available when compiled with GUI enabled} |
Bram Moolenaar | ed20346 | 2004-06-16 11:19:22 +0000 | [diff] [blame] | 4344 | This option only has an effect in the GUI version of Vim. It is a |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4345 | sequence of letters which describes what components and options of the |
| 4346 | GUI should be used. |
| 4347 | To avoid problems with flags that are added in the future, use the |
| 4348 | "+=" and "-=" feature of ":set" |add-option-flags|. |
| 4349 | |
Bram Moolenaar | 1356825 | 2018-03-16 20:46:58 +0100 | [diff] [blame] | 4350 | Valid characters are as follows: |
| 4351 | *'go-!'* |
| 4352 | '!' External commands are executed in a terminal window. Without |
| 4353 | this flag the MS-Windows GUI will open a console window to |
| 4354 | execute the command. The Unix GUI will simulate a dumb |
| 4355 | terminal to list the command output. |
| 4356 | The terminal window will be positioned at the bottom, and grow |
| 4357 | upwards as needed. |
Bram Moolenaar | ba3ff53 | 2018-11-04 14:45:49 +0100 | [diff] [blame] | 4358 | *'go-a'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4359 | 'a' Autoselect: If present, then whenever VISUAL mode is started, |
| 4360 | or the Visual area extended, Vim tries to become the owner of |
| 4361 | the windowing system's global selection. This means that the |
| 4362 | Visually highlighted text is available for pasting into other |
| 4363 | applications as well as into Vim itself. When the Visual mode |
| 4364 | ends, possibly due to an operation on the text, or when an |
| 4365 | application wants to paste the selection, the highlighted text |
| 4366 | is automatically yanked into the "* selection register. |
| 4367 | Thus the selection is still available for pasting into other |
| 4368 | applications after the VISUAL mode has ended. |
| 4369 | If not present, then Vim won't become the owner of the |
| 4370 | windowing system's global selection unless explicitly told to |
| 4371 | by a yank or delete operation for the "* register. |
| 4372 | The same applies to the modeless selection. |
Bram Moolenaar | c0885aa | 2012-07-10 16:49:23 +0200 | [diff] [blame] | 4373 | *'go-P'* |
| 4374 | 'P' Like autoselect but using the "+ register instead of the "* |
Bram Moolenaar | 3848e00 | 2016-03-19 18:42:29 +0100 | [diff] [blame] | 4375 | register. |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 4376 | *'go-A'* |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 4377 | 'A' Autoselect for the modeless selection. Like 'a', but only |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4378 | applies to the modeless selection. |
| 4379 | |
| 4380 | 'guioptions' autoselect Visual autoselect modeless ~ |
| 4381 | "" - - |
| 4382 | "a" yes yes |
| 4383 | "A" - yes |
| 4384 | "aA" yes yes |
| 4385 | |
Bram Moolenaar | 9fbdbb8 | 2022-09-27 17:30:34 +0100 | [diff] [blame] | 4386 | When using a terminal see the 'clipboard' option. |
| 4387 | |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 4388 | *'go-c'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4389 | 'c' Use console dialogs instead of popup dialogs for simple |
| 4390 | choices. |
Bram Moolenaar | 50bf7ce | 2019-09-15 13:17:00 +0200 | [diff] [blame] | 4391 | *'go-d'* |
| 4392 | 'd' Use dark theme variant if available. Currently only works for |
| 4393 | GTK+ GUI. |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 4394 | *'go-e'* |
Bram Moolenaar | e224ffa | 2006-03-01 00:01:28 +0000 | [diff] [blame] | 4395 | 'e' Add tab pages when indicated with 'showtabline'. |
Bram Moolenaar | 5c8837f | 2006-02-25 21:52:33 +0000 | [diff] [blame] | 4396 | 'guitablabel' can be used to change the text in the labels. |
| 4397 | When 'e' is missing a non-GUI tab pages line may be used. |
Bram Moolenaar | d68071d | 2006-05-02 22:08:30 +0000 | [diff] [blame] | 4398 | The GUI tabs are only supported on some systems, currently |
Bram Moolenaar | b3f7406 | 2020-02-26 16:16:53 +0100 | [diff] [blame] | 4399 | GTK, Motif, Mac OS/X, Haiku, and MS-Windows. |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 4400 | *'go-f'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4401 | 'f' Foreground: Don't use fork() to detach the GUI from the shell |
| 4402 | where it was started. Use this for programs that wait for the |
| 4403 | editor to finish (e.g., an e-mail program). Alternatively you |
| 4404 | can use "gvim -f" or ":gui -f" to start the GUI in the |
| 4405 | foreground. |gui-fork| |
| 4406 | Note: Set this option in the vimrc file. The forking may have |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 4407 | happened already when the |gvimrc| file is read. |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 4408 | *'go-i'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4409 | 'i' Use a Vim icon. For GTK with KDE it is used in the left-upper |
| 4410 | corner of the window. It's black&white on non-GTK, because of |
| 4411 | limitations of X11. For a color icon, see |X11-icon|. |
Bram Moolenaar | 0bc380a | 2010-07-10 13:52:13 +0200 | [diff] [blame] | 4412 | *'go-m'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4413 | 'm' Menu bar is present. |
Bram Moolenaar | 0bc380a | 2010-07-10 13:52:13 +0200 | [diff] [blame] | 4414 | *'go-M'* |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 4415 | 'M' The system menu "$VIMRUNTIME/menu.vim" is not sourced. Note |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4416 | that this flag must be added in the .vimrc file, before |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 4417 | switching on syntax or filetype recognition (when the |gvimrc| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4418 | file is sourced the system menu has already been loaded; the |
Bram Moolenaar | 01164a6 | 2017-11-02 22:58:42 +0100 | [diff] [blame] | 4419 | `:syntax on` and `:filetype on` commands load the menu too). |
Bram Moolenaar | 0bc380a | 2010-07-10 13:52:13 +0200 | [diff] [blame] | 4420 | *'go-g'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4421 | 'g' Grey menu items: Make menu items that are not active grey. If |
| 4422 | 'g' is not included inactive menu items are not shown at all. |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 4423 | *'go-t'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4424 | 't' Include tearoff menu items. Currently only works for Win32, |
| 4425 | GTK+, and Motif 1.2 GUI. |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 4426 | *'go-T'* |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 4427 | 'T' Include Toolbar. Currently only in Win32, GTK+, Motif and |
| 4428 | Photon GUIs. |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 4429 | *'go-r'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4430 | 'r' Right-hand scrollbar is always present. |
Bram Moolenaar | 0bc380a | 2010-07-10 13:52:13 +0200 | [diff] [blame] | 4431 | *'go-R'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4432 | 'R' Right-hand scrollbar is present when there is a vertically |
| 4433 | split window. |
Bram Moolenaar | 0bc380a | 2010-07-10 13:52:13 +0200 | [diff] [blame] | 4434 | *'go-l'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4435 | 'l' Left-hand scrollbar is always present. |
Bram Moolenaar | 0bc380a | 2010-07-10 13:52:13 +0200 | [diff] [blame] | 4436 | *'go-L'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4437 | 'L' Left-hand scrollbar is present when there is a vertically |
| 4438 | split window. |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 4439 | *'go-b'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4440 | 'b' Bottom (horizontal) scrollbar is present. Its size depends on |
| 4441 | the longest visible line, or on the cursor line if the 'h' |
| 4442 | flag is included. |gui-horiz-scroll| |
Bram Moolenaar | 0bc380a | 2010-07-10 13:52:13 +0200 | [diff] [blame] | 4443 | *'go-h'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4444 | 'h' Limit horizontal scrollbar size to the length of the cursor |
| 4445 | line. Reduces computations. |gui-horiz-scroll| |
| 4446 | |
| 4447 | And yes, you may even have scrollbars on the left AND the right if |
| 4448 | you really want to :-). See |gui-scrollbars| for more information. |
| 4449 | |
Bram Moolenaar | 0bc380a | 2010-07-10 13:52:13 +0200 | [diff] [blame] | 4450 | *'go-v'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4451 | 'v' Use a vertical button layout for dialogs. When not included, |
| 4452 | a horizontal layout is preferred, but when it doesn't fit a |
Bram Moolenaar | dad4473 | 2021-03-31 20:07:33 +0200 | [diff] [blame] | 4453 | vertical layout is used anyway. Not supported in GTK 3. |
Bram Moolenaar | 0bc380a | 2010-07-10 13:52:13 +0200 | [diff] [blame] | 4454 | *'go-p'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4455 | 'p' Use Pointer callbacks for X11 GUI. This is required for some |
| 4456 | window managers. If the cursor is not blinking or hollow at |
| 4457 | the right moment, try adding this flag. This must be done |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 4458 | before starting the GUI. Set it in your |gvimrc|. Adding or |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4459 | removing it after the GUI has started has no effect. |
Bram Moolenaar | 0bc380a | 2010-07-10 13:52:13 +0200 | [diff] [blame] | 4460 | *'go-F'* |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 4461 | 'F' Add a footer. Only for Motif. See |gui-footer|. |
Bram Moolenaar | 8ac4415 | 2017-11-09 18:33:29 +0100 | [diff] [blame] | 4462 | *'go-k'* |
| 4463 | 'k' Keep the GUI window size when adding/removing a scrollbar, or |
| 4464 | toolbar, tabline, etc. Instead, the behavior is similar to |
| 4465 | when the window is maximized and will adjust 'lines' and |
| 4466 | 'columns' to fit to the window. Without the 'k' flag Vim will |
Bram Moolenaar | 51b0f37 | 2017-11-18 18:52:04 +0100 | [diff] [blame] | 4467 | try to keep 'lines' and 'columns' the same when adding and |
Bram Moolenaar | 8ac4415 | 2017-11-09 18:33:29 +0100 | [diff] [blame] | 4468 | removing GUI components. |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 4469 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4470 | *'guipty'* *'noguipty'* |
| 4471 | 'guipty' boolean (default on) |
| 4472 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4473 | {only available when compiled with GUI enabled} |
| 4474 | Only in the GUI: If on, an attempt is made to open a pseudo-tty for |
| 4475 | I/O to/from shell commands. See |gui-pty|. |
| 4476 | |
Bram Moolenaar | 5c8837f | 2006-02-25 21:52:33 +0000 | [diff] [blame] | 4477 | *'guitablabel'* *'gtl'* |
| 4478 | 'guitablabel' 'gtl' string (default empty) |
| 4479 | global |
Bram Moolenaar | 62a0cb4 | 2019-08-18 16:35:23 +0200 | [diff] [blame] | 4480 | {only available when compiled with GUI enabled} |
Bram Moolenaar | 944697a | 2022-02-20 19:48:20 +0000 | [diff] [blame] | 4481 | When non-empty describes the text to use in a label of the GUI tab |
Bram Moolenaar | d68071d | 2006-05-02 22:08:30 +0000 | [diff] [blame] | 4482 | pages line. When empty and when the result is empty Vim will use a |
| 4483 | default label. See |setting-guitablabel| for more info. |
Bram Moolenaar | 5c8837f | 2006-02-25 21:52:33 +0000 | [diff] [blame] | 4484 | |
Bram Moolenaar | a23ccb8 | 2006-02-27 00:08:02 +0000 | [diff] [blame] | 4485 | The format of this option is like that of 'statusline'. |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 4486 | 'guitabtooltip' is used for the tooltip, see below. |
Bram Moolenaar | 5162822 | 2016-12-01 23:03:28 +0100 | [diff] [blame] | 4487 | The expression will be evaluated in the |sandbox| when set from a |
| 4488 | modeline, see |sandbox-option|. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 4489 | This option cannot be set in a modeline when 'modelineexpr' is off. |
Bram Moolenaar | a23ccb8 | 2006-02-27 00:08:02 +0000 | [diff] [blame] | 4490 | |
Bram Moolenaar | 5c8837f | 2006-02-25 21:52:33 +0000 | [diff] [blame] | 4491 | Only used when the GUI tab pages line is displayed. 'e' must be |
| 4492 | present in 'guioptions'. For the non-GUI tab pages line 'tabline' is |
| 4493 | used. |
| 4494 | |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 4495 | *'guitabtooltip'* *'gtt'* |
| 4496 | 'guitabtooltip' 'gtt' string (default empty) |
| 4497 | global |
Bram Moolenaar | 62a0cb4 | 2019-08-18 16:35:23 +0200 | [diff] [blame] | 4498 | {only available when compiled with GUI enabled} |
Bram Moolenaar | 944697a | 2022-02-20 19:48:20 +0000 | [diff] [blame] | 4499 | When non-empty describes the text to use in a tooltip for the GUI tab |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 4500 | pages line. When empty Vim will use a default tooltip. |
| 4501 | This option is otherwise just like 'guitablabel' above. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 4502 | You can include a line break. Simplest method is to use |:let|: > |
| 4503 | :let &guitabtooltip = "line one\nline two" |
| 4504 | < |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 4505 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4506 | *'helpfile'* *'hf'* |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 4507 | 'helpfile' 'hf' string (default (MS-Windows) "$VIMRUNTIME\doc\help.txt" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4508 | (others) "$VIMRUNTIME/doc/help.txt") |
| 4509 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4510 | Name of the main help file. All distributed help files should be |
| 4511 | placed together in one directory. Additionally, all "doc" directories |
| 4512 | in 'runtimepath' will be used. |
| 4513 | Environment variables are expanded |:set_env|. For example: |
| 4514 | "$VIMRUNTIME/doc/help.txt". If $VIMRUNTIME is not set, $VIM is also |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 4515 | tried. Also see |$VIMRUNTIME| and |option-backslash| about including |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4516 | spaces and backslashes. |
| 4517 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 4518 | security reasons. |
| 4519 | |
| 4520 | *'helpheight'* *'hh'* |
| 4521 | 'helpheight' 'hh' number (default 20) |
| 4522 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4523 | Minimal initial height of the help window when it is opened with the |
| 4524 | ":help" command. The initial height of the help window is half of the |
| 4525 | current window, or (when the 'ea' option is on) the same as other |
| 4526 | windows. When the height is less than 'helpheight', the height is |
| 4527 | set to 'helpheight'. Set to zero to disable. |
| 4528 | |
| 4529 | *'helplang'* *'hlg'* |
| 4530 | 'helplang' 'hlg' string (default: messages language or empty) |
| 4531 | global |
| 4532 | {only available when compiled with the |+multi_lang| |
| 4533 | feature} |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 4534 | Comma-separated list of languages. Vim will use the first language |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4535 | for which the desired help can be found. The English help will always |
| 4536 | be used as a last resort. You can add "en" to prefer English over |
| 4537 | another language, but that will only find tags that exist in that |
| 4538 | language and not in the English help. |
| 4539 | Example: > |
| 4540 | :set helplang=de,it |
| 4541 | < This will first search German, then Italian and finally English help |
| 4542 | files. |
| 4543 | When using |CTRL-]| and ":help!" in a non-English help file Vim will |
| 4544 | try to find the tag in the current language before using this option. |
| 4545 | See |help-translated|. |
| 4546 | |
| 4547 | *'hidden'* *'hid'* *'nohidden'* *'nohid'* |
| 4548 | 'hidden' 'hid' boolean (default off) |
| 4549 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4550 | When off a buffer is unloaded when it is |abandon|ed. When on a |
| 4551 | buffer becomes hidden when it is |abandon|ed. If the buffer is still |
| 4552 | displayed in another window, it does not become hidden, of course. |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 4553 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4554 | The commands that move through the buffer list sometimes make a buffer |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 4555 | hidden even if the 'hidden' option is off when these three are true: |
| 4556 | - the buffer is modified |
| 4557 | - 'autowrite' is off or writing is not possible |
| 4558 | - the '!' flag was used |
| 4559 | Also see |windows.txt|. |
| 4560 | |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 4561 | To only make one buffer hidden use the 'bufhidden' option. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4562 | This option is set for one command with ":hide {command}" |:hide|. |
| 4563 | WARNING: It's easy to forget that you have changes in hidden buffers. |
| 4564 | Think twice when using ":q!" or ":qa!". |
| 4565 | |
| 4566 | *'highlight'* *'hl'* |
| 4567 | 'highlight' 'hl' string (default (as a single string): |
Bram Moolenaar | 58b8534 | 2016-08-14 19:54:54 +0200 | [diff] [blame] | 4568 | "8:SpecialKey,~:EndOfBuffer,@:NonText, |
| 4569 | d:Directory,e:ErrorMsg,i:IncSearch, |
| 4570 | l:Search,m:MoreMsg,M:ModeMsg,n:LineNr, |
Bram Moolenaar | efae76a | 2019-10-27 22:54:58 +0100 | [diff] [blame] | 4571 | a:LineNrAbove,b:LineNrBelow, |
Bram Moolenaar | 58b8534 | 2016-08-14 19:54:54 +0200 | [diff] [blame] | 4572 | N:CursorLineNr,r:Question,s:StatusLine, |
| 4573 | S:StatusLineNC,c:VertSplit,t:Title, |
Bram Moolenaar | 9d87a37 | 2018-12-18 21:41:50 +0100 | [diff] [blame] | 4574 | v:Visual,V:VisualNOS,w:WarningMsg, |
| 4575 | W:WildMenu,f:Folded,F:FoldColumn, |
| 4576 | A:DiffAdd,C:DiffChange,D:DiffDelete, |
Yee Cheng Chin | 9943d47 | 2025-03-26 19:41:02 +0100 | [diff] [blame] | 4577 | T:DiffText,E:DiffTextAdd,>:SignColumn, |
| 4578 | -:Conceal,B:SpellBad,P:SpellCap, |
| 4579 | R:SpellRare, L:SpellLocal,+:Pmenu, |
| 4580 | =:PmenuSel, k:PmenuMatch,<:PmenuMatchSel, |
Gianmaria Bajo | 6a7c774 | 2023-03-10 16:35:53 +0000 | [diff] [blame] | 4581 | [:PmenuKind,]:PmenuKindSel, |
| 4582 | {:PmenuExtra,}:PmenuExtraSel, |
Bram Moolenaar | 2102035 | 2017-06-13 17:21:04 +0200 | [diff] [blame] | 4583 | x:PmenuSbar,X:PmenuThumb,*:TabLine, |
| 4584 | #:TabLineSel,_:TabLineFill,!:CursorColumn, |
Bram Moolenaar | f55e4c8 | 2017-08-01 20:44:53 +0200 | [diff] [blame] | 4585 | .:CursorLine,o:ColorColumn,q:QuickFixLine, |
Christian Brabandt | fb74575 | 2024-05-07 21:19:03 +0200 | [diff] [blame] | 4586 | z:StatusLineTerm,Z:StatusLineTermNC, |
glepnir | ad40987 | 2025-01-10 20:08:20 +0100 | [diff] [blame] | 4587 | g:MsgArea,h:ComplMatchIns") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4588 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4589 | This option can be used to set highlighting mode for various |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 4590 | occasions. It is a comma-separated list of character pairs. The |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4591 | first character in a pair gives the occasion, the second the mode to |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 4592 | use for that occasion. The occasions are: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4593 | |hl-SpecialKey| 8 Meta and special keys listed with ":map" |
Bram Moolenaar | 58b8534 | 2016-08-14 19:54:54 +0200 | [diff] [blame] | 4594 | |hl-EndOfBuffer| ~ lines after the last line in the buffer |
| 4595 | |hl-NonText| @ '@' at the end of the window and |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4596 | characters from 'showbreak' |
| 4597 | |hl-Directory| d directories in CTRL-D listing and other special |
| 4598 | things in listings |
| 4599 | |hl-ErrorMsg| e error messages |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4600 | |hl-IncSearch| i 'incsearch' highlighting |
LemonBoy | a439938 | 2022-04-09 21:04:08 +0100 | [diff] [blame] | 4601 | |hl-CurSearch| y current instance of last search pattern |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4602 | |hl-Search| l last search pattern highlighting (see 'hlsearch') |
| 4603 | |hl-MoreMsg| m |more-prompt| |
| 4604 | |hl-ModeMsg| M Mode (e.g., "-- INSERT --") |
Christian Brabandt | fb74575 | 2024-05-07 21:19:03 +0200 | [diff] [blame] | 4605 | |hl-MsgArea| g |Command-line| and message area |
glepnir | ad40987 | 2025-01-10 20:08:20 +0100 | [diff] [blame] | 4606 | |hl-ComplMatchIns| h matched text of currently inserted completion |
Bram Moolenaar | 6448667 | 2010-05-16 15:46:46 +0200 | [diff] [blame] | 4607 | |hl-LineNr| n line number for ":number" and ":#" commands, and |
| 4608 | when 'number' or 'relativenumber' option is set. |
Bram Moolenaar | efae76a | 2019-10-27 22:54:58 +0100 | [diff] [blame] | 4609 | |hl-LineNrAbove| a line number above the cursor for when the |
| 4610 | 'relativenumber' option is set. |
| 4611 | |hl-LineNrBelow| b line number below the cursor for when the |
| 4612 | 'relativenumber' option is set. |
Bram Moolenaar | a3e6bc9 | 2013-01-30 14:18:00 +0100 | [diff] [blame] | 4613 | |hl-CursorLineNr| N like n for when 'cursorline' or 'relativenumber' is |
| 4614 | set. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4615 | |hl-Question| r |hit-enter| prompt and yes/no questions |
| 4616 | |hl-StatusLine| s status line of current window |status-line| |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 4617 | |hl-StatusLineNC| S status lines of not-current windows |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4618 | |hl-Title| t Titles for output from ":set all", ":autocmd" etc. |
| 4619 | |hl-VertSplit| c column used to separate vertically split windows |
| 4620 | |hl-Visual| v Visual mode |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 4621 | |hl-VisualNOS| V Visual mode when Vim is "Not Owning the |
| 4622 | Selection" Only X11 Gui's |gui-x11|, |
| 4623 | |xterm-clipboard| and |wayland-selections| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4624 | |hl-WarningMsg| w warning messages |
| 4625 | |hl-WildMenu| W wildcard matches displayed for 'wildmenu' |
| 4626 | |hl-Folded| f line used for closed folds |
| 4627 | |hl-FoldColumn| F 'foldcolumn' |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 4628 | |hl-DiffAdd| A added line in diff mode |
| 4629 | |hl-DiffChange| C changed line in diff mode |
| 4630 | |hl-DiffDelete| D deleted line in diff mode |
Yee Cheng Chin | 9943d47 | 2025-03-26 19:41:02 +0100 | [diff] [blame] | 4631 | |hl-DiffText| T changed text in diff mode |
| 4632 | |hl-DiffTextAdd| E inserted text in diff mode |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4633 | |hl-SignColumn| > column used for |signs| |
Bram Moolenaar | 9d87a37 | 2018-12-18 21:41:50 +0100 | [diff] [blame] | 4634 | |hl-Conceal| - the placeholders used for concealed characters |
| 4635 | (see 'conceallevel') |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 4636 | |hl-SpellBad| B misspelled word |spell| |
Bram Moolenaar | 9855d6b | 2010-07-18 14:34:51 +0200 | [diff] [blame] | 4637 | |hl-SpellCap| P word that should start with capital |spell| |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 4638 | |hl-SpellRare| R rare word |spell| |
| 4639 | |hl-SpellLocal| L word from other region |spell| |
Bram Moolenaar | 9d87a37 | 2018-12-18 21:41:50 +0100 | [diff] [blame] | 4640 | |hl-Pmenu| + popup menu normal line |
| 4641 | |hl-PmenuSel| = popup menu selected line |
Gianmaria Bajo | 6a7c774 | 2023-03-10 16:35:53 +0000 | [diff] [blame] | 4642 | |hl-PmenuKind| [ popup menu "kind" normal line |
| 4643 | |hl-PmenuKindSel| ] popup menu "kind" selected line |
h_east | 5985879 | 2023-10-25 22:47:05 +0900 | [diff] [blame] | 4644 | |hl-PmenuExtra| { popup menu "extra" normal line |
| 4645 | |hl-PmenuExtraSel| } popup menu "extra" selected line |
Bram Moolenaar | 9d87a37 | 2018-12-18 21:41:50 +0100 | [diff] [blame] | 4646 | |hl-PmenuSbar| x popup menu scrollbar |
| 4647 | |hl-PmenuThumb| X popup menu scrollbar thumb |
glepnir | 40c1c33 | 2024-06-11 19:37:04 +0200 | [diff] [blame] | 4648 | |hl-PmenuMatch| k popup menu matched text |
| 4649 | |hl-PmenuMatchSel| < popup menu matched text in selected line |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4650 | |
| 4651 | The display modes are: |
| 4652 | r reverse (termcap entry "mr" and "me") |
| 4653 | i italic (termcap entry "ZH" and "ZR") |
| 4654 | b bold (termcap entry "md" and "me") |
| 4655 | s standout (termcap entry "so" and "se") |
| 4656 | u underline (termcap entry "us" and "ue") |
Bram Moolenaar | 84f5463 | 2022-06-29 18:39:11 +0100 | [diff] [blame] | 4657 | c undercurl (termcap entry "Us" and "Ce") |
| 4658 | 2 double underline (termcap entry "Ds" and "Ce") |
| 4659 | d dotted underline (termcap entry "ds" and "Ce") |
| 4660 | = dashed underline (termcap entry "Ds" and "Ce") |
Bram Moolenaar | cf4b00c | 2017-09-02 18:33:56 +0200 | [diff] [blame] | 4661 | t strikethrough (termcap entry "Ts" and "Te") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4662 | n no highlighting |
| 4663 | - no highlighting |
| 4664 | : use a highlight group |
| 4665 | The default is used for occasions that are not included. |
| 4666 | If you want to change what the display modes do, see |dos-colors| |
| 4667 | for an example. |
| 4668 | When using the ':' display mode, this must be followed by the name of |
| 4669 | a highlight group. A highlight group can be used to define any type |
| 4670 | of highlighting, including using color. See |:highlight| on how to |
| 4671 | define one. The default uses a different group for each occasion. |
| 4672 | See |highlight-default| for the default highlight groups. |
| 4673 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4674 | *'history'* *'hi'* |
Luca Saccarola | c0d30ef | 2024-11-28 22:27:28 +0100 | [diff] [blame] | 4675 | 'history' 'hi' number (Vim default: 200, Vi default: 0) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4676 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4677 | A history of ":" commands, and a history of previous search patterns |
Bram Moolenaar | 78159bb | 2014-06-25 11:48:54 +0200 | [diff] [blame] | 4678 | is remembered. This option decides how many entries may be stored in |
Christian Brabandt | 51d4d84 | 2024-12-06 17:26:25 +0100 | [diff] [blame] | 4679 | each of these histories (see |cmdline-editing| and 'messagesopt' for |
Shougo Matsushita | 4bd9b2b | 2024-11-14 22:31:48 +0100 | [diff] [blame] | 4680 | the number of messages to remember). |
Bram Moolenaar | 78159bb | 2014-06-25 11:48:54 +0200 | [diff] [blame] | 4681 | The maximum value is 10000. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4682 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 4683 | set and to the Vim default value when 'compatible' is reset. |
| 4684 | |
| 4685 | *'hkmap'* *'hk'* *'nohkmap'* *'nohk'* |
| 4686 | 'hkmap' 'hk' boolean (default off) |
| 4687 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4688 | {only available when compiled with the |+rightleft| |
| 4689 | feature} |
| 4690 | When on, the keyboard is mapped for the Hebrew character set. |
| 4691 | Normally you would set 'allowrevins' and use CTRL-_ in insert mode to |
| 4692 | toggle this option. See |rileft.txt|. |
| 4693 | NOTE: This option is reset when 'compatible' is set. |
| 4694 | |
| 4695 | *'hkmapp'* *'hkp'* *'nohkmapp'* *'nohkp'* |
| 4696 | 'hkmapp' 'hkp' boolean (default off) |
| 4697 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4698 | {only available when compiled with the |+rightleft| |
| 4699 | feature} |
| 4700 | When on, phonetic keyboard mapping is used. 'hkmap' must also be on. |
| 4701 | This is useful if you have a non-Hebrew keyboard. |
| 4702 | See |rileft.txt|. |
| 4703 | NOTE: This option is reset when 'compatible' is set. |
| 4704 | |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 4705 | *'hlsearch'* *'hls'* *'nohlsearch'* *'nohls'* |
| 4706 | 'hlsearch' 'hls' boolean (default off) |
| 4707 | global |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 4708 | {not available when compiled without the |
| 4709 | |+extra_search| feature} |
| 4710 | When there is a previous search pattern, highlight all its matches. |
| 4711 | The type of highlighting used can be set with the 'l' occasion in the |
| 4712 | 'highlight' option. This uses the "Search" highlight group by |
| 4713 | default. Note that only the matching text is highlighted, any offsets |
Bram Moolenaar | cfa8f9a | 2022-06-03 21:59:47 +0100 | [diff] [blame] | 4714 | are not applied. If the "CurSearch" highlight group is set then the |
| 4715 | current match is highlighted with that. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 4716 | See also: 'incsearch' and |:match|. |
| 4717 | When you get bored looking at the highlighted matches, you can turn it |
| 4718 | off with |:nohlsearch|. This does not change the option value, as |
| 4719 | soon as you use a search command, the highlighting comes back. |
| 4720 | 'redrawtime' specifies the maximum time spent on finding matches. |
| 4721 | When the search pattern can match an end-of-line, Vim will try to |
| 4722 | highlight all of the matched text. However, this depends on where the |
| 4723 | search starts. This will be the first line in the window or the first |
| 4724 | line below a closed fold. A match in a previous line which is not |
| 4725 | drawn may not continue in a newly drawn line. |
| 4726 | You can specify whether the highlight status is restored on startup |
| 4727 | with the 'h' flag in 'viminfo' |viminfo-h|. |
| 4728 | NOTE: This option is reset when 'compatible' is set. |
| 4729 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4730 | *'icon'* *'noicon'* |
| 4731 | 'icon' boolean (default off, on when title can be restored) |
| 4732 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4733 | When on, the icon text of the window will be set to the value of |
| 4734 | 'iconstring' (if it is not empty), or to the name of the file |
| 4735 | currently being edited. Only the last part of the name is used. |
| 4736 | Overridden by the 'iconstring' option. |
| 4737 | Only works if the terminal supports setting window icons (currently |
| 4738 | only X11 GUI and terminals with a non-empty 't_IS' option - these are |
| 4739 | Unix xterm and iris-ansi by default, where 't_IS' is taken from the |
| 4740 | builtin termcap). |
| 4741 | When Vim was compiled with HAVE_X11 defined, the original icon will be |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 4742 | restored if possible |X11|. See |X11-icon| for changing the icon on |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4743 | X11. |
Bram Moolenaar | 3a991dd | 2014-10-02 01:41:41 +0200 | [diff] [blame] | 4744 | For MS-Windows the icon can be changed, see |windows-icon|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4745 | |
| 4746 | *'iconstring'* |
| 4747 | 'iconstring' string (default "") |
| 4748 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4749 | When this option is not empty, it will be used for the icon text of |
| 4750 | the window. This happens only when the 'icon' option is on. |
| 4751 | Only works if the terminal supports setting window icon text |
| 4752 | (currently only X11 GUI and terminals with a non-empty 't_IS' option). |
Bram Moolenaar | 130cbfc | 2021-04-07 21:07:20 +0200 | [diff] [blame] | 4753 | Does not work for MS-Windows. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4754 | When Vim was compiled with HAVE_X11 defined, the original icon will be |
| 4755 | restored if possible |X11|. |
| 4756 | When this option contains printf-style '%' items, they will be |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 4757 | expanded according to the rules used for 'statusline'. See |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4758 | 'titlestring' for example settings. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 4759 | This option cannot be set in a modeline when 'modelineexpr' is off. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4760 | {not available when compiled without the |+statusline| feature} |
| 4761 | |
| 4762 | *'ignorecase'* *'ic'* *'noignorecase'* *'noic'* |
| 4763 | 'ignorecase' 'ic' boolean (default off) |
| 4764 | global |
Yee Cheng Chin | 2bbd0d3 | 2023-10-14 02:23:45 -0700 | [diff] [blame] | 4765 | Ignore case in search patterns, |cmdline-completion|, when |
glepnir | 0546068 | 2025-05-26 18:23:27 +0200 | [diff] [blame] | 4766 | searching in the tags file, non-|Vim9| |expr-==| and for Insert-mode |
| 4767 | completion |ins-completion|. |
Bram Moolenaar | 0f6562e | 2015-11-24 18:48:14 +0100 | [diff] [blame] | 4768 | Also see 'smartcase' and 'tagcase'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4769 | Can be overruled by using "\c" or "\C" in the pattern, see |
| 4770 | |/ignorecase|. |
| 4771 | |
Bram Moolenaar | abab85a | 2013-06-26 19:18:05 +0200 | [diff] [blame] | 4772 | *'imactivatefunc'* *'imaf'* |
| 4773 | 'imactivatefunc' 'imaf' string (default "") |
| 4774 | global |
Bram Moolenaar | abab85a | 2013-06-26 19:18:05 +0200 | [diff] [blame] | 4775 | This option specifies a function that will be called to |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 4776 | activate or deactivate the Input Method. The value can be the name of |
| 4777 | a function, a |lambda| or a |Funcref|. See |option-value-function| for |
| 4778 | more information. |
Bram Moolenaar | ef8c617 | 2020-07-01 15:12:44 +0200 | [diff] [blame] | 4779 | It is not used in the MS-Windows GUI version. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 4780 | The expression will be evaluated in the |sandbox| when set from a |
| 4781 | modeline, see |sandbox-option|. |
Bram Moolenaar | abab85a | 2013-06-26 19:18:05 +0200 | [diff] [blame] | 4782 | |
| 4783 | Example: > |
| 4784 | function ImActivateFunc(active) |
| 4785 | if a:active |
| 4786 | ... do something |
| 4787 | else |
| 4788 | ... do something |
| 4789 | endif |
| 4790 | " return value is not used |
| 4791 | endfunction |
| 4792 | set imactivatefunc=ImActivateFunc |
| 4793 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4794 | *'imactivatekey'* *'imak'* |
| 4795 | 'imactivatekey' 'imak' string (default "") |
| 4796 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4797 | {only available when compiled with |+xim| and |
Bram Moolenaar | 67c5384 | 2010-05-22 18:28:27 +0200 | [diff] [blame] | 4798 | |+GUI_GTK|} *E599* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4799 | Specifies the key that your Input Method in X-Windows uses for |
| 4800 | activation. When this is specified correctly, vim can fully control |
| 4801 | IM with 'imcmdline', 'iminsert' and 'imsearch'. |
| 4802 | You can't use this option to change the activation key, the option |
| 4803 | tells Vim what the key is. |
| 4804 | Format: |
| 4805 | [MODIFIER_FLAG-]KEY_STRING |
| 4806 | |
| 4807 | These characters can be used for MODIFIER_FLAG (case is ignored): |
| 4808 | S Shift key |
| 4809 | L Lock key |
| 4810 | C Control key |
| 4811 | 1 Mod1 key |
| 4812 | 2 Mod2 key |
| 4813 | 3 Mod3 key |
| 4814 | 4 Mod4 key |
| 4815 | 5 Mod5 key |
| 4816 | Combinations are allowed, for example "S-C-space" or "SC-space" are |
| 4817 | both shift+ctrl+space. |
| 4818 | See <X11/keysymdef.h> and XStringToKeysym for KEY_STRING. |
| 4819 | |
| 4820 | Example: > |
| 4821 | :set imactivatekey=S-space |
| 4822 | < "S-space" means shift+space. This is the activation key for kinput2 + |
| 4823 | canna (Japanese), and ami (Korean). |
| 4824 | |
| 4825 | *'imcmdline'* *'imc'* *'noimcmdline'* *'noimc'* |
| 4826 | 'imcmdline' 'imc' boolean (default off) |
| 4827 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4828 | When set the Input Method is always on when starting to edit a command |
| 4829 | line, unless entering a search pattern (see 'imsearch' for that). |
| 4830 | Setting this option is useful when your input method allows entering |
| 4831 | English characters directly, e.g., when it's used to type accented |
| 4832 | characters with dead keys. |
| 4833 | |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 4834 | *'imdisable'* *'imd'* *'noimdisable'* *'noimd'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4835 | 'imdisable' 'imd' boolean (default off, on for some systems (SGI)) |
| 4836 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4837 | When set the Input Method is never used. This is useful to disable |
| 4838 | the IM when it doesn't work properly. |
| 4839 | Currently this option is on by default for SGI/IRIX machines. This |
| 4840 | may change in later releases. |
| 4841 | |
| 4842 | *'iminsert'* *'imi'* |
Bram Moolenaar | 4cf56bb | 2017-09-16 15:50:32 +0200 | [diff] [blame] | 4843 | 'iminsert' 'imi' number (default 0) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4844 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4845 | Specifies whether :lmap or an Input Method (IM) is to be used in |
| 4846 | Insert mode. Valid values: |
| 4847 | 0 :lmap is off and IM is off |
| 4848 | 1 :lmap is ON and IM is off |
| 4849 | 2 :lmap is off and IM is ON |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4850 | To always reset the option to zero when leaving Insert mode with <Esc> |
| 4851 | this can be used: > |
| 4852 | :inoremap <ESC> <ESC>:set iminsert=0<CR> |
| 4853 | < This makes :lmap and IM turn off automatically when leaving Insert |
| 4854 | mode. |
| 4855 | Note that this option changes when using CTRL-^ in Insert mode |
| 4856 | |i_CTRL-^|. |
| 4857 | The value is set to 1 when setting 'keymap' to a valid keymap name. |
| 4858 | It is also used for the argument of commands like "r" and "f". |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 4859 | The value 0 may not work correctly with Motif with some XIM |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4860 | methods. Use 'imdisable' to disable XIM then. |
| 4861 | |
Bram Moolenaar | 6315a9a | 2017-11-25 15:20:02 +0100 | [diff] [blame] | 4862 | You can set 'imactivatefunc' and 'imstatusfunc' to handle IME/XIM |
Bram Moolenaar | d473c8c | 2018-08-11 18:00:22 +0200 | [diff] [blame] | 4863 | via external command if Vim is not compiled with the |+xim|, |
Bram Moolenaar | 6315a9a | 2017-11-25 15:20:02 +0100 | [diff] [blame] | 4864 | |+multi_byte_ime| or |global-ime|. |
| 4865 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4866 | *'imsearch'* *'ims'* |
Bram Moolenaar | 4cf56bb | 2017-09-16 15:50:32 +0200 | [diff] [blame] | 4867 | 'imsearch' 'ims' number (default -1) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4868 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4869 | Specifies whether :lmap or an Input Method (IM) is to be used when |
| 4870 | entering a search pattern. Valid values: |
| 4871 | -1 the value of 'iminsert' is used, makes it look like |
| 4872 | 'iminsert' is also used when typing a search pattern |
| 4873 | 0 :lmap is off and IM is off |
| 4874 | 1 :lmap is ON and IM is off |
| 4875 | 2 :lmap is off and IM is ON |
| 4876 | Note that this option changes when using CTRL-^ in Command-line mode |
| 4877 | |c_CTRL-^|. |
| 4878 | The value is set to 1 when it is not -1 and setting the 'keymap' |
| 4879 | option to a valid keymap name. |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 4880 | The value 0 may not work correctly with Motif with some XIM |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4881 | methods. Use 'imdisable' to disable XIM then. |
| 4882 | |
Bram Moolenaar | abab85a | 2013-06-26 19:18:05 +0200 | [diff] [blame] | 4883 | *'imstatusfunc'* *'imsf'* |
| 4884 | 'imstatusfunc' 'imsf' string (default "") |
| 4885 | global |
Bram Moolenaar | abab85a | 2013-06-26 19:18:05 +0200 | [diff] [blame] | 4886 | This option specifies a function that is called to obtain the status |
| 4887 | of Input Method. It must return a positive number when IME is active. |
Yegappan Lakshmanan | 7645da5 | 2021-12-04 14:02:30 +0000 | [diff] [blame] | 4888 | The value can be the name of a function, a |lambda| or a |Funcref|. |
| 4889 | See |option-value-function| for more information. |
Bram Moolenaar | ef8c617 | 2020-07-01 15:12:44 +0200 | [diff] [blame] | 4890 | It is not used in the MS-Windows GUI version. |
Bram Moolenaar | abab85a | 2013-06-26 19:18:05 +0200 | [diff] [blame] | 4891 | |
| 4892 | Example: > |
| 4893 | function ImStatusFunc() |
| 4894 | let is_active = ...do something |
| 4895 | return is_active ? 1 : 0 |
| 4896 | endfunction |
| 4897 | set imstatusfunc=ImStatusFunc |
| 4898 | < |
| 4899 | NOTE: This function is invoked very often. Keep it fast. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 4900 | The expression will be evaluated in the |sandbox| when set from a |
| 4901 | modeline, see |sandbox-option|. |
Bram Moolenaar | abab85a | 2013-06-26 19:18:05 +0200 | [diff] [blame] | 4902 | |
Bram Moolenaar | 5c6dbcb | 2017-08-30 22:00:20 +0200 | [diff] [blame] | 4903 | *'imstyle'* *'imst'* |
| 4904 | 'imstyle' 'imst' number (default 1) |
| 4905 | global |
Bram Moolenaar | 5c6dbcb | 2017-08-30 22:00:20 +0200 | [diff] [blame] | 4906 | {only available when compiled with |+xim| and |
| 4907 | |+GUI_GTK|} |
Bram Moolenaar | 37c64c7 | 2017-09-19 22:06:03 +0200 | [diff] [blame] | 4908 | This option specifies the input style of Input Method: |
| 4909 | 0 use on-the-spot style |
| 4910 | 1 over-the-spot style |
Bram Moolenaar | 5c6dbcb | 2017-08-30 22:00:20 +0200 | [diff] [blame] | 4911 | See: |xim-input-style| |
| 4912 | |
Bram Moolenaar | 24a98a0 | 2017-09-27 22:23:55 +0200 | [diff] [blame] | 4913 | For a long time on-the-spot style had been used in the GTK version of |
| 4914 | vim, however, it is known that it causes troubles when using mappings, |
Bram Moolenaar | 5c6dbcb | 2017-08-30 22:00:20 +0200 | [diff] [blame] | 4915 | |single-repeat|, etc. Therefore over-the-spot style becomes the |
| 4916 | default now. This should work fine for most people, however if you |
| 4917 | have any problem with it, try using on-the-spot style. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 4918 | The expression will be evaluated in the |sandbox| when set from a |
| 4919 | modeline, see |sandbox-option|. |
Bram Moolenaar | 5c6dbcb | 2017-08-30 22:00:20 +0200 | [diff] [blame] | 4920 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4921 | *'include'* *'inc'* |
| 4922 | 'include' 'inc' string (default "^\s*#\s*include") |
| 4923 | global or local to buffer |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4924 | {not available when compiled without the |
| 4925 | |+find_in_path| feature} |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 4926 | Pattern to be used to find an include command. It is a search |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4927 | pattern, just like for the "/" command (See |pattern|). The default |
| 4928 | value is for C programs. This option is used for the commands "[i", |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 4929 | "]I", "[d", etc. |
| 4930 | Normally the 'isfname' option is used to recognize the file name that |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 4931 | comes after the matched pattern. But if "\zs" appears in the pattern |
| 4932 | then the text matched from "\zs" to the end, or until "\ze" if it |
| 4933 | appears, is used as the file name. Use this to include characters |
| 4934 | that are not in 'isfname', such as a space. You can then use |
| 4935 | 'includeexpr' to process the matched text. |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 4936 | See |option-backslash| about including spaces and backslashes. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4937 | |
| 4938 | *'includeexpr'* *'inex'* |
| 4939 | 'includeexpr' 'inex' string (default "") |
| 4940 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4941 | {not available when compiled without the |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 4942 | |+find_in_path| or |+eval| features} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4943 | Expression to be used to transform the string found with the 'include' |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 4944 | option to a file name. Mostly useful to change "." to "/" for Java: > |
Bram Moolenaar | b59ae59 | 2022-11-23 23:46:31 +0000 | [diff] [blame] | 4945 | :setlocal includeexpr=substitute(v:fname,'\\.','/','g') |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4946 | < The "v:fname" variable will be set to the file name that was detected. |
Bram Moolenaar | b59ae59 | 2022-11-23 23:46:31 +0000 | [diff] [blame] | 4947 | Note the double backslash: the `:set` command first halves them, then |
| 4948 | one remains it the value, where "\." matches a dot literally. For |
| 4949 | simple character replacements `tr()` avoids the need for escaping: > |
| 4950 | :setlocal includeexpr=tr(v:fname,'.','/') |
| 4951 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4952 | Also used for the |gf| command if an unmodified file name can't be |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 4953 | found. Allows doing "gf" on the name after an 'include' statement. |
Christian Brabandt | 2398460 | 2025-04-19 11:54:08 +0200 | [diff] [blame] | 4954 | Note: Not used for |<cfile>|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4955 | |
Yegappan Lakshmanan | 8bb65f2 | 2021-12-26 10:51:39 +0000 | [diff] [blame] | 4956 | If the expression starts with s: or |<SID>|, then it is replaced with |
| 4957 | the script ID (|local-function|). Example: > |
Bram Moolenaar | b59ae59 | 2022-11-23 23:46:31 +0000 | [diff] [blame] | 4958 | setlocal includeexpr=s:MyIncludeExpr() |
| 4959 | setlocal includeexpr=<SID>SomeIncludeExpr() |
Bram Moolenaar | 6f4754b | 2022-01-23 12:07:04 +0000 | [diff] [blame] | 4960 | < Otherwise, the expression is evaluated in the context of the script |
| 4961 | where the option was set, thus script-local items are available. |
| 4962 | |
Bram Moolenaar | a4e0b97 | 2022-10-01 19:43:52 +0100 | [diff] [blame] | 4963 | It is more efficient if the value is just a function call without |
| 4964 | arguments, see |expr-option-function|. |
| 4965 | |
Bram Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 4966 | The expression will be evaluated in the |sandbox| when set from a |
| 4967 | modeline, see |sandbox-option|. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 4968 | This option cannot be set in a modeline when 'modelineexpr' is off. |
Bram Moolenaar | b71eaae | 2006-01-20 23:10:18 +0000 | [diff] [blame] | 4969 | |
| 4970 | It is not allowed to change text or jump to another window while |
| 4971 | evaluating 'includeexpr' |textlock|. |
| 4972 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4973 | *'incsearch'* *'is'* *'noincsearch'* *'nois'* |
Bram Moolenaar | 8c08b5b | 2016-07-28 22:24:15 +0200 | [diff] [blame] | 4974 | 'incsearch' 'is' boolean (default off, set in |defaults.vim| if the |
Bram Moolenaar | 8a3b805 | 2022-06-26 12:21:15 +0100 | [diff] [blame] | 4975 | |+reltime| feature is supported) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4976 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4977 | {not available when compiled without the |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 4978 | |+extra_search| features} |
Bram Moolenaar | 21cf823 | 2004-07-16 20:18:37 +0000 | [diff] [blame] | 4979 | While typing a search command, show where the pattern, as it was typed |
| 4980 | so far, matches. The matched string is highlighted. If the pattern |
| 4981 | is invalid or not found, nothing is shown. The screen will be updated |
| 4982 | often, this is only useful on fast terminals. |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 4983 | Also applies to the pattern in commands: > |
| 4984 | :global |
| 4985 | :lvimgrep |
| 4986 | :lvimgrepadd |
| 4987 | :smagic |
| 4988 | :snomagic |
| 4989 | :sort |
| 4990 | :substitute |
| 4991 | :vglobal |
| 4992 | :vimgrep |
| 4993 | :vimgrepadd |
| 4994 | < Note that the match will be shown, but the cursor will return to its |
Bram Moolenaar | 21cf823 | 2004-07-16 20:18:37 +0000 | [diff] [blame] | 4995 | original position when no match is found and when pressing <Esc>. You |
| 4996 | still need to finish the search command with <Enter> to move the |
| 4997 | cursor to the match. |
Bram Moolenaar | dc08328 | 2016-10-11 08:57:33 +0200 | [diff] [blame] | 4998 | You can use the CTRL-G and CTRL-T keys to move to the next and |
| 4999 | previous match. |c_CTRL-G| |c_CTRL-T| |
Bram Moolenaar | 91a4e82 | 2008-01-19 14:59:58 +0000 | [diff] [blame] | 5000 | When compiled with the |+reltime| feature Vim only searches for about |
| 5001 | half a second. With a complicated pattern and/or a lot of text the |
| 5002 | match may not be found. This is to avoid that Vim hangs while you |
| 5003 | are typing the pattern. |
Bram Moolenaar | 21cf823 | 2004-07-16 20:18:37 +0000 | [diff] [blame] | 5004 | The highlighting can be set with the 'i' flag in 'highlight'. |
Bram Moolenaar | 2f05849 | 2017-11-30 20:27:52 +0100 | [diff] [blame] | 5005 | When 'hlsearch' is on, all matched strings are highlighted too while |
| 5006 | typing a search command. See also: 'hlsearch'. |
Bram Moolenaar | d473c8c | 2018-08-11 18:00:22 +0200 | [diff] [blame] | 5007 | If you don't want to turn 'hlsearch' on, but want to highlight all |
| 5008 | matches while searching, you can turn on and off 'hlsearch' with |
| 5009 | autocmd. Example: > |
Bram Moolenaar | 2e51d9a | 2017-10-29 16:40:30 +0100 | [diff] [blame] | 5010 | augroup vimrc-incsearch-highlight |
| 5011 | autocmd! |
Bram Moolenaar | f8f8b2e | 2017-11-02 19:08:48 +0100 | [diff] [blame] | 5012 | autocmd CmdlineEnter /,\? :set hlsearch |
| 5013 | autocmd CmdlineLeave /,\? :set nohlsearch |
Bram Moolenaar | 2e51d9a | 2017-10-29 16:40:30 +0100 | [diff] [blame] | 5014 | augroup END |
| 5015 | < |
Bram Moolenaar | efd2bf1 | 2006-03-16 21:41:35 +0000 | [diff] [blame] | 5016 | CTRL-L can be used to add one character from after the current match |
Bram Moolenaar | a9dc375 | 2010-07-11 20:46:53 +0200 | [diff] [blame] | 5017 | to the command line. If 'ignorecase' and 'smartcase' are set and the |
| 5018 | command line has no uppercase characters, the added character is |
| 5019 | converted to lowercase. |
Bram Moolenaar | efd2bf1 | 2006-03-16 21:41:35 +0000 | [diff] [blame] | 5020 | CTRL-R CTRL-W can be used to add the word at the end of the current |
| 5021 | match, excluding the characters that were already typed. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5022 | NOTE: This option is reset when 'compatible' is set. |
| 5023 | |
| 5024 | *'indentexpr'* *'inde'* |
| 5025 | 'indentexpr' 'inde' string (default "") |
| 5026 | local to buffer |
Bram Moolenaar | 8e145b8 | 2022-05-21 20:17:31 +0100 | [diff] [blame] | 5027 | {not available when compiled without the |+eval| |
| 5028 | feature} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5029 | Expression which is evaluated to obtain the proper indent for a line. |
| 5030 | It is used when a new line is created, for the |=| operator and |
| 5031 | in Insert mode as specified with the 'indentkeys' option. |
| 5032 | When this option is not empty, it overrules the 'cindent' and |
Bram Moolenaar | 20f90cf | 2011-05-19 12:22:51 +0200 | [diff] [blame] | 5033 | 'smartindent' indenting. When 'lisp' is set, this option is |
Dominique Pellé | df62c62 | 2024-07-15 20:29:59 +0200 | [diff] [blame] | 5034 | only used when 'lispoptions' contains "expr:1". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5035 | When 'paste' is set this option is not used for indenting. |
| 5036 | The expression is evaluated with |v:lnum| set to the line number for |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 5037 | which the indent is to be computed. The cursor is also in this line |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5038 | when the expression is evaluated (but it may be moved around). |
Bram Moolenaar | 6f4754b | 2022-01-23 12:07:04 +0000 | [diff] [blame] | 5039 | |
Yegappan Lakshmanan | 8bb65f2 | 2021-12-26 10:51:39 +0000 | [diff] [blame] | 5040 | If the expression starts with s: or |<SID>|, then it is replaced with |
| 5041 | the script ID (|local-function|). Example: > |
| 5042 | set indentexpr=s:MyIndentExpr() |
| 5043 | set indentexpr=<SID>SomeIndentExpr() |
Bram Moolenaar | 6f4754b | 2022-01-23 12:07:04 +0000 | [diff] [blame] | 5044 | < Otherwise, the expression is evaluated in the context of the script |
| 5045 | where the option was set, thus script-local items are available. |
| 5046 | |
Bram Moolenaar | a4e0b97 | 2022-10-01 19:43:52 +0100 | [diff] [blame] | 5047 | The advantage of using a function call without arguments is that it is |
| 5048 | faster, see |expr-option-function|. |
| 5049 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5050 | The expression must return the number of spaces worth of indent. It |
| 5051 | can return "-1" to keep the current indent (this means 'autoindent' is |
| 5052 | used for the indent). |
| 5053 | Functions useful for computing the indent are |indent()|, |cindent()| |
| 5054 | and |lispindent()|. |
| 5055 | The evaluation of the expression must not have side effects! It must |
| 5056 | not change the text, jump to another window, etc. Afterwards the |
| 5057 | cursor position is always restored, thus the cursor may be moved. |
| 5058 | Normally this option would be set to call a function: > |
| 5059 | :set indentexpr=GetMyIndent() |
| 5060 | < Error messages will be suppressed, unless the 'debug' option contains |
| 5061 | "msg". |
Bram Moolenaar | b71eaae | 2006-01-20 23:10:18 +0000 | [diff] [blame] | 5062 | See |indent-expression|. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 5063 | NOTE: This option is set to "" when 'compatible' is set. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5064 | |
Bram Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 5065 | The expression will be evaluated in the |sandbox| when set from a |
| 5066 | modeline, see |sandbox-option|. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 5067 | This option cannot be set in a modeline when 'modelineexpr' is off. |
Bram Moolenaar | b71eaae | 2006-01-20 23:10:18 +0000 | [diff] [blame] | 5068 | |
| 5069 | It is not allowed to change text or jump to another window while |
| 5070 | evaluating 'indentexpr' |textlock|. |
| 5071 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5072 | *'indentkeys'* *'indk'* |
Bram Moolenaar | ce65574 | 2019-01-31 14:12:57 +0100 | [diff] [blame] | 5073 | 'indentkeys' 'indk' string (default "0{,0},0),0],:,0#,!^F,o,O,e") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5074 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5075 | A list of keys that, when typed in Insert mode, cause reindenting of |
| 5076 | the current line. Only happens if 'indentexpr' isn't empty. |
| 5077 | The format is identical to 'cinkeys', see |indentkeys-format|. |
| 5078 | See |C-indenting| and |indent-expression|. |
| 5079 | |
| 5080 | *'infercase'* *'inf'* *'noinfercase'* *'noinf'* |
| 5081 | 'infercase' 'inf' boolean (default off) |
| 5082 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5083 | When doing keyword completion in insert mode |ins-completion|, and |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 5084 | 'ignorecase' is also on, the case of the match is adjusted depending |
| 5085 | on the typed text. If the typed text contains a lowercase letter |
| 5086 | where the match has an upper case letter, the completed part is made |
| 5087 | lowercase. If the typed text has no lowercase letters and the match |
| 5088 | has a lowercase letter where the typed text has an uppercase letter, |
| 5089 | and there is a letter before it, the completed part is made uppercase. |
| 5090 | With 'noinfercase' the match is used as-is. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5091 | |
glepnir | bcd5995 | 2025-04-24 21:48:35 +0200 | [diff] [blame] | 5092 | *'isexpand'* *'ise'* |
| 5093 | 'isexpand' 'ise' string (default: "") |
| 5094 | local to buffer |
Hirohito Higashi | fa8b7db | 2025-04-30 19:12:37 +0200 | [diff] [blame] | 5095 | Defines characters and patterns for completion in insert mode. Used |
| 5096 | by the |complete_match()| function to determine the starting position |
| 5097 | for completion. This is a comma-separated list of triggers. Each |
| 5098 | trigger can be: |
glepnir | bcd5995 | 2025-04-24 21:48:35 +0200 | [diff] [blame] | 5099 | - A single character like "." or "/" |
| 5100 | - A sequence of characters like "->", "/*", or "/**" |
| 5101 | |
| 5102 | Note: Use "\\," to add a literal comma as trigger character, see |
| 5103 | |option-backslash|. |
| 5104 | |
glepnir | ffc89e4 | 2025-04-27 14:59:17 +0200 | [diff] [blame] | 5105 | Examples: > |
| 5106 | set isexpand=.,->,/*,\\, |
| 5107 | < |
| 5108 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5109 | *'insertmode'* *'im'* *'noinsertmode'* *'noim'* |
| 5110 | 'insertmode' 'im' boolean (default off) |
| 5111 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5112 | Makes Vim work in a way that Insert mode is the default mode. Useful |
| 5113 | if you want to use Vim as a modeless editor. Used for |evim|. |
| 5114 | These Insert mode commands will be useful: |
| 5115 | - Use the cursor keys to move around. |
Bram Moolenaar | dc1f164 | 2016-08-16 18:33:43 +0200 | [diff] [blame] | 5116 | - Use CTRL-O to execute one Normal mode command |i_CTRL-O|. When |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5117 | this is a mapping, it is executed as if 'insertmode' was off. |
| 5118 | Normal mode remains active until the mapping is finished. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5119 | - Use CTRL-L to execute a number of Normal mode commands, then use |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 5120 | <Esc> to get back to Insert mode. Note that CTRL-L moves the cursor |
| 5121 | left, like <Esc> does when 'insertmode' isn't set. |i_CTRL-L| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5122 | |
| 5123 | These items change when 'insertmode' is set: |
| 5124 | - when starting to edit of a file, Vim goes to Insert mode. |
| 5125 | - <Esc> in Insert mode is a no-op and beeps. |
| 5126 | - <Esc> in Normal mode makes Vim go to Insert mode. |
| 5127 | - CTRL-L in Insert mode is a command, it is not inserted. |
| 5128 | - CTRL-Z in Insert mode suspends Vim, see |CTRL-Z|. *i_CTRL-Z* |
| 5129 | However, when <Esc> is used inside a mapping, it behaves like |
| 5130 | 'insertmode' was not set. This was done to be able to use the same |
| 5131 | mappings with 'insertmode' set or not set. |
| 5132 | When executing commands with |:normal| 'insertmode' is not used. |
| 5133 | |
| 5134 | NOTE: This option is reset when 'compatible' is set. |
| 5135 | |
| 5136 | *'isfname'* *'isf'* |
Bram Moolenaar | 6f345a1 | 2019-12-17 21:27:18 +0100 | [diff] [blame] | 5137 | 'isfname' 'isf' string (default for Win32: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5138 | "@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=" |
| 5139 | for AMIGA: "@,48-57,/,.,-,_,+,,,$,:" |
| 5140 | for VMS: "@,48-57,/,.,-,_,+,,,#,$,%,<,>,[,],:,;,~" |
| 5141 | for OS/390: "@,240-249,/,.,-,_,+,,,#,$,%,~,=" |
| 5142 | otherwise: "@,48-57,/,.,-,_,+,,,#,$,%,~,=") |
| 5143 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5144 | The characters specified by this option are included in file names and |
| 5145 | path names. Filenames are used for commands like "gf", "[i" and in |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 5146 | the tags file. It is also used for "\f" in a |pattern|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5147 | Multi-byte characters 256 and above are always included, only the |
| 5148 | characters up to 255 are specified with this option. |
| 5149 | For UTF-8 the characters 0xa0 to 0xff are included as well. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 5150 | Think twice before adding white space to this option. Although a |
| 5151 | space may appear inside a file name, the effect will be that Vim |
| 5152 | doesn't know where a file name starts or ends when doing completion. |
| 5153 | It most likely works better without a space in 'isfname'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5154 | |
| 5155 | Note that on systems using a backslash as path separator, Vim tries to |
| 5156 | do its best to make it work as you would expect. That is a bit |
| 5157 | tricky, since Vi originally used the backslash to escape special |
| 5158 | characters. Vim will not remove a backslash in front of a normal file |
| 5159 | name character on these systems, but it will on Unix and alikes. The |
| 5160 | '&' and '^' are not included by default, because these are special for |
| 5161 | cmd.exe. |
| 5162 | |
| 5163 | The format of this option is a list of parts, separated with commas. |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 5164 | Each part can be a single character number or a range. A range is two |
| 5165 | character numbers with '-' in between. A character number can be a |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5166 | decimal number between 0 and 255 or the ASCII character itself (does |
| 5167 | not work for digits). Example: |
| 5168 | "_,-,128-140,#-43" (include '_' and '-' and the range |
| 5169 | 128 to 140 and '#' to 43) |
| 5170 | If a part starts with '^', the following character number or range |
| 5171 | will be excluded from the option. The option is interpreted from left |
| 5172 | to right. Put the excluded character after the range where it is |
| 5173 | included. To include '^' itself use it as the last character of the |
| 5174 | option or the end of a range. Example: |
| 5175 | "^a-z,#,^" (exclude 'a' to 'z', include '#' and '^') |
| 5176 | If the character is '@', all characters where isalpha() returns TRUE |
| 5177 | are included. Normally these are the characters a to z and A to Z, |
| 5178 | plus accented characters. To include '@' itself use "@-@". Examples: |
| 5179 | "@,^a-z" All alphabetic characters, excluding lower |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 5180 | case ASCII letters. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5181 | "a-z,A-Z,@-@" All letters plus the '@' character. |
| 5182 | A comma can be included by using it where a character number is |
| 5183 | expected. Example: |
| 5184 | "48-57,,,_" Digits, comma and underscore. |
| 5185 | A comma can be excluded by prepending a '^'. Example: |
| 5186 | " -~,^,,9" All characters from space to '~', excluding |
| 5187 | comma, plus <Tab>. |
| 5188 | See |option-backslash| about including spaces and backslashes. |
| 5189 | |
| 5190 | *'isident'* *'isi'* |
Bram Moolenaar | 6f345a1 | 2019-12-17 21:27:18 +0100 | [diff] [blame] | 5191 | 'isident' 'isi' string (default for Win32: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5192 | "@,48-57,_,128-167,224-235" |
| 5193 | otherwise: "@,48-57,_,192-255") |
| 5194 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5195 | The characters given by this option are included in identifiers. |
| 5196 | Identifiers are used in recognizing environment variables and after a |
| 5197 | match of the 'define' option. It is also used for "\i" in a |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 5198 | |pattern|. See 'isfname' for a description of the format of this |
Bram Moolenaar | 95bafa2 | 2018-10-02 13:26:25 +0200 | [diff] [blame] | 5199 | option. For '@' only characters up to 255 are used. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5200 | Careful: If you change this option, it might break expanding |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 5201 | environment variables. E.g., when '/' is included and Vim tries to |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5202 | expand "$HOME/.viminfo". Maybe you should change 'iskeyword' instead. |
| 5203 | |
| 5204 | *'iskeyword'* *'isk'* |
Bram Moolenaar | 6f345a1 | 2019-12-17 21:27:18 +0100 | [diff] [blame] | 5205 | 'iskeyword' 'isk' string (Vim default for Win32: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5206 | "@,48-57,_,128-167,224-235" |
| 5207 | otherwise: "@,48-57,_,192-255" |
| 5208 | Vi default: "@,48-57,_") |
| 5209 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5210 | Keywords are used in searching and recognizing with many commands: |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 5211 | "w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See |
Bram Moolenaar | 95bafa2 | 2018-10-02 13:26:25 +0200 | [diff] [blame] | 5212 | 'isfname' for a description of the format of this option. For '@' |
Bram Moolenaar | 4c29502 | 2021-05-02 17:19:11 +0200 | [diff] [blame] | 5213 | characters above 255 check the "word" character class (any character |
| 5214 | that is not white space or punctuation). |
Bram Moolenaar | 95bafa2 | 2018-10-02 13:26:25 +0200 | [diff] [blame] | 5215 | For C programs you could use "a-z,A-Z,48-57,_,.,-,>". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5216 | For a help file it is set to all non-blank printable characters except |
| 5217 | '*', '"' and '|' (so that CTRL-] on a command finds the help for that |
| 5218 | command). |
| 5219 | When the 'lisp' option is on the '-' character is always included. |
Bram Moolenaar | b8060fe | 2016-01-19 22:29:28 +0100 | [diff] [blame] | 5220 | This option also influences syntax highlighting, unless the syntax |
| 5221 | uses |:syn-iskeyword|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5222 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 5223 | set and to the Vim default value when 'compatible' is reset. |
| 5224 | |
| 5225 | *'isprint'* *'isp'* |
Yee Cheng Chin | 92b59c6 | 2024-10-22 21:16:43 +0200 | [diff] [blame] | 5226 | 'isprint' 'isp' string (default for Win32 and VMS: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5227 | "@,~-255"; otherwise: "@,161-255") |
| 5228 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5229 | The characters given by this option are displayed directly on the |
| 5230 | screen. It is also used for "\p" in a |pattern|. The characters from |
| 5231 | space (ASCII 32) to '~' (ASCII 126) are always displayed directly, |
| 5232 | even when they are not included in 'isprint' or excluded. See |
| 5233 | 'isfname' for a description of the format of this option. |
| 5234 | |
| 5235 | Non-printable characters are displayed with two characters: |
| 5236 | 0 - 31 "^@" - "^_" |
| 5237 | 32 - 126 always single characters |
| 5238 | 127 "^?" |
| 5239 | 128 - 159 "~@" - "~_" |
| 5240 | 160 - 254 "| " - "|~" |
| 5241 | 255 "~?" |
| 5242 | When 'encoding' is a Unicode one, illegal bytes from 128 to 255 are |
| 5243 | displayed as <xx>, with the hexadecimal value of the byte. |
| 5244 | When 'display' contains "uhex" all unprintable characters are |
| 5245 | displayed as <xx>. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 5246 | The SpecialKey highlighting will be used for unprintable characters. |
| 5247 | |hl-SpecialKey| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5248 | |
| 5249 | Multi-byte characters 256 and above are always included, only the |
| 5250 | characters up to 255 are specified with this option. When a character |
| 5251 | is printable but it is not available in the current font, a |
| 5252 | replacement character will be shown. |
| 5253 | Unprintable and zero-width Unicode characters are displayed as <xxxx>. |
| 5254 | There is no option to specify these characters. |
| 5255 | |
| 5256 | *'joinspaces'* *'js'* *'nojoinspaces'* *'nojs'* |
| 5257 | 'joinspaces' 'js' boolean (default on) |
| 5258 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5259 | Insert two spaces after a '.', '?' and '!' with a join command. |
| 5260 | When 'cpoptions' includes the 'j' flag, only do this after a '.'. |
| 5261 | Otherwise only one space is inserted. |
| 5262 | NOTE: This option is set when 'compatible' is set. |
| 5263 | |
Yegappan Lakshmanan | 8701825 | 2023-09-20 20:20:04 +0200 | [diff] [blame] | 5264 | *'jumpoptions'* *'jop'* |
| 5265 | 'jumpoptions' 'jop' string (default "") |
| 5266 | global |
| 5267 | List of words that change the behavior of the |jumplist|. |
| 5268 | stack Make the jumplist behave like the tagstack. |
| 5269 | Relative location of entries in the jumplist is |
| 5270 | preserved at the cost of discarding subsequent entries |
| 5271 | when navigating backwards in the jumplist and then |
| 5272 | jumping to a location. |jumplist-stack| |
| 5273 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5274 | *'key'* |
| 5275 | 'key' string (default "") |
| 5276 | local to buffer |
Bram Moolenaar | 996343d | 2010-07-04 22:20:21 +0200 | [diff] [blame] | 5277 | {only available when compiled with the |+cryptv| |
| 5278 | feature} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5279 | The key that is used for encrypting and decrypting the current buffer. |
Bram Moolenaar | 40e6a71 | 2010-05-16 22:32:54 +0200 | [diff] [blame] | 5280 | See |encryption| and 'cryptmethod'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5281 | Careful: Do not set the key value by hand, someone might see the typed |
| 5282 | key. Use the |:X| command. But you can make 'key' empty: > |
| 5283 | :set key= |
| 5284 | < It is not possible to get the value of this option with ":set key" or |
| 5285 | "echo &key". This is to avoid showing it to someone who shouldn't |
| 5286 | know. It also means you cannot see it yourself once you have set it, |
| 5287 | be careful not to make a typing error! |
Yee Cheng Chin | 6ee7b52 | 2023-10-01 09:13:22 +0200 | [diff] [blame] | 5288 | You also cannot use |:set-=|, |:set+=|, |:set^=| on this option to |
| 5289 | prevent an attacker from guessing substrings in your key. |
Bram Moolenaar | d58e929 | 2011-02-09 17:07:58 +0100 | [diff] [blame] | 5290 | You can use "&key" in an expression to detect whether encryption is |
| 5291 | enabled. When 'key' is set it returns "*****" (five stars). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5292 | |
| 5293 | *'keymap'* *'kmp'* *E544* |
| 5294 | 'keymap' 'kmp' string (default "") |
| 5295 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5296 | {only available when compiled with the |+keymap| |
| 5297 | feature} |
| 5298 | Name of a keyboard mapping. See |mbyte-keymap|. |
| 5299 | Setting this option to a valid keymap name has the side effect of |
| 5300 | setting 'iminsert' to one, so that the keymap becomes effective. |
| 5301 | 'imsearch' is also set to one, unless it was -1 |
Milly | ae62fe5 | 2024-10-02 19:30:41 +0200 | [diff] [blame] | 5302 | Only alphanumeric characters, '.', '-' and '_' can be used. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5303 | |
| 5304 | *'keymodel'* *'km'* |
| 5305 | 'keymodel' 'km' string (default "") |
| 5306 | global |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 5307 | List of comma-separated words, which enable special things that keys |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5308 | can do. These values can be used: |
| 5309 | startsel Using a shifted special key starts selection (either |
| 5310 | Select mode or Visual mode, depending on "key" being |
| 5311 | present in 'selectmode'). |
| 5312 | stopsel Using a not-shifted special key stops selection. |
| 5313 | Special keys in this context are the cursor keys, <End>, <Home>, |
| 5314 | <PageUp> and <PageDown>. |
| 5315 | The 'keymodel' option is set by the |:behave| command. |
| 5316 | |
Bram Moolenaar | 63a2e36 | 2022-11-23 20:20:18 +0000 | [diff] [blame] | 5317 | *'keyprotocol'* *'kpc'* |
| 5318 | 'keyprotocol' 'kpc' string (default: see below) |
| 5319 | global |
| 5320 | Specifies what keyboard protocol to use depending on the value of |
| 5321 | 'term'. The supported keyboard protocols names are: |
| 5322 | none whatever the terminal uses |
| 5323 | mok2 modifyOtherKeys level 2, as supported by xterm |
| 5324 | kitty Kitty keyboard protocol, as supported by Kitty |
| 5325 | |
Bram Moolenaar | a87749e | 2022-11-30 10:23:17 +0000 | [diff] [blame] | 5326 | The option value is a list of comma separated items. Each item has |
Bram Moolenaar | 63a2e36 | 2022-11-23 20:20:18 +0000 | [diff] [blame] | 5327 | a pattern that is matched against the 'term' option, a colon and the |
| 5328 | protocol name to be used. To illustrate this, the default value would |
| 5329 | be set with: > |
Christian Brabandt | f6ba8de | 2024-12-28 17:15:05 +0100 | [diff] [blame] | 5330 | set keyprotocol=kitty:kitty,foot:kitty,ghostty:kitty,wezterm:kitty |
| 5331 | set keyprotocol+=xterm:mok2 |
Bram Moolenaar | 63a2e36 | 2022-11-23 20:20:18 +0000 | [diff] [blame] | 5332 | |
Hirohito Higashi | 195fcc9 | 2025-02-01 10:26:58 +0100 | [diff] [blame] | 5333 | < This means that when 'term' contains "kitty, "foot", "ghostty" or |
Christian Brabandt | f6ba8de | 2024-12-28 17:15:05 +0100 | [diff] [blame] | 5334 | "wezterm" somewhere, then the "kitty" protocol is used. When 'term' |
| 5335 | contains "xterm" somewhere, then the "mok2" protocol is used. |
Bram Moolenaar | 63a2e36 | 2022-11-23 20:20:18 +0000 | [diff] [blame] | 5336 | |
| 5337 | The first match is used, thus if you want to have "kitty" use the |
| 5338 | kitty protocol, but "badkitty" not, then you should match "badkitty" |
| 5339 | first and use the "none" value: > |
| 5340 | set keyprotocol=badkitty:none,kitty:kitty |
| 5341 | < |
| 5342 | The option is used after 'term' has been changed. First the termcap |
| 5343 | entries are set, possibly using the builtin list, see |builtin-terms|. |
| 5344 | Then this option is inspected and if there is a match and a protocol |
| 5345 | is specified the following happens: |
| 5346 | none Nothing, the regular t_TE and t_TI values remain |
| 5347 | |
| 5348 | mok2 The t_TE value is changed to: |
| 5349 | CSI >4;m disables modifyOtherKeys |
| 5350 | The t_TI value is changed to: |
| 5351 | CSI >4;2m enables modifyOtherKeys |
Bram Moolenaar | a87749e | 2022-11-30 10:23:17 +0000 | [diff] [blame] | 5352 | CSI ?4m request the modifyOtherKeys state |
Bram Moolenaar | 63a2e36 | 2022-11-23 20:20:18 +0000 | [diff] [blame] | 5353 | |
| 5354 | kitty The t_TE value is changed to: |
| 5355 | CSI >4;m disables modifyOtherKeys |
Bram Moolenaar | a87749e | 2022-11-30 10:23:17 +0000 | [diff] [blame] | 5356 | CSI =0;1u disables the kitty keyboard protocol |
Bram Moolenaar | 63a2e36 | 2022-11-23 20:20:18 +0000 | [diff] [blame] | 5357 | The t_TI value is changed to: |
Bram Moolenaar | a87749e | 2022-11-30 10:23:17 +0000 | [diff] [blame] | 5358 | CSI =1;1u enables the kitty keyboard protocol |
Bram Moolenaar | 63a2e36 | 2022-11-23 20:20:18 +0000 | [diff] [blame] | 5359 | CSI ?u request kitty keyboard protocol state |
| 5360 | CSI >c request the termresponse |
| 5361 | |
Bram Moolenaar | f1dcd14 | 2022-12-31 15:30:45 +0000 | [diff] [blame] | 5362 | If you notice problems, such as characters being displayed that |
| 5363 | disappear after `CTRL-L`, you might want to try making this option |
| 5364 | empty. Then set the 'term' option to have it take effect: > |
| 5365 | set keyprotocol= |
| 5366 | let &term = &term |
Bram Moolenaar | be4e016 | 2023-02-02 13:59:48 +0000 | [diff] [blame] | 5367 | < |
Bram Moolenaar | 63a2e36 | 2022-11-23 20:20:18 +0000 | [diff] [blame] | 5368 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5369 | *'keywordprg'* *'kp'* |
| 5370 | 'keywordprg' 'kp' string (default "man" or "man -s", DOS: ":help", |
Bram Moolenaar | 2ff8b64 | 2016-05-24 10:46:45 +0200 | [diff] [blame] | 5371 | VMS: "help") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5372 | global or local to buffer |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5373 | Program to use for the |K| command. Environment variables are |
| 5374 | expanded |:set_env|. ":help" may be used to access the Vim internal |
| 5375 | help. (Note that previously setting the global option to the empty |
| 5376 | value did this, which is now deprecated.) |
Bram Moolenaar | 2ff8b64 | 2016-05-24 10:46:45 +0200 | [diff] [blame] | 5377 | When the first character is ":", the command is invoked as a Vim |
Bram Moolenaar | b529cfb | 2022-07-25 15:42:07 +0100 | [diff] [blame] | 5378 | Ex command with [count] added as an argument if it is not zero. |
Bram Moolenaar | 2ff8b64 | 2016-05-24 10:46:45 +0200 | [diff] [blame] | 5379 | When "man", "man -s" or an Ex command is used, Vim will automatically |
| 5380 | translate a count for the "K" command and pass it as the first |
| 5381 | argument. For "man -s" the "-s" is removed when there is no count. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5382 | See |option-backslash| about including spaces and backslashes. |
| 5383 | Example: > |
| 5384 | :set keywordprg=man\ -s |
| 5385 | < This option cannot be set from a |modeline| or in the |sandbox|, for |
| 5386 | security reasons. |
| 5387 | |
| 5388 | *'langmap'* *'lmap'* *E357* *E358* |
| 5389 | 'langmap' 'lmap' string (default "") |
| 5390 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5391 | {only available when compiled with the |+langmap| |
| 5392 | feature} |
| 5393 | This option allows switching your keyboard into a special language |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 5394 | mode. When you are typing text in Insert mode the characters are |
Bram Moolenaar | fa73534 | 2016-01-03 22:14:44 +0100 | [diff] [blame] | 5395 | inserted directly. When in Normal mode the 'langmap' option takes |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5396 | care of translating these special characters to the original meaning |
| 5397 | of the key. This means you don't have to change the keyboard mode to |
| 5398 | be able to execute Normal mode commands. |
| 5399 | This is the opposite of the 'keymap' option, where characters are |
| 5400 | mapped in Insert mode. |
Bram Moolenaar | b17893a | 2020-03-14 08:19:51 +0100 | [diff] [blame] | 5401 | Also consider setting 'langremap' to off, to prevent 'langmap' from |
| 5402 | applying to characters resulting from a mapping. |
Bram Moolenaar | e968e36 | 2014-05-13 20:23:24 +0200 | [diff] [blame] | 5403 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 5404 | security reasons. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5405 | |
Bram Moolenaar | fd2ac76 | 2006-03-01 22:09:21 +0000 | [diff] [blame] | 5406 | Example (for Greek, in UTF-8): *greek* > |
| 5407 | :set langmap=ΑA,ΒB,ΨC,ΔD,ΕE,ΦF,ΓG,ΗH,ΙI,ΞJ,ΚK,ΛL,ΜM,ΝN,ΟO,ΠP,QQ,ΡR,ΣS,ΤT,ΘU,ΩV,WW,ΧX,ΥY,ΖZ,αa,βb,ψc,δd,εe,φf,γg,ηh,ιi,ξj,κk,λl,μm,νn,οo,πp,qq,ρr,σs,τt,θu,ωv,ςw,χx,υy,ζz |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5408 | < Example (exchanges meaning of z and y for commands): > |
| 5409 | :set langmap=zy,yz,ZY,YZ |
| 5410 | < |
| 5411 | The 'langmap' option is a list of parts, separated with commas. Each |
| 5412 | part can be in one of two forms: |
| 5413 | 1. A list of pairs. Each pair is a "from" character immediately |
| 5414 | followed by the "to" character. Examples: "aA", "aAbBcC". |
Dominique Pellé | df62c62 | 2024-07-15 20:29:59 +0200 | [diff] [blame] | 5415 | 2. A list of "from" characters, a semicolon and a list of "to" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5416 | characters. Example: "abc;ABC" |
| 5417 | Example: "aA,fgh;FGH,cCdDeE" |
| 5418 | Special characters need to be preceded with a backslash. These are |
Bram Moolenaar | 4f4d51a | 2020-10-11 13:57:40 +0200 | [diff] [blame] | 5419 | ";", ',', '"', '|' and backslash itself. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5420 | |
| 5421 | This will allow you to activate vim actions without having to switch |
| 5422 | back and forth between the languages. Your language characters will |
| 5423 | be understood as normal vim English characters (according to the |
| 5424 | langmap mappings) in the following cases: |
| 5425 | o Normal/Visual mode (commands, buffer/register names, user mappings) |
| 5426 | o Insert/Replace Mode: Register names after CTRL-R |
| 5427 | o Insert/Replace Mode: Mappings |
| 5428 | Characters entered in Command-line mode will NOT be affected by |
| 5429 | this option. Note that this option can be changed at any time |
| 5430 | allowing to switch between mappings for different languages/encodings. |
| 5431 | Use a mapping to avoid having to type it each time! |
| 5432 | |
| 5433 | *'langmenu'* *'lm'* |
| 5434 | 'langmenu' 'lm' string (default "") |
| 5435 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5436 | {only available when compiled with the |+menu| and |
| 5437 | |+multi_lang| features} |
| 5438 | Language to use for menu translation. Tells which file is loaded |
| 5439 | from the "lang" directory in 'runtimepath': > |
Bram Moolenaar | c51cf03 | 2022-02-26 12:25:45 +0000 | [diff] [blame] | 5440 | "lang/menu_" .. &langmenu .. ".vim" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5441 | < (without the spaces). For example, to always use the Dutch menus, no |
| 5442 | matter what $LANG is set to: > |
| 5443 | :set langmenu=nl_NL.ISO_8859-1 |
| 5444 | < When 'langmenu' is empty, |v:lang| is used. |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 5445 | Only normal file name characters can be used, "/\*?[|<>" are illegal. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5446 | If your $LANG is set to a non-English language but you do want to use |
| 5447 | the English menus: > |
| 5448 | :set langmenu=none |
| 5449 | < This option must be set before loading menus, switching on filetype |
| 5450 | detection or syntax highlighting. Once the menus are defined setting |
| 5451 | this option has no effect. But you could do this: > |
| 5452 | :source $VIMRUNTIME/delmenu.vim |
| 5453 | :set langmenu=de_DE.ISO_8859-1 |
| 5454 | :source $VIMRUNTIME/menu.vim |
| 5455 | < Warning: This deletes all menus that you defined yourself! |
| 5456 | |
Bram Moolenaar | d94464e | 2015-11-02 15:28:18 +0100 | [diff] [blame] | 5457 | *'langnoremap'* *'lnr'* *'nolangnoremap'* *'nolnr'* |
Bram Moolenaar | 8c08b5b | 2016-07-28 22:24:15 +0200 | [diff] [blame] | 5458 | 'langnoremap' 'lnr' boolean (default off, set in |defaults.vim|) |
Bram Moolenaar | 4391cf9 | 2014-11-05 17:44:52 +0100 | [diff] [blame] | 5459 | global |
Bram Moolenaar | 4391cf9 | 2014-11-05 17:44:52 +0100 | [diff] [blame] | 5460 | {only available when compiled with the |+langmap| |
| 5461 | feature} |
Bram Moolenaar | e4a3bcf | 2016-08-26 19:52:37 +0200 | [diff] [blame] | 5462 | This is just like 'langremap' but with the value inverted. It only |
| 5463 | exists for backwards compatibility. When setting 'langremap' then |
| 5464 | 'langnoremap' is set to the inverted value, and the other way around. |
| 5465 | |
| 5466 | *'langremap'* *'lrm'* *'nolangremap'* *'nolrm'* |
Bram Moolenaar | b17893a | 2020-03-14 08:19:51 +0100 | [diff] [blame] | 5467 | 'langremap' 'lrm' boolean (default on, set to off in |defaults.vim|) |
Bram Moolenaar | e4a3bcf | 2016-08-26 19:52:37 +0200 | [diff] [blame] | 5468 | global |
Bram Moolenaar | e4a3bcf | 2016-08-26 19:52:37 +0200 | [diff] [blame] | 5469 | {only available when compiled with the |+langmap| |
| 5470 | feature} |
| 5471 | When off, setting 'langmap' does not apply to characters resulting from |
Bram Moolenaar | 4391cf9 | 2014-11-05 17:44:52 +0100 | [diff] [blame] | 5472 | a mapping. This basically means, if you noticed that setting |
Bram Moolenaar | e4a3bcf | 2016-08-26 19:52:37 +0200 | [diff] [blame] | 5473 | 'langmap' disables some of your mappings, try resetting this option. |
| 5474 | This option defaults to on for backwards compatibility. Set it off if |
Bram Moolenaar | 4391cf9 | 2014-11-05 17:44:52 +0100 | [diff] [blame] | 5475 | that works for you to avoid mappings to break. |
| 5476 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5477 | *'laststatus'* *'ls'* |
| 5478 | 'laststatus' 'ls' number (default 1) |
| 5479 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5480 | The value of this option influences when the last window will have a |
| 5481 | status line: |
| 5482 | 0: never |
| 5483 | 1: only if there are at least two windows |
| 5484 | 2: always |
| 5485 | The screen looks nicer with a status line if you have several |
| 5486 | windows, but it takes another screen line. |status-line| |
| 5487 | |
| 5488 | *'lazyredraw'* *'lz'* *'nolazyredraw'* *'nolz'* |
| 5489 | 'lazyredraw' 'lz' boolean (default off) |
| 5490 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5491 | When this option is set, the screen will not be redrawn while |
| 5492 | executing macros, registers and other commands that have not been |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 5493 | typed. Also, updating the window title is postponed. To force an |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5494 | update use |:redraw|. |
Bram Moolenaar | a57b553 | 2022-06-24 11:48:03 +0100 | [diff] [blame] | 5495 | This may occasionally cause display errors. It is only meant to be set |
| 5496 | temporarily when performing an operation where redrawing may cause |
Dominique Pellé | df62c62 | 2024-07-15 20:29:59 +0200 | [diff] [blame] | 5497 | flickering or cause a slowdown. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5498 | |
64-bitman | 88d41ab | 2025-04-06 17:20:39 +0200 | [diff] [blame] | 5499 | *'lhistory'* *'lhi'* |
| 5500 | 'lhistory' 'lhi' number (default: 10) |
| 5501 | local to window |
| 5502 | {only available when compiled with the |+quickfix| |
| 5503 | feature} |
zeertzjq | b71f130 | 2025-04-08 20:29:40 +0200 | [diff] [blame] | 5504 | Like 'chistory', but for the location list stack associated with a |
| 5505 | window. If the option is changed in either the location list window |
| 5506 | itself or the window that is associated with the location list stack, |
| 5507 | the new value will also be applied to the other one. This means this |
| 5508 | value will always be the same for a given location list window and its |
| 5509 | corresponding window. See |quickfix-stack| for additional info. |
64-bitman | 88d41ab | 2025-04-06 17:20:39 +0200 | [diff] [blame] | 5510 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5511 | *'linebreak'* *'lbr'* *'nolinebreak'* *'nolbr'* |
| 5512 | 'linebreak' 'lbr' boolean (default off) |
| 5513 | local to window |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 5514 | {not available when compiled without the |+linebreak| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5515 | feature} |
Bram Moolenaar | 946e27a | 2014-06-25 18:50:27 +0200 | [diff] [blame] | 5516 | If on, Vim will wrap long lines at a character in 'breakat' rather |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5517 | than at the last character that fits on the screen. Unlike |
| 5518 | 'wrapmargin' and 'textwidth', this does not insert <EOL>s in the file, |
Bram Moolenaar | 946e27a | 2014-06-25 18:50:27 +0200 | [diff] [blame] | 5519 | it only affects the way the file is displayed, not its contents. |
| 5520 | If 'breakindent' is set, line is visually indented. Then, the value |
| 5521 | of 'showbreak' is used to put in front of wrapped lines. This option |
Bram Moolenaar | 86b17e9 | 2014-07-02 20:00:47 +0200 | [diff] [blame] | 5522 | is not used when the 'wrap' option is off. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5523 | Note that <Tab> characters after an <EOL> are mostly not displayed |
| 5524 | with the right amount of white space. |
| 5525 | |
| 5526 | *'lines'* *E593* |
| 5527 | 'lines' number (default 24 or terminal height) |
| 5528 | global |
| 5529 | Number of lines of the Vim window. |
| 5530 | Normally you don't need to set this. It is done automatically by the |
Bram Moolenaar | 7c62692 | 2005-02-07 22:01:03 +0000 | [diff] [blame] | 5531 | terminal initialization code. Also see |posix-screen-size|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5532 | When Vim is running in the GUI or in a resizable window, setting this |
| 5533 | option will cause the window size to be changed. When you only want |
| 5534 | to use the size for the GUI, put the command in your |gvimrc| file. |
| 5535 | Vim limits the number of lines to what fits on the screen. You can |
| 5536 | use this command to get the tallest window possible: > |
| 5537 | :set lines=999 |
Bram Moolenaar | f4d1145 | 2005-12-02 00:46:37 +0000 | [diff] [blame] | 5538 | < Minimum value is 2, maximum value is 1000. |
Bram Moolenaar | dc1f164 | 2016-08-16 18:33:43 +0200 | [diff] [blame] | 5539 | If you get fewer lines than expected, check the 'guiheadroom' option. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5540 | When you set this option and Vim is unable to change the physical |
| 5541 | number of lines of the display, the display may be messed up. |
| 5542 | |
| 5543 | *'linespace'* *'lsp'* |
| 5544 | 'linespace' 'lsp' number (default 0, 1 for Win32 GUI) |
| 5545 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5546 | {only in the GUI} |
| 5547 | Number of pixel lines inserted between characters. Useful if the font |
| 5548 | uses the full character cell height, making lines touch each other. |
| 5549 | When non-zero there is room for underlining. |
Bram Moolenaar | bc7aa85 | 2005-03-06 23:38:09 +0000 | [diff] [blame] | 5550 | With some fonts there can be too much room between lines (to have |
| 5551 | space for ascents and descents). Then it makes sense to set |
| 5552 | 'linespace' to a negative value. This may cause display problems |
| 5553 | though! |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5554 | |
| 5555 | *'lisp'* *'nolisp'* |
| 5556 | 'lisp' boolean (default off) |
| 5557 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5558 | Lisp mode: When <Enter> is typed in insert mode set the indent for |
| 5559 | the next line to Lisp standards (well, sort of). Also happens with |
| 5560 | "cc" or "S". 'autoindent' must also be on for this to work. The 'p' |
| 5561 | flag in 'cpoptions' changes the method of indenting: Vi compatible or |
| 5562 | better. Also see 'lispwords'. |
| 5563 | The '-' character is included in keyword characters. Redefines the |
| 5564 | "=" operator to use this same indentation algorithm rather than |
| 5565 | calling an external program if 'equalprg' is empty. |
| 5566 | This option is not used when 'paste' is set. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5567 | |
Bram Moolenaar | 49846fb | 2022-10-15 16:05:33 +0100 | [diff] [blame] | 5568 | *'lispoptions'* *'lop'* |
| 5569 | 'lispoptions' 'lop' string (default "") |
| 5570 | local to buffer |
| 5571 | Comma-separated list of items that influence the Lisp indenting when |
| 5572 | enabled with the |'lisp'| option. Currently only one item is |
| 5573 | supported: |
| 5574 | expr:1 use 'indentexpr' for Lisp indenting when it is set |
| 5575 | expr:0 do not use 'indentexpr' for Lisp indenting (default) |
| 5576 | Note that when using 'indentexpr' the `=` operator indents all the |
| 5577 | lines, otherwise the first line is not indented (Vi-compatible). |
| 5578 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5579 | *'lispwords'* *'lw'* |
| 5580 | 'lispwords' 'lw' string (default is very long) |
Bram Moolenaar | af6c131 | 2014-03-12 18:55:58 +0100 | [diff] [blame] | 5581 | global or local to buffer |global-local| |
Bram Moolenaar | 48c3f4e | 2022-08-08 15:42:38 +0100 | [diff] [blame] | 5582 | Comma-separated list of words that influence the Lisp indenting when |
| 5583 | enabled with the |'lisp'| option. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5584 | |
| 5585 | *'list'* *'nolist'* |
| 5586 | 'list' boolean (default off) |
| 5587 | local to window |
Bram Moolenaar | 113cb51 | 2021-11-07 20:27:04 +0000 | [diff] [blame] | 5588 | List mode: By default show tabs as CTRL-I is displayed, display $ |
| 5589 | after end of line. Useful to see the difference between tabs and |
| 5590 | spaces and for trailing blanks. Further changed by the 'listchars' |
| 5591 | option. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 5592 | |
| 5593 | The cursor is displayed at the start of the space a Tab character |
| 5594 | occupies, not at the end as usual in Normal mode. To get this cursor |
| 5595 | position while displaying Tabs with spaces, use: > |
Bram Moolenaar | dd007ed | 2013-07-09 15:44:17 +0200 | [diff] [blame] | 5596 | :set list lcs=tab:\ \ |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 5597 | < |
| 5598 | Note that list mode will also affect formatting (set with 'textwidth' |
| 5599 | or 'wrapmargin') when 'cpoptions' includes 'L'. See 'listchars' for |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5600 | changing the way tabs are displayed. |
| 5601 | |
| 5602 | *'listchars'* *'lcs'* |
| 5603 | 'listchars' 'lcs' string (default "eol:$") |
Bram Moolenaar | eed9d46 | 2021-02-15 20:38:25 +0100 | [diff] [blame] | 5604 | global or local to window |global-local| |
Bram Moolenaar | f9d5ca1 | 2010-08-01 16:13:51 +0200 | [diff] [blame] | 5605 | Strings to use in 'list' mode and for the |:list| command. It is a |
zeertzjq | 6a8d2e1 | 2024-01-17 20:54:49 +0100 | [diff] [blame] | 5606 | comma-separated list of string settings. *E1511* |
Bram Moolenaar | 7927836 | 2015-04-21 18:33:48 +0200 | [diff] [blame] | 5607 | *lcs-eol* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5608 | eol:c Character to show at the end of each line. When |
| 5609 | omitted, there is no extra character at the end of the |
| 5610 | line. |
Bram Moolenaar | 7927836 | 2015-04-21 18:33:48 +0200 | [diff] [blame] | 5611 | *lcs-tab* |
Bram Moolenaar | 83a5217 | 2019-01-16 22:41:54 +0100 | [diff] [blame] | 5612 | tab:xy[z] Two or three characters to be used to show a tab. |
| 5613 | The third character is optional. |
| 5614 | |
| 5615 | tab:xy The 'x' is always used, then 'y' as many times as will |
| 5616 | fit. Thus "tab:>-" displays: |
| 5617 | > |
| 5618 | >- |
| 5619 | >-- |
| 5620 | etc. |
| 5621 | |
| 5622 | tab:xyz The 'z' is always used, then 'x' is prepended, and |
| 5623 | then 'y' is used as many times as will fit. Thus |
| 5624 | "tab:<->" displays: |
| 5625 | > |
| 5626 | <> |
| 5627 | <-> |
| 5628 | <--> |
| 5629 | etc. |
| 5630 | |
| 5631 | When "tab:" is omitted, a tab is shown as ^I. |
Bram Moolenaar | 7927836 | 2015-04-21 18:33:48 +0200 | [diff] [blame] | 5632 | *lcs-space* |
| 5633 | space:c Character to show for a space. When omitted, spaces |
| 5634 | are left blank. |
zeertzjq | f14b8ba | 2021-09-10 16:58:30 +0200 | [diff] [blame] | 5635 | *lcs-multispace* |
| 5636 | multispace:c... |
Bram Moolenaar | be4e016 | 2023-02-02 13:59:48 +0000 | [diff] [blame] | 5637 | One or more characters to use cyclically to show for |
| 5638 | multiple consecutive spaces. Overrides the "space" |
zeertzjq | f14b8ba | 2021-09-10 16:58:30 +0200 | [diff] [blame] | 5639 | setting, except for single spaces. When omitted, the |
| 5640 | "space" setting is used. For example, |
| 5641 | `:set listchars=multispace:---+` shows ten consecutive |
| 5642 | spaces as: |
Bram Moolenaar | aca12fd | 2022-06-07 10:16:15 +0100 | [diff] [blame] | 5643 | ---+---+-- ~ |
Bram Moolenaar | 91478ae | 2021-02-03 15:58:13 +0100 | [diff] [blame] | 5644 | *lcs-lead* |
| 5645 | lead:c Character to show for leading spaces. When omitted, |
zeertzjq | f14b8ba | 2021-09-10 16:58:30 +0200 | [diff] [blame] | 5646 | leading spaces are blank. Overrides the "space" and |
| 5647 | "multispace" settings for leading spaces. You can |
| 5648 | combine it with "tab:", for example: > |
Bram Moolenaar | 942db23 | 2021-02-13 18:14:48 +0100 | [diff] [blame] | 5649 | :set listchars+=tab:>-,lead:. |
Bram Moolenaar | aca12fd | 2022-06-07 10:16:15 +0100 | [diff] [blame] | 5650 | < *lcs-leadmultispace* |
| 5651 | leadmultispace:c... |
Bram Moolenaar | 069a7d5 | 2022-06-27 22:16:08 +0100 | [diff] [blame] | 5652 | Like the |lcs-multispace| value, but for leading |
| 5653 | spaces only. Also overrides |lcs-lead| for leading |
| 5654 | multiple spaces. |
Bram Moolenaar | 8a3b805 | 2022-06-26 12:21:15 +0100 | [diff] [blame] | 5655 | `:set listchars=leadmultispace:---+` shows ten |
| 5656 | consecutive leading spaces as: |
Bram Moolenaar | aca12fd | 2022-06-07 10:16:15 +0100 | [diff] [blame] | 5657 | ---+---+--XXX ~ |
| 5658 | Where "XXX" denotes the first non-blank characters in |
| 5659 | the line. |
| 5660 | *lcs-trail* |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 5661 | trail:c Character to show for trailing spaces. When omitted, |
zeertzjq | f14b8ba | 2021-09-10 16:58:30 +0200 | [diff] [blame] | 5662 | trailing spaces are blank. Overrides the "space" and |
| 5663 | "multispace" settings for trailing spaces. |
Bram Moolenaar | 7927836 | 2015-04-21 18:33:48 +0200 | [diff] [blame] | 5664 | *lcs-extends* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5665 | extends:c Character to show in the last column, when 'wrap' is |
| 5666 | off and the line continues beyond the right of the |
| 5667 | screen. |
Bram Moolenaar | 7927836 | 2015-04-21 18:33:48 +0200 | [diff] [blame] | 5668 | *lcs-precedes* |
Bram Moolenaar | bffba7f | 2019-09-20 17:00:17 +0200 | [diff] [blame] | 5669 | precedes:c Character to show in the first visible column of the |
| 5670 | physical line, when there is text preceding the |
| 5671 | character visible in the first column. |
Bram Moolenaar | 7927836 | 2015-04-21 18:33:48 +0200 | [diff] [blame] | 5672 | *lcs-conceal* |
Bram Moolenaar | 860cae1 | 2010-06-05 23:22:07 +0200 | [diff] [blame] | 5673 | conceal:c Character to show in place of concealed text, when |
Bram Moolenaar | 0bc380a | 2010-07-10 13:52:13 +0200 | [diff] [blame] | 5674 | 'conceallevel' is set to 1. |
Bram Moolenaar | 7927836 | 2015-04-21 18:33:48 +0200 | [diff] [blame] | 5675 | *lcs-nbsp* |
Bram Moolenaar | 73284b9 | 2015-05-04 17:28:22 +0200 | [diff] [blame] | 5676 | nbsp:c Character to show for a non-breakable space character |
| 5677 | (0xA0 (160 decimal) and U+202F). Left blank when |
| 5678 | omitted. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5679 | |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 5680 | The characters ':' and ',' should not be used. UTF-8 characters can |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5681 | be used when 'encoding' is "utf-8", otherwise only printable |
zeertzjq | 6a8d2e1 | 2024-01-17 20:54:49 +0100 | [diff] [blame] | 5682 | characters are allowed. All characters must be single width. *E1512* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5683 | |
Bram Moolenaar | 93ff672 | 2021-10-16 17:51:40 +0100 | [diff] [blame] | 5684 | Each character can be specified as hex: > |
| 5685 | set listchars=eol:\\x24 |
| 5686 | set listchars=eol:\\u21b5 |
| 5687 | set listchars=eol:\\U000021b5 |
| 5688 | < Note that a double backslash is used. The number of hex characters |
| 5689 | must be exactly 2 for \\x, 4 for \\u and 8 for \\U. |
| 5690 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5691 | Examples: > |
| 5692 | :set lcs=tab:>-,trail:- |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 5693 | :set lcs=tab:>-,eol:<,nbsp:% |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5694 | :set lcs=extends:>,precedes:< |
| 5695 | < The "NonText" highlighting will be used for "eol", "extends" and |
Bram Moolenaar | 34cc7d8 | 2021-09-21 20:09:51 +0200 | [diff] [blame] | 5696 | "precedes". "SpecialKey" will be used for "tab", "nbsp", "space", |
| 5697 | "multispace", "lead" and "trail". |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 5698 | |hl-NonText| |hl-SpecialKey| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5699 | |
| 5700 | *'lpl'* *'nolpl'* *'loadplugins'* *'noloadplugins'* |
| 5701 | 'loadplugins' 'lpl' boolean (default on) |
| 5702 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5703 | When on the plugin scripts are loaded when starting up |load-plugins|. |
| 5704 | This option can be reset in your |vimrc| file to disable the loading |
| 5705 | of plugins. |
Bram Moolenaar | c4da113 | 2017-07-15 19:39:43 +0200 | [diff] [blame] | 5706 | Note that using the "-u NONE", "-u DEFAULTS" and "--noplugin" command |
| 5707 | line arguments reset this option. See |-u| and |--noplugin|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5708 | |
Bram Moolenaar | d94464e | 2015-11-02 15:28:18 +0100 | [diff] [blame] | 5709 | *'luadll'* |
Bram Moolenaar | 3848e00 | 2016-03-19 18:42:29 +0100 | [diff] [blame] | 5710 | 'luadll' string (default depends on the build) |
Bram Moolenaar | d94464e | 2015-11-02 15:28:18 +0100 | [diff] [blame] | 5711 | global |
Bram Moolenaar | d94464e | 2015-11-02 15:28:18 +0100 | [diff] [blame] | 5712 | {only available when compiled with the |+lua/dyn| |
| 5713 | feature} |
Bram Moolenaar | 25e4fcd | 2016-01-09 14:57:47 +0100 | [diff] [blame] | 5714 | Specifies the name of the Lua shared library. The default is |
| 5715 | DYNAMIC_LUA_DLL, which was specified at compile time. |
Bram Moolenaar | aa3b15d | 2016-04-21 08:53:19 +0200 | [diff] [blame] | 5716 | Environment variables are expanded |:set_env|. |
Bram Moolenaar | d94464e | 2015-11-02 15:28:18 +0100 | [diff] [blame] | 5717 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 5718 | security reasons. |
| 5719 | |
Bram Moolenaar | f9393ef | 2006-04-24 19:47:27 +0000 | [diff] [blame] | 5720 | *'macatsui'* *'nomacatsui'* |
| 5721 | 'macatsui' boolean (default on) |
| 5722 | global |
Bram Moolenaar | 3d1cde8 | 2020-08-15 18:55:18 +0200 | [diff] [blame] | 5723 | {not supported} |
| 5724 | No longer supported, as the Mac OS X GUI code was removed. |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 5725 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5726 | *'magic'* *'nomagic'* |
| 5727 | 'magic' boolean (default on) |
| 5728 | global |
| 5729 | Changes the special characters that can be used in search patterns. |
| 5730 | See |pattern|. |
Bram Moolenaar | 64d8e25 | 2016-09-06 22:12:34 +0200 | [diff] [blame] | 5731 | WARNING: Switching this option off most likely breaks plugins! That |
| 5732 | is because many patterns assume it's on and will fail when it's off. |
| 5733 | Only switch it off when working with old Vi scripts. In any other |
| 5734 | situation write patterns that work when 'magic' is on. Include "\M" |
| 5735 | when you want to |/\M|. |
Bram Moolenaar | 4072ba5 | 2020-12-23 13:56:35 +0100 | [diff] [blame] | 5736 | In |Vim9| script the value of 'magic' is ignored, patterns behave like |
| 5737 | it is always set. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5738 | |
| 5739 | *'makeef'* *'mef'* |
| 5740 | 'makeef' 'mef' string (default: "") |
| 5741 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5742 | {not available when compiled without the |+quickfix| |
| 5743 | feature} |
| 5744 | Name of the errorfile for the |:make| command (see |:make_makeprg|) |
| 5745 | and the |:grep| command. |
| 5746 | When it is empty, an internally generated temp file will be used. |
| 5747 | When "##" is included, it is replaced by a number to make the name |
| 5748 | unique. This makes sure that the ":make" command doesn't overwrite an |
| 5749 | existing file. |
| 5750 | NOT used for the ":cf" command. See 'errorfile' for that. |
| 5751 | Environment variables are expanded |:set_env|. |
| 5752 | See |option-backslash| about including spaces and backslashes. |
| 5753 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 5754 | security reasons. |
| 5755 | |
Bram Moolenaar | 2c7292d | 2017-03-05 17:43:31 +0100 | [diff] [blame] | 5756 | *'makeencoding'* *'menc'* |
| 5757 | 'makeencoding' 'menc' string (default "") |
| 5758 | global or local to buffer |global-local| |
Bram Moolenaar | 2c7292d | 2017-03-05 17:43:31 +0100 | [diff] [blame] | 5759 | Encoding used for reading the output of external commands. When empty, |
| 5760 | encoding is not converted. |
| 5761 | This is used for `:make`, `:lmake`, `:grep`, `:lgrep`, `:grepadd`, |
| 5762 | `:lgrepadd`, `:cfile`, `:cgetfile`, `:caddfile`, `:lfile`, `:lgetfile`, |
| 5763 | and `:laddfile`. |
| 5764 | |
| 5765 | This would be mostly useful when you use MS-Windows and set 'encoding' |
| 5766 | to "utf-8". If |+iconv| is enabled and GNU libiconv is used, setting |
| 5767 | 'makeencoding' to "char" has the same effect as setting to the system |
| 5768 | locale encoding. Example: > |
| 5769 | :set encoding=utf-8 |
| 5770 | :set makeencoding=char " system locale is used |
| 5771 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5772 | *'makeprg'* *'mp'* |
| 5773 | 'makeprg' 'mp' string (default "make", VMS: "MMS") |
| 5774 | global or local to buffer |global-local| |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 5775 | Program to use for the ":make" command. See |:make_makeprg|. |
Bram Moolenaar | 22f1d0e | 2018-02-27 14:53:30 +0100 | [diff] [blame] | 5776 | This option may contain '%' and '#' characters (see |:_%| and |:_#|), |
| 5777 | which are expanded to the current and alternate file name. Use |::S| |
Bram Moolenaar | 26df092 | 2014-02-23 23:39:13 +0100 | [diff] [blame] | 5778 | to escape file names in case they contain special characters. |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 5779 | Environment variables are expanded |:set_env|. See |option-backslash| |
| 5780 | about including spaces and backslashes. |
| 5781 | Note that a '|' must be escaped twice: once for ":set" and once for |
| 5782 | the interpretation of a command. When you use a filter called |
| 5783 | "myfilter" do it like this: > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5784 | :set makeprg=gmake\ \\\|\ myfilter |
| 5785 | < The placeholder "$*" can be given (even multiple times) to specify |
| 5786 | where the arguments will be included, for example: > |
| 5787 | :set makeprg=latex\ \\\\nonstopmode\ \\\\input\\{$*} |
| 5788 | < This option cannot be set from a |modeline| or in the |sandbox|, for |
| 5789 | security reasons. |
| 5790 | |
| 5791 | *'matchpairs'* *'mps'* |
| 5792 | 'matchpairs' 'mps' string (default "(:),{:},[:]") |
| 5793 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5794 | Characters that form pairs. The |%| command jumps from one to the |
Bram Moolenaar | a3e6bc9 | 2013-01-30 14:18:00 +0100 | [diff] [blame] | 5795 | other. |
| 5796 | Only character pairs are allowed that are different, thus you cannot |
| 5797 | jump between two double quotes. |
| 5798 | The characters must be separated by a colon. |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 5799 | The pairs must be separated by a comma. Example for including '<' and |
Bram Moolenaar | 130cbfc | 2021-04-07 21:07:20 +0200 | [diff] [blame] | 5800 | '>' (for HTML): > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5801 | :set mps+=<:> |
| 5802 | |
| 5803 | < A more exotic example, to jump between the '=' and ';' in an |
| 5804 | assignment, useful for languages like C and Java: > |
| 5805 | :au FileType c,cpp,java set mps+==:; |
| 5806 | |
| 5807 | < For a more advanced way of using "%", see the matchit.vim plugin in |
Bram Moolenaar | 01164a6 | 2017-11-02 22:58:42 +0100 | [diff] [blame] | 5808 | the $VIMRUNTIME/pack/dist/opt/matchit directory. |add-local-help| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5809 | |
| 5810 | *'matchtime'* *'mat'* |
| 5811 | 'matchtime' 'mat' number (default 5) |
| 5812 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5813 | Tenths of a second to show the matching paren, when 'showmatch' is |
| 5814 | set. Note that this is not in milliseconds, like other options that |
| 5815 | set a time. This is to be compatible with Nvi. |
| 5816 | |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 5817 | *'maxcombine'* *'mco'* |
| 5818 | 'maxcombine' 'mco' number (default 2) |
| 5819 | global |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 5820 | The maximum number of combining characters supported for displaying. |
| 5821 | Only used when 'encoding' is "utf-8". |
| 5822 | The default is OK for most languages. Hebrew may require 4. |
| 5823 | Maximum value is 6. |
| 5824 | Even when this option is set to 2 you can still edit text with more |
| 5825 | combining characters, you just can't see them. Use |g8| or |ga|. |
Christian Brabandt | 6b2c1ad | 2025-05-30 17:43:42 +0200 | [diff] [blame] | 5826 | When set to 0, you will not be able to see any combining characters. |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 5827 | See |mbyte-combining|. |
| 5828 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5829 | *'maxfuncdepth'* *'mfd'* |
| 5830 | 'maxfuncdepth' 'mfd' number (default 100) |
| 5831 | global |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 5832 | {not available when compiled without the |+eval| |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 5833 | feature} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5834 | Maximum depth of function calls for user functions. This normally |
| 5835 | catches endless recursion. When using a recursive function with |
| 5836 | more depth, set 'maxfuncdepth' to a bigger number. But this will use |
| 5837 | more memory, there is the danger of failing when memory is exhausted. |
Bram Moolenaar | bc2eada | 2017-01-02 21:27:47 +0100 | [diff] [blame] | 5838 | Increasing this limit above 200 also changes the maximum for Ex |
Bram Moolenaar | 0b0f099 | 2018-05-22 21:41:30 +0200 | [diff] [blame] | 5839 | command recursion, see |E169|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5840 | See also |:function|. |
zeertzjq | fe583b1 | 2023-12-21 16:59:26 +0100 | [diff] [blame] | 5841 | Also used for maximum depth of callback functions. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5842 | |
| 5843 | *'maxmapdepth'* *'mmd'* *E223* |
| 5844 | 'maxmapdepth' 'mmd' number (default 1000) |
| 5845 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5846 | Maximum number of times a mapping is done without resulting in a |
| 5847 | character to be used. This normally catches endless mappings, like |
| 5848 | ":map x y" with ":map y x". It still does not catch ":map g wg", |
| 5849 | because the 'w' is used before the next mapping is done. See also |
| 5850 | |key-mapping|. |
| 5851 | |
| 5852 | *'maxmem'* *'mm'* |
| 5853 | 'maxmem' 'mm' number (default between 256 to 5120 (system |
| 5854 | dependent) or half the amount of memory |
| 5855 | available) |
| 5856 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5857 | Maximum amount of memory (in Kbyte) to use for one buffer. When this |
| 5858 | limit is reached allocating extra memory for a buffer will cause |
Bram Moolenaar | cafafb3 | 2018-02-22 21:07:09 +0100 | [diff] [blame] | 5859 | other memory to be freed. |
| 5860 | The maximum usable value is about 2000000. Use this to work without a |
| 5861 | limit. |
| 5862 | The value is ignored when 'swapfile' is off. |
| 5863 | Also see 'maxmemtot'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5864 | |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 5865 | *'maxmempattern'* *'mmp'* |
| 5866 | 'maxmempattern' 'mmp' number (default 1000) |
| 5867 | global |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 5868 | Maximum amount of memory (in Kbyte) to use for pattern matching. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 5869 | The maximum value is about 2000000. Use this to work without a limit. |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 5870 | *E363* |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 5871 | When Vim runs into the limit it gives an error message and mostly |
| 5872 | behaves like CTRL-C was typed. |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 5873 | Running into the limit often means that the pattern is very |
| 5874 | inefficient or too complex. This may already happen with the pattern |
| 5875 | "\(.\)*" on a very long line. ".*" works much better. |
Bram Moolenaar | fd35811 | 2018-07-07 23:21:31 +0200 | [diff] [blame] | 5876 | Might also happen on redraw, when syntax rules try to match a complex |
| 5877 | text structure. |
| 5878 | Vim may run out of memory before hitting the 'maxmempattern' limit, in |
| 5879 | which case you get an "Out of memory" error instead. |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 5880 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5881 | *'maxmemtot'* *'mmt'* |
| 5882 | 'maxmemtot' 'mmt' number (default between 2048 and 10240 (system |
| 5883 | dependent) or half the amount of memory |
| 5884 | available) |
| 5885 | global |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 5886 | Maximum amount of memory in Kbyte to use for all buffers together. |
| 5887 | The maximum usable value is about 2000000 (2 Gbyte). Use this to work |
Bram Moolenaar | fa73534 | 2016-01-03 22:14:44 +0100 | [diff] [blame] | 5888 | without a limit. |
| 5889 | On 64 bit machines higher values might work. But hey, do you really |
| 5890 | need more than 2 Gbyte for text editing? Keep in mind that text is |
Bram Moolenaar | aa3b15d | 2016-04-21 08:53:19 +0200 | [diff] [blame] | 5891 | stored in the swap file, one can edit files > 2 Gbyte anyway. We do |
Bram Moolenaar | fa73534 | 2016-01-03 22:14:44 +0100 | [diff] [blame] | 5892 | need the memory to store undo info. |
Bram Moolenaar | cafafb3 | 2018-02-22 21:07:09 +0100 | [diff] [blame] | 5893 | Buffers with 'swapfile' off still count to the total amount of memory |
| 5894 | used. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 5895 | Also see 'maxmem'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5896 | |
| 5897 | *'menuitems'* *'mis'* |
| 5898 | 'menuitems' 'mis' number (default 25) |
| 5899 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5900 | {not available when compiled without the |+menu| |
| 5901 | feature} |
| 5902 | Maximum number of items to use in a menu. Used for menus that are |
| 5903 | generated from a list of items, e.g., the Buffers menu. Changing this |
| 5904 | option has no direct effect, the menu must be refreshed first. |
| 5905 | |
Christian Brabandt | 51d4d84 | 2024-12-06 17:26:25 +0100 | [diff] [blame] | 5906 | *'messagesopt'* *'mopt'* |
| 5907 | 'messagesopt' 'mopt' string (default "hit-enter,history:500") |
| 5908 | global |
| 5909 | |
zeertzjq | 8cc43da | 2024-12-07 16:09:08 +0100 | [diff] [blame] | 5910 | Option settings for outputting messages. It can consist of the |
Christian Brabandt | 51d4d84 | 2024-12-06 17:26:25 +0100 | [diff] [blame] | 5911 | following items. Items must be separated by a comma. |
| 5912 | |
zeertzjq | 8cc43da | 2024-12-07 16:09:08 +0100 | [diff] [blame] | 5913 | hit-enter Use a |hit-enter| prompt when the message is longer than |
Christian Brabandt | 51d4d84 | 2024-12-06 17:26:25 +0100 | [diff] [blame] | 5914 | 'cmdheight' size. |
| 5915 | |
zeertzjq | 8cc43da | 2024-12-07 16:09:08 +0100 | [diff] [blame] | 5916 | wait:{n} Instead of using a |hit-enter| prompt, simply wait for |
| 5917 | {n} milliseconds so that the user has a chance to read |
| 5918 | the message. The maximum value of {n} is 10000. Use |
| 5919 | 0 to disable the wait (but then the user may miss an |
| 5920 | important message). |
| 5921 | This item is ignored when "hit-enter" is present, but |
| 5922 | required when "hit-enter" is not present. |
Christian Brabandt | 51d4d84 | 2024-12-06 17:26:25 +0100 | [diff] [blame] | 5923 | |
| 5924 | history:{n} Determines how many entries are remembered in the |
| 5925 | |:messages| history. The maximum value is 10000. |
| 5926 | Setting it to zero clears the message history. |
zeertzjq | 8cc43da | 2024-12-07 16:09:08 +0100 | [diff] [blame] | 5927 | This item must always be present. |
Christian Brabandt | 51d4d84 | 2024-12-06 17:26:25 +0100 | [diff] [blame] | 5928 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 5929 | *'mkspellmem'* *'msm'* |
| 5930 | 'mkspellmem' 'msm' string (default "460000,2000,500") |
| 5931 | global |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 5932 | {not available when compiled without the |+syntax| |
| 5933 | feature} |
| 5934 | Parameters for |:mkspell|. This tunes when to start compressing the |
| 5935 | word tree. Compression can be slow when there are many words, but |
| 5936 | it's needed to avoid running out of memory. The amount of memory used |
| 5937 | per word depends very much on how similar the words are, that's why |
| 5938 | this tuning is complicated. |
| 5939 | |
| 5940 | There are three numbers, separated by commas: |
| 5941 | {start},{inc},{added} |
| 5942 | |
| 5943 | For most languages the uncompressed word tree fits in memory. {start} |
| 5944 | gives the amount of memory in Kbyte that can be used before any |
| 5945 | compression is done. It should be a bit smaller than the amount of |
| 5946 | memory that is available to Vim. |
| 5947 | |
| 5948 | When going over the {start} limit the {inc} number specifies the |
| 5949 | amount of memory in Kbyte that can be allocated before another |
| 5950 | compression is done. A low number means compression is done after |
| 5951 | less words are added, which is slow. A high number means more memory |
| 5952 | will be allocated. |
| 5953 | |
| 5954 | After doing compression, {added} times 1024 words can be added before |
| 5955 | the {inc} limit is ignored and compression is done when any extra |
| 5956 | amount of memory is needed. A low number means there is a smaller |
| 5957 | chance of hitting the {inc} limit, less memory is used but it's |
| 5958 | slower. |
| 5959 | |
| 5960 | The languages for which these numbers are important are Italian and |
| 5961 | Hungarian. The default works for when you have about 512 Mbyte. If |
| 5962 | you have 1 Gbyte you could use: > |
| 5963 | :set mkspellmem=900000,3000,800 |
| 5964 | < If you have less than 512 Mbyte |:mkspell| may fail for some |
| 5965 | languages, no matter what you set 'mkspellmem' to. |
| 5966 | |
dkearns | 8ebdbc9 | 2023-10-29 06:26:19 +1100 | [diff] [blame] | 5967 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 5968 | security reasons. |
Bram Moolenaar | 0760739 | 2019-05-26 19:20:43 +0200 | [diff] [blame] | 5969 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5970 | *'modeline'* *'ml'* *'nomodeline'* *'noml'* |
Bram Moolenaar | 8243a79 | 2007-05-01 17:05:03 +0000 | [diff] [blame] | 5971 | 'modeline' 'ml' boolean (Vim default: on (off for root), |
| 5972 | Vi default: off) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5973 | local to buffer |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 5974 | If 'modeline' is on 'modelines' gives the number of lines that is |
| 5975 | checked for set commands. If 'modeline' is off or 'modelines' is zero |
| 5976 | no lines are checked. See |modeline|. |
| 5977 | |
| 5978 | *'modelineexpr'* *'mle'* *'nomodelineexpr'* *'nomle'* |
| 5979 | 'modelineexpr' 'mle' boolean (default: off) |
| 5980 | global |
| 5981 | When on allow some options that are an expression to be set in the |
| 5982 | modeline. Check the option for whether it is affected by |
| 5983 | 'modelineexpr'. Also see |modeline|. |
Bram Moolenaar | 1c6fd1e | 2019-05-23 22:11:59 +0200 | [diff] [blame] | 5984 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 5985 | security reasons. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 5986 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5987 | *'modelines'* *'mls'* |
| 5988 | 'modelines' 'mls' number (default 5) |
| 5989 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5990 | If 'modeline' is on 'modelines' gives the number of lines that is |
| 5991 | checked for set commands. If 'modeline' is off or 'modelines' is zero |
| 5992 | no lines are checked. See |modeline|. |
| 5993 | NOTE: 'modeline' is set to the Vi default value when 'compatible' is |
| 5994 | set and to the Vim default value when 'compatible' is reset. |
| 5995 | |
| 5996 | *'modifiable'* *'ma'* *'nomodifiable'* *'noma'* |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 5997 | *E21* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5998 | 'modifiable' 'ma' boolean (default on) |
| 5999 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6000 | When off the buffer contents cannot be changed. The 'fileformat' and |
| 6001 | 'fileencoding' options also can't be changed. |
Bram Moolenaar | 369b6f5 | 2017-01-17 12:22:32 +0100 | [diff] [blame] | 6002 | Can be reset on startup with the |-M| command line argument. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6003 | |
| 6004 | *'modified'* *'mod'* *'nomodified'* *'nomod'* |
| 6005 | 'modified' 'mod' boolean (default off) |
Christian Brabandt | 596ad66 | 2023-08-16 00:11:09 +0200 | [diff] [blame] | 6006 | local to buffer |local-noglobal| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6007 | When on, the buffer is considered to be modified. This option is set |
| 6008 | when: |
| 6009 | 1. A change was made to the text since it was last written. Using the |
| 6010 | |undo| command to go back to the original text will reset the |
| 6011 | option. But undoing changes that were made before writing the |
| 6012 | buffer will set the option again, since the text is different from |
| 6013 | when it was written. |
| 6014 | 2. 'fileformat' or 'fileencoding' is different from its original |
| 6015 | value. The original value is set when the buffer is read or |
| 6016 | written. A ":set nomodified" command also resets the original |
| 6017 | values to the current values and the 'modified' option will be |
| 6018 | reset. |
Bram Moolenaar | 4f3f668 | 2016-03-26 23:01:59 +0100 | [diff] [blame] | 6019 | Similarly for 'eol' and 'bomb'. |
Bram Moolenaar | 5302d9e | 2011-09-14 17:55:08 +0200 | [diff] [blame] | 6020 | This option is not set when a change is made to the buffer as the |
| 6021 | result of a BufNewFile, BufRead/BufReadPost, BufWritePost, |
| 6022 | FileAppendPost or VimLeave autocommand event. See |gzip-example| for |
| 6023 | an explanation. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6024 | When 'buftype' is "nowrite" or "nofile" this option may be set, but |
| 6025 | will be ignored. |
Bram Moolenaar | b5b7562 | 2018-03-09 22:22:21 +0100 | [diff] [blame] | 6026 | Note that the text may actually be the same, e.g. 'modified' is set |
| 6027 | when using "rA" on an "A". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6028 | |
| 6029 | *'more'* *'nomore'* |
| 6030 | 'more' boolean (Vim default: on, Vi default: off) |
| 6031 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6032 | When on, listings pause when the whole screen is filled. You will get |
| 6033 | the |more-prompt|. When this option is off there are no pauses, the |
| 6034 | listing continues until finished. |
| 6035 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 6036 | set and to the Vim default value when 'compatible' is reset. |
| 6037 | |
Bram Moolenaar | 98a29d0 | 2021-01-18 19:55:44 +0100 | [diff] [blame] | 6038 | *'mouse'* |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 6039 | 'mouse' string (default "", "a" for GUI and Win32, |
Bram Moolenaar | 5b41899 | 2019-10-27 18:50:25 +0100 | [diff] [blame] | 6040 | set to "a" or "nvi" in |defaults.vim|) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6041 | global |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 6042 | Enable the use of the mouse. Works for most terminals (xterm, Win32 |
| 6043 | |win32-mouse|, QNX pterm, *BSD console with sysmouse and Linux console |
| 6044 | with gpm). For using the mouse in the GUI, see |gui-mouse|. The |
| 6045 | mouse can be enabled for different modes: |
Bram Moolenaar | 7f2e9d7 | 2017-11-11 20:58:53 +0100 | [diff] [blame] | 6046 | n Normal mode and Terminal modes |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6047 | v Visual mode |
| 6048 | i Insert mode |
| 6049 | c Command-line mode |
| 6050 | h all previous modes when editing a help file |
| 6051 | a all previous modes |
| 6052 | r for |hit-enter| and |more-prompt| prompt |
Bram Moolenaar | 95bafa2 | 2018-10-02 13:26:25 +0200 | [diff] [blame] | 6053 | Normally you would enable the mouse in all five modes with: > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6054 | :set mouse=a |
Bram Moolenaar | 5b41899 | 2019-10-27 18:50:25 +0100 | [diff] [blame] | 6055 | < If your terminal can't overrule the mouse events going to the |
| 6056 | application, use: > |
| 6057 | :set mouse=nvi |
Bram Moolenaar | 65e0d77 | 2020-06-14 17:29:55 +0200 | [diff] [blame] | 6058 | < Then you can press ":", select text for the system, and press Esc to go |
Bram Moolenaar | 5b41899 | 2019-10-27 18:50:25 +0100 | [diff] [blame] | 6059 | back to Vim using the mouse events. |
| 6060 | In |defaults.vim| "nvi" is used if the 'term' option is not matching |
| 6061 | "xterm". |
| 6062 | |
| 6063 | When the mouse is not enabled, the GUI will still use the mouse for |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6064 | modeless selection. This doesn't move the text cursor. |
| 6065 | |
| 6066 | See |mouse-using|. Also see |'clipboard'|. |
| 6067 | |
| 6068 | Note: When enabling the mouse in a terminal, copy/paste will use the |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 6069 | "* register if there is access to an X-server. The xterm handling of |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6070 | the mouse buttons can still be used by keeping the shift key pressed. |
| 6071 | Also see the 'clipboard' option. |
| 6072 | |
| 6073 | *'mousefocus'* *'mousef'* *'nomousefocus'* *'nomousef'* |
| 6074 | 'mousefocus' 'mousef' boolean (default off) |
| 6075 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6076 | {only works in the GUI} |
| 6077 | The window that the mouse pointer is on is automatically activated. |
| 6078 | When changing the window layout or window focus in another way, the |
| 6079 | mouse pointer is moved to the window with keyboard focus. Off is the |
| 6080 | default because it makes using the pull down menus a little goofy, as |
| 6081 | a pointer transit may activate a window unintentionally. |
Bram Moolenaar | 5ef1c6a | 2019-11-10 22:09:11 +0100 | [diff] [blame] | 6082 | MS-Windows: Also see 'scrollfocus' for what window is scrolled when |
Bram Moolenaar | 1d9215b | 2020-01-25 13:27:42 +0100 | [diff] [blame] | 6083 | using the mouse scroll wheel. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6084 | |
| 6085 | *'mousehide'* *'mh'* *'nomousehide'* *'nomh'* |
| 6086 | 'mousehide' 'mh' boolean (default on) |
| 6087 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6088 | {only works in the GUI} |
| 6089 | When on, the mouse pointer is hidden when characters are typed. |
| 6090 | The mouse pointer is restored when the mouse is moved. |
| 6091 | |
| 6092 | *'mousemodel'* *'mousem'* |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 6093 | 'mousemodel' 'mousem' string (default "extend", "popup" for Win32) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6094 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6095 | Sets the model to use for the mouse. The name mostly specifies what |
| 6096 | the right mouse button is used for: |
| 6097 | extend Right mouse button extends a selection. This works |
| 6098 | like in an xterm. |
| 6099 | popup Right mouse button pops up a menu. The shifted left |
| 6100 | mouse button extends a selection. This works like |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 6101 | with Microsoft Windows. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6102 | popup_setpos Like "popup", but the cursor will be moved to the |
| 6103 | position where the mouse was clicked, and thus the |
| 6104 | selected operation will act upon the clicked object. |
| 6105 | If clicking inside a selection, that selection will |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 6106 | be acted upon, i.e. no cursor move. This implies of |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6107 | course, that right clicking outside a selection will |
| 6108 | end Visual mode. |
| 6109 | Overview of what button does what for each model: |
| 6110 | mouse extend popup(_setpos) ~ |
| 6111 | left click place cursor place cursor |
| 6112 | left drag start selection start selection |
| 6113 | shift-left search word extend selection |
| 6114 | right click extend selection popup menu (place cursor) |
| 6115 | right drag extend selection - |
| 6116 | middle click paste paste |
| 6117 | |
| 6118 | In the "popup" model the right mouse button produces a pop-up menu. |
| 6119 | You need to define this first, see |popup-menu|. |
| 6120 | |
| 6121 | Note that you can further refine the meaning of buttons with mappings. |
| 6122 | See |gui-mouse-mapping|. But mappings are NOT used for modeless |
| 6123 | selection (because that's handled in the GUI code directly). |
| 6124 | |
| 6125 | The 'mousemodel' option is set by the |:behave| command. |
| 6126 | |
h_east | 5985879 | 2023-10-25 22:47:05 +0900 | [diff] [blame] | 6127 | *'mousemoveevent'* *'mousemev'* *'nomousemoveevent'* *'nomousemev'* |
Ernie Rael | c4cb544 | 2022-04-03 15:47:28 +0100 | [diff] [blame] | 6128 | 'mousemoveevent' 'mousemev' boolean (default off) |
| 6129 | global |
| 6130 | {only works in the GUI} |
| 6131 | When on, mouse move events are delivered to the input queue and are |
| 6132 | available for mapping. The default, off, avoids the mouse movement |
| 6133 | overhead except when needed. See |gui-mouse-mapping|. |
| 6134 | Warning: Setting this option can make pending mappings to be aborted |
| 6135 | when the mouse is moved. |
| 6136 | Currently only works in the GUI, may be made to work in a terminal |
| 6137 | later. |
| 6138 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6139 | *'mouseshape'* *'mouses'* *E547* |
Bram Moolenaar | f6b4010 | 2019-02-22 15:24:03 +0100 | [diff] [blame] | 6140 | 'mouseshape' 'mouses' string (default "i-r:beam,s:updown,sd:udsizing, |
| 6141 | vs:leftright,vd:lrsizing,m:no, |
| 6142 | ml:up-arrow,v:rightup-arrow") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6143 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6144 | {only available when compiled with the |+mouseshape| |
| 6145 | feature} |
| 6146 | This option tells Vim what the mouse pointer should look like in |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 6147 | different modes. The option is a comma-separated list of parts, much |
Drew Vogel | 48b19b2 | 2025-05-07 21:32:03 +0200 | [diff] [blame] | 6148 | like used for 'guicursor'. Each part consists of a mode/location-list |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6149 | and an argument-list: |
| 6150 | mode-list:shape,mode-list:shape,.. |
| 6151 | The mode-list is a dash separated list of these modes/locations: |
| 6152 | In a normal window: ~ |
| 6153 | n Normal mode |
| 6154 | v Visual mode |
| 6155 | ve Visual mode with 'selection' "exclusive" (same as 'v', |
| 6156 | if not specified) |
| 6157 | o Operator-pending mode |
| 6158 | i Insert mode |
| 6159 | r Replace mode |
| 6160 | |
| 6161 | Others: ~ |
| 6162 | c appending to the command-line |
| 6163 | ci inserting in the command-line |
| 6164 | cr replacing in the command-line |
| 6165 | m at the 'Hit ENTER' or 'More' prompts |
| 6166 | ml idem, but cursor in the last line |
| 6167 | e any mode, pointer below last window |
| 6168 | s any mode, pointer on a status line |
| 6169 | sd any mode, while dragging a status line |
| 6170 | vs any mode, pointer on a vertical separator line |
| 6171 | vd any mode, while dragging a vertical separator line |
| 6172 | a everywhere |
| 6173 | |
| 6174 | The shape is one of the following: |
| 6175 | avail name looks like ~ |
Drew Vogel | 48b19b2 | 2025-05-07 21:32:03 +0200 | [diff] [blame] | 6176 | w x g arrow Normal mouse pointer |
| 6177 | w x blank no pointer at all (use with care!) |
| 6178 | w x g beam I-beam |
| 6179 | w x g updown up-down sizing arrows |
| 6180 | w x g leftright left-right sizing arrows |
| 6181 | w x g busy The system's usual busy pointer |
| 6182 | w x g no The system's usual 'no input' pointer |
| 6183 | x g udsizing indicates up-down resizing |
| 6184 | x g lrsizing indicates left-right resizing |
| 6185 | x g crosshair like a big thin + |
| 6186 | x g hand1 black hand |
| 6187 | x g hand2 white hand |
| 6188 | x pencil what you write with |
| 6189 | x g question big ? |
| 6190 | x rightup-arrow arrow pointing right-up |
| 6191 | w x up-arrow arrow pointing up |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6192 | x <number> any X11 pointer number (see X11/cursorfont.h) |
| 6193 | |
| 6194 | The "avail" column contains a 'w' if the shape is available for Win32, |
Drew Vogel | 48b19b2 | 2025-05-07 21:32:03 +0200 | [diff] [blame] | 6195 | x for X11 (including GTK+ 2), g for GTK+ 3. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6196 | Any modes not specified or shapes not available use the normal mouse |
| 6197 | pointer. |
| 6198 | |
| 6199 | Example: > |
| 6200 | :set mouseshape=s:udsizing,m:no |
| 6201 | < will make the mouse turn to a sizing arrow over the status lines and |
| 6202 | indicate no input when the hit-enter prompt is displayed (since |
| 6203 | clicking the mouse has no effect in this state.) |
| 6204 | |
| 6205 | *'mousetime'* *'mouset'* |
| 6206 | 'mousetime' 'mouset' number (default 500) |
| 6207 | global |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 6208 | Only for GUI, Win32 and Unix with xterm. Defines the maximum |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6209 | time in msec between two mouse clicks for the second click to be |
| 6210 | recognized as a multi click. |
| 6211 | |
Shougo Matsushita | 4bd9b2b | 2024-11-14 22:31:48 +0100 | [diff] [blame] | 6212 | |
laburnumT | 3f7855a | 2023-12-05 18:37:03 +0100 | [diff] [blame] | 6213 | *'mzquantum'* *'mzq'* |
| 6214 | 'mzquantum' 'mzq' number (default 100) |
| 6215 | global |
| 6216 | {not available when compiled without the |+mzscheme| |
| 6217 | feature} |
| 6218 | The number of milliseconds between polls for MzScheme threads. |
| 6219 | Negative or zero value means no thread scheduling. |
| 6220 | NOTE: This option is set to the Vim default value when 'compatible' |
| 6221 | is reset. |
| 6222 | |
Bram Moolenaar | 0ab35b2 | 2017-10-08 17:41:37 +0200 | [diff] [blame] | 6223 | *'mzschemedll'* |
| 6224 | 'mzschemedll' string (default depends on the build) |
| 6225 | global |
Bram Moolenaar | 0ab35b2 | 2017-10-08 17:41:37 +0200 | [diff] [blame] | 6226 | {only available when compiled with the |+mzscheme/dyn| |
| 6227 | feature} |
| 6228 | Specifies the name of the MzScheme shared library. The default is |
| 6229 | DYNAMIC_MZSCH_DLL which was specified at compile time. |
| 6230 | Environment variables are expanded |:set_env|. |
Bram Moolenaar | b0d45e7 | 2017-11-05 18:19:24 +0100 | [diff] [blame] | 6231 | The value must be set in the |vimrc| script or earlier. In the |
Bram Moolenaar | 01164a6 | 2017-11-02 22:58:42 +0100 | [diff] [blame] | 6232 | startup, before the |load-plugins| step. |
Bram Moolenaar | 0ab35b2 | 2017-10-08 17:41:37 +0200 | [diff] [blame] | 6233 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6234 | security reasons. |
| 6235 | |
| 6236 | *'mzschemegcdll'* |
| 6237 | 'mzschemegcdll' string (default depends on the build) |
| 6238 | global |
Bram Moolenaar | 0ab35b2 | 2017-10-08 17:41:37 +0200 | [diff] [blame] | 6239 | {only available when compiled with the |+mzscheme/dyn| |
| 6240 | feature} |
| 6241 | Specifies the name of the MzScheme GC shared library. The default is |
| 6242 | DYNAMIC_MZGC_DLL which was specified at compile time. |
| 6243 | The value can be equal to 'mzschemedll' if it includes the GC code. |
| 6244 | Environment variables are expanded |:set_env|. |
| 6245 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6246 | security reasons. |
| 6247 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6248 | *'nrformats'* *'nf'* |
Bram Moolenaar | 8c08b5b | 2016-07-28 22:24:15 +0200 | [diff] [blame] | 6249 | 'nrformats' 'nf' string (default "bin,octal,hex", |
| 6250 | set to "bin,hex" in |defaults.vim|) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6251 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6252 | This defines what bases Vim will consider for numbers when using the |
| 6253 | CTRL-A and CTRL-X commands for adding to and subtracting from a number |
| 6254 | respectively; see |CTRL-A| for more info on these commands. |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 6255 | alpha If included, single alphabetical characters will be |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6256 | incremented or decremented. This is useful for a list with a |
Bram Moolenaar | 3848e00 | 2016-03-19 18:42:29 +0100 | [diff] [blame] | 6257 | letter index a), b), etc. *octal-nrformats* |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 6258 | octal If included, numbers that start with a zero will be considered |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6259 | to be octal. Example: Using CTRL-A on "007" results in "010". |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 6260 | hex If included, numbers starting with "0x" or "0X" will be |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6261 | considered to be hexadecimal. Example: Using CTRL-X on |
| 6262 | "0x100" results in "0x0ff". |
Bram Moolenaar | 25e4fcd | 2016-01-09 14:57:47 +0100 | [diff] [blame] | 6263 | bin If included, numbers starting with "0b" or "0B" will be |
| 6264 | considered to be binary. Example: Using CTRL-X on |
| 6265 | "0b1000" subtracts one, resulting in "0b0111". |
Bram Moolenaar | aaad995 | 2020-05-31 15:08:59 +0200 | [diff] [blame] | 6266 | unsigned If included, numbers are recognized as unsigned. Thus a |
| 6267 | leading dash or negative sign won't be considered as part of |
| 6268 | the number. Examples: |
| 6269 | Using CTRL-X on "2020" in "9-2020" results in "9-2019" |
| 6270 | (without "unsigned" it would become "9-2021"). |
| 6271 | Using CTRL-A on "2020" in "9-2020" results in "9-2021" |
| 6272 | (without "unsigned" it would become "9-2019"). |
Bram Moolenaar | acc2240 | 2020-06-07 21:07:18 +0200 | [diff] [blame] | 6273 | Using CTRL-X on "0" or CTRL-A on "18446744073709551615" |
| 6274 | (2^64 - 1) has no effect, overflow is prevented. |
distobs | 25ac6d6 | 2024-07-06 17:50:09 +0200 | [diff] [blame] | 6275 | blank If included, treat numbers as signed or unsigned based on |
h-east | 52e7cc2 | 2024-07-28 17:03:29 +0200 | [diff] [blame] | 6276 | preceding whitespace. If a number with a leading dash has its |
distobs | 25ac6d6 | 2024-07-06 17:50:09 +0200 | [diff] [blame] | 6277 | dash immediately preceded by a non-whitespace character (i.e., |
| 6278 | not a tab or a " "), the negative sign won't be considered as |
| 6279 | part of the number. For example: |
| 6280 | Using CTRL-A on "14" in "Carbon-14" results in "Carbon-15" |
| 6281 | (without "blank" it would become "Carbon-13"). |
| 6282 | Using CTRL-X on "8" in "Carbon -8" results in "Carbon -9" |
h-east | 52e7cc2 | 2024-07-28 17:03:29 +0200 | [diff] [blame] | 6283 | (because -8 is preceded by whitespace. If "unsigned" was |
distobs | 25ac6d6 | 2024-07-06 17:50:09 +0200 | [diff] [blame] | 6284 | set, it would result in "Carbon -7"). |
| 6285 | If this format is included, overflow is prevented as if |
h-east | 52e7cc2 | 2024-07-28 17:03:29 +0200 | [diff] [blame] | 6286 | "unsigned" were set. If both this format and "unsigned" are |
distobs | 25ac6d6 | 2024-07-06 17:50:09 +0200 | [diff] [blame] | 6287 | included, "unsigned" will take precedence. |
| 6288 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6289 | Numbers which simply begin with a digit in the range 1-9 are always |
| 6290 | considered decimal. This also happens for numbers that are not |
| 6291 | recognized as octal or hex. |
| 6292 | |
| 6293 | *'number'* *'nu'* *'nonumber'* *'nonu'* |
| 6294 | 'number' 'nu' boolean (default off) |
| 6295 | local to window |
| 6296 | Print the line number in front of each line. When the 'n' option is |
| 6297 | excluded from 'cpoptions' a wrapped line will not use the column of |
| 6298 | line numbers (this is the default when 'compatible' isn't set). |
Bram Moolenaar | 592e0a2 | 2004-07-03 16:05:59 +0000 | [diff] [blame] | 6299 | The 'numberwidth' option can be used to set the room used for the line |
| 6300 | number. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6301 | When a long, wrapped line doesn't start with the first character, '-' |
| 6302 | characters are put before the number. |
James McCoy | a80aad7 | 2021-12-22 19:45:28 +0000 | [diff] [blame] | 6303 | For highlighting see |hl-LineNr|, and |hl-CursorLineNr|, and the |
| 6304 | |:sign-define| "numhl" argument. |
Bram Moolenaar | 203d04d | 2013-06-06 21:36:40 +0200 | [diff] [blame] | 6305 | *number_relativenumber* |
| 6306 | The 'relativenumber' option changes the displayed number to be |
| 6307 | relative to the cursor. Together with 'number' there are these |
| 6308 | four combinations (cursor in line 3): |
| 6309 | |
Bram Moolenaar | 3848e00 | 2016-03-19 18:42:29 +0100 | [diff] [blame] | 6310 | 'nonu' 'nu' 'nonu' 'nu' |
Bram Moolenaar | 203d04d | 2013-06-06 21:36:40 +0200 | [diff] [blame] | 6311 | 'nornu' 'nornu' 'rnu' 'rnu' |
| 6312 | |
| 6313 | |apple | 1 apple | 2 apple | 2 apple |
| 6314 | |pear | 2 pear | 1 pear | 1 pear |
| 6315 | |nobody | 3 nobody | 0 nobody |3 nobody |
| 6316 | |there | 4 there | 1 there | 1 there |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6317 | |
Bram Moolenaar | 592e0a2 | 2004-07-03 16:05:59 +0000 | [diff] [blame] | 6318 | *'numberwidth'* *'nuw'* |
| 6319 | 'numberwidth' 'nuw' number (Vim default: 4 Vi default: 8) |
| 6320 | local to window |
Bram Moolenaar | 325b7a2 | 2004-07-05 15:58:32 +0000 | [diff] [blame] | 6321 | {only available when compiled with the |+linebreak| |
| 6322 | feature} |
Bram Moolenaar | 592e0a2 | 2004-07-03 16:05:59 +0000 | [diff] [blame] | 6323 | Minimal number of columns to use for the line number. Only relevant |
Bram Moolenaar | 6448667 | 2010-05-16 15:46:46 +0200 | [diff] [blame] | 6324 | when the 'number' or 'relativenumber' option is set or printing lines |
| 6325 | with a line number. Since one space is always between the number and |
| 6326 | the text, there is one less character for the number itself. |
Bram Moolenaar | 592e0a2 | 2004-07-03 16:05:59 +0000 | [diff] [blame] | 6327 | The value is the minimum width. A bigger width is used when needed to |
Bram Moolenaar | 6448667 | 2010-05-16 15:46:46 +0200 | [diff] [blame] | 6328 | fit the highest line number in the buffer respectively the number of |
| 6329 | rows in the window, depending on whether 'number' or 'relativenumber' |
| 6330 | is set. Thus with the Vim default of 4 there is room for a line number |
| 6331 | up to 999. When the buffer has 1000 lines five columns will be used. |
Bram Moolenaar | f8a0712 | 2019-07-01 22:06:07 +0200 | [diff] [blame] | 6332 | The minimum value is 1, the maximum value is 20. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 6333 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 6334 | set and to the Vim default value when 'compatible' is reset. |
Bram Moolenaar | 592e0a2 | 2004-07-03 16:05:59 +0000 | [diff] [blame] | 6335 | |
Bram Moolenaar | f75a963 | 2005-09-13 21:20:47 +0000 | [diff] [blame] | 6336 | *'omnifunc'* *'ofu'* |
| 6337 | 'omnifunc' 'ofu' string (default: empty) |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 6338 | local to buffer |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 6339 | {not available when compiled without the |+eval| |
Bram Moolenaar | e2c453d | 2019-08-21 14:37:09 +0200 | [diff] [blame] | 6340 | feature} |
Bram Moolenaar | c7486e0 | 2005-12-29 22:48:26 +0000 | [diff] [blame] | 6341 | This option specifies a function to be used for Insert mode omni |
| 6342 | completion with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O| |
Bram Moolenaar | 280f126 | 2006-01-30 00:14:18 +0000 | [diff] [blame] | 6343 | See |complete-functions| for an explanation of how the function is |
Yegappan Lakshmanan | 8658c75 | 2021-12-03 11:09:29 +0000 | [diff] [blame] | 6344 | invoked and what it should return. The value can be the name of a |
| 6345 | function, a |lambda| or a |Funcref|. See |option-value-function| for |
| 6346 | more information. |
Bram Moolenaar | 043545e | 2006-10-10 16:44:07 +0000 | [diff] [blame] | 6347 | This option is usually set by a filetype plugin: |
Bram Moolenaar | 9c10238 | 2006-05-03 21:26:49 +0000 | [diff] [blame] | 6348 | |:filetype-plugin-on| |
Bram Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 6349 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6350 | security reasons. |
Bram Moolenaar | e344bea | 2005-09-01 20:46:49 +0000 | [diff] [blame] | 6351 | |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 6352 | *'opendevice'* *'odev'* *'noopendevice'* *'noodev'* |
Bram Moolenaar | 043545e | 2006-10-10 16:44:07 +0000 | [diff] [blame] | 6353 | 'opendevice' 'odev' boolean (default off) |
| 6354 | global |
Bram Moolenaar | 6f4754b | 2022-01-23 12:07:04 +0000 | [diff] [blame] | 6355 | {only for MS-Windows} *E796* |
Bram Moolenaar | 043545e | 2006-10-10 16:44:07 +0000 | [diff] [blame] | 6356 | Enable reading and writing from devices. This may get Vim stuck on a |
| 6357 | device that can be opened but doesn't actually do the I/O. Therefore |
| 6358 | it is off by default. |
| 6359 | Note that on MS-Windows editing "aux.h", "lpt1.txt" and the like also |
| 6360 | result in editing a device. |
| 6361 | |
Bram Moolenaar | 2c7a29c | 2005-12-12 22:02:31 +0000 | [diff] [blame] | 6362 | *'operatorfunc'* *'opfunc'* |
| 6363 | 'operatorfunc' 'opfunc' string (default: empty) |
| 6364 | global |
Bram Moolenaar | 2c7a29c | 2005-12-12 22:02:31 +0000 | [diff] [blame] | 6365 | This option specifies a function to be called by the |g@| operator. |
Yegappan Lakshmanan | 777175b | 2021-11-18 22:08:57 +0000 | [diff] [blame] | 6366 | See |:map-operator| for more info and an example. The value can be |
| 6367 | the name of a function, a |lambda| or a |Funcref|. See |
| 6368 | |option-value-function| for more information. |
Bram Moolenaar | 2c7a29c | 2005-12-12 22:02:31 +0000 | [diff] [blame] | 6369 | |
| 6370 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6371 | security reasons. |
| 6372 | |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 6373 | *'osfiletype'* *'oft'* |
| 6374 | 'osfiletype' 'oft' string (default: "") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6375 | local to buffer |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 6376 | This option was supported on RISC OS, which has been removed. |
| 6377 | |
Bram Moolenaar | f6fee0e | 2016-02-21 23:02:49 +0100 | [diff] [blame] | 6378 | *'packpath'* *'pp'* |
| 6379 | 'packpath' 'pp' string (default: see 'runtimepath') |
Bram Moolenaar | f6fee0e | 2016-02-21 23:02:49 +0100 | [diff] [blame] | 6380 | Directories used to find packages. See |packages|. |
dkearns | 8ebdbc9 | 2023-10-29 06:26:19 +1100 | [diff] [blame] | 6381 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6382 | security reasons. |
Bram Moolenaar | f6fee0e | 2016-02-21 23:02:49 +0100 | [diff] [blame] | 6383 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6384 | *'paragraphs'* *'para'* |
Bram Moolenaar | 57e4846 | 2008-03-12 16:38:55 +0000 | [diff] [blame] | 6385 | 'paragraphs' 'para' string (default "IPLPPPQPP TPHPLIPpLpItpplpipbp") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6386 | global |
| 6387 | Specifies the nroff macros that separate paragraphs. These are pairs |
| 6388 | of two letters (see |object-motions|). |
| 6389 | |
| 6390 | *'paste'* *'nopaste'* |
| 6391 | 'paste' boolean (default off) |
| 6392 | global |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 6393 | Put Vim in Paste mode. This is useful if you want to cut or copy |
| 6394 | some text from one window and paste it in Vim. This will avoid |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6395 | unexpected effects. |
| 6396 | Setting this option is useful when using Vim in a terminal, where Vim |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 6397 | cannot distinguish between typed text and pasted text. In the GUI, Vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6398 | knows about pasting and will mostly do the right thing without 'paste' |
| 6399 | being set. The same is true for a terminal where Vim handles the |
| 6400 | mouse clicks itself. |
Bram Moolenaar | 2ce06f6 | 2005-01-31 19:19:04 +0000 | [diff] [blame] | 6401 | This option is reset when starting the GUI. Thus if you set it in |
| 6402 | your .vimrc it will work in a terminal, but not in the GUI. Setting |
| 6403 | 'paste' in the GUI has side effects: e.g., the Paste toolbar button |
| 6404 | will no longer work in Insert mode, because it uses a mapping. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6405 | When the 'paste' option is switched on (also when it was already on): |
| 6406 | - mapping in Insert mode and Command-line mode is disabled |
| 6407 | - abbreviations are disabled |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6408 | - 'autoindent' is reset |
Bram Moolenaar | ca63501 | 2015-09-25 20:34:21 +0200 | [diff] [blame] | 6409 | - 'expandtab' is reset |
Bram Moolenaar | 4d8f476 | 2021-06-27 15:18:56 +0200 | [diff] [blame] | 6410 | - 'hkmap' is reset |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6411 | - 'revins' is reset |
| 6412 | - 'ruler' is reset |
| 6413 | - 'showmatch' is reset |
Bram Moolenaar | ca63501 | 2015-09-25 20:34:21 +0200 | [diff] [blame] | 6414 | - 'smarttab' is reset |
| 6415 | - 'softtabstop' is set to 0 |
| 6416 | - 'textwidth' is set to 0 |
| 6417 | - 'wrapmargin' is set to 0 |
Bram Moolenaar | 4d8f476 | 2021-06-27 15:18:56 +0200 | [diff] [blame] | 6418 | - 'varsofttabstop' is made empty |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6419 | These options keep their value, but their effect is disabled: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6420 | - 'cindent' |
Bram Moolenaar | 4d8f476 | 2021-06-27 15:18:56 +0200 | [diff] [blame] | 6421 | - 'formatoptions' is used like it is empty |
Bram Moolenaar | ca63501 | 2015-09-25 20:34:21 +0200 | [diff] [blame] | 6422 | - 'indentexpr' |
| 6423 | - 'lisp' |
Bram Moolenaar | 4d8f476 | 2021-06-27 15:18:56 +0200 | [diff] [blame] | 6424 | - 'smartindent' |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6425 | NOTE: When you start editing another file while the 'paste' option is |
| 6426 | on, settings from the modelines or autocommands may change the |
| 6427 | settings again, causing trouble when pasting text. You might want to |
| 6428 | set the 'paste' option again. |
| 6429 | When the 'paste' option is reset the mentioned options are restored to |
| 6430 | the value before the moment 'paste' was switched from off to on. |
| 6431 | Resetting 'paste' before ever setting it does not have any effect. |
| 6432 | Since mapping doesn't work while 'paste' is active, you need to use |
| 6433 | the 'pastetoggle' option to toggle the 'paste' option with some key. |
| 6434 | |
| 6435 | *'pastetoggle'* *'pt'* |
| 6436 | 'pastetoggle' 'pt' string (default "") |
| 6437 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6438 | When non-empty, specifies the key sequence that toggles the 'paste' |
| 6439 | option. This is like specifying a mapping: > |
| 6440 | :map {keys} :set invpaste<CR> |
| 6441 | < Where {keys} is the value of 'pastetoggle'. |
| 6442 | The difference is that it will work even when 'paste' is set. |
| 6443 | 'pastetoggle' works in Insert mode and Normal mode, but not in |
| 6444 | Command-line mode. |
| 6445 | Mappings are checked first, thus overrule 'pastetoggle'. However, |
| 6446 | when 'paste' is on mappings are ignored in Insert mode, thus you can do |
| 6447 | this: > |
| 6448 | :map <F10> :set paste<CR> |
| 6449 | :map <F11> :set nopaste<CR> |
| 6450 | :imap <F10> <C-O>:set paste<CR> |
| 6451 | :imap <F11> <nop> |
| 6452 | :set pastetoggle=<F11> |
| 6453 | < This will make <F10> start paste mode and <F11> stop paste mode. |
| 6454 | Note that typing <F10> in paste mode inserts "<F10>", since in paste |
| 6455 | mode everything is inserted literally, except the 'pastetoggle' key |
| 6456 | sequence. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 6457 | When the value has several bytes 'ttimeoutlen' applies. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6458 | |
| 6459 | *'pex'* *'patchexpr'* |
| 6460 | 'patchexpr' 'pex' string (default "") |
| 6461 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6462 | {not available when compiled without the |+diff| |
| 6463 | feature} |
| 6464 | Expression which is evaluated to apply a patch to a file and generate |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 6465 | the resulting new version of the file. See |diff-patchexpr|. |
dkearns | 8ebdbc9 | 2023-10-29 06:26:19 +1100 | [diff] [blame] | 6466 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6467 | security reasons. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6468 | |
Bram Moolenaar | dbc2802 | 2014-07-26 13:40:44 +0200 | [diff] [blame] | 6469 | *'patchmode'* *'pm'* *E205* *E206* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6470 | 'patchmode' 'pm' string (default "") |
| 6471 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6472 | When non-empty the oldest version of a file is kept. This can be used |
| 6473 | to keep the original version of a file if you are changing files in a |
| 6474 | source distribution. Only the first time that a file is written a |
| 6475 | copy of the original file will be kept. The name of the copy is the |
| 6476 | name of the original file with the string in the 'patchmode' option |
| 6477 | appended. This option should start with a dot. Use a string like |
Bram Moolenaar | df980db | 2017-12-24 13:22:00 +0100 | [diff] [blame] | 6478 | ".orig" or ".org". 'backupdir' must not be empty for this to work |
| 6479 | (Detail: The backup file is renamed to the patchmode file after the |
| 6480 | new file has been successfully written, that's why it must be possible |
| 6481 | to write a backup file). If there was no file to be backed up, an |
| 6482 | empty file is created. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6483 | When the 'backupskip' pattern matches, a patchmode file is not made. |
| 6484 | Using 'patchmode' for compressed files appends the extension at the |
| 6485 | end (e.g., "file.gz.orig"), thus the resulting name isn't always |
| 6486 | recognized as a compressed file. |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 6487 | Only normal file name characters can be used, "/\*?[|<>" are illegal. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6488 | |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 6489 | *'path'* *'pa'* *E343* *E345* *E347* *E854* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6490 | 'path' 'pa' string (default on Unix: ".,/usr/include,," |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6491 | other systems: ".,,") |
| 6492 | global or local to buffer |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6493 | This is a list of directories which will be searched when using the |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 6494 | |gf|, [f, ]f, ^Wf, |:find|, |:sfind|, |:tabfind| and other commands, |
| 6495 | provided that the file being searched for has a relative path (not |
| 6496 | starting with "/", "./" or "../"). The directories in the 'path' |
| 6497 | option may be relative or absolute. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6498 | - Use commas to separate directory names: > |
| 6499 | :set path=.,/usr/local/include,/usr/include |
| 6500 | < - Spaces can also be used to separate directory names (for backwards |
| 6501 | compatibility with version 3.0). To have a space in a directory |
| 6502 | name, precede it with an extra backslash, and escape the space: > |
| 6503 | :set path=.,/dir/with\\\ space |
| 6504 | < - To include a comma in a directory name precede it with an extra |
| 6505 | backslash: > |
| 6506 | :set path=.,/dir/with\\,comma |
| 6507 | < - To search relative to the directory of the current file, use: > |
| 6508 | :set path=. |
| 6509 | < - To search in the current directory use an empty string between two |
| 6510 | commas: > |
| 6511 | :set path=,, |
| 6512 | < - A directory name may end in a ':' or '/'. |
| 6513 | - Environment variables are expanded |:set_env|. |
| 6514 | - When using |netrw.vim| URLs can be used. For example, adding |
| 6515 | "http://www.vim.org" will make ":find index.html" work. |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 6516 | - Search upwards and downwards in a directory tree using "*", "**" and |
| 6517 | ";". See |file-searching| for info and syntax. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6518 | - Careful with '\' characters, type two to get one in the option: > |
| 6519 | :set path=.,c:\\include |
| 6520 | < Or just use '/' instead: > |
| 6521 | :set path=.,c:/include |
| 6522 | < Don't forget "." or files won't even be found in the same directory as |
| 6523 | the file! |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 6524 | The maximum length is limited. How much depends on the system, mostly |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6525 | it is something like 256 or 1024 characters. |
| 6526 | You can check if all the include files are found, using the value of |
| 6527 | 'path', see |:checkpath|. |
| 6528 | The use of |:set+=| and |:set-=| is preferred when adding or removing |
| 6529 | directories from the list. This avoids problems when a future version |
| 6530 | uses another default. To remove the current directory use: > |
| 6531 | :set path-= |
| 6532 | < To add the current directory use: > |
| 6533 | :set path+= |
| 6534 | < To use an environment variable, you probably need to replace the |
| 6535 | separator. Here is an example to append $INCL, in which directory |
Dominique Pellé | df62c62 | 2024-07-15 20:29:59 +0200 | [diff] [blame] | 6536 | names are separated with a semicolon: > |
Bram Moolenaar | c51cf03 | 2022-02-26 12:25:45 +0000 | [diff] [blame] | 6537 | :let &path = &path .. "," .. substitute($INCL, ';', ',', 'g') |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6538 | < Replace the ';' with a ':' or whatever separator is used. Note that |
| 6539 | this doesn't work when $INCL contains a comma or white space. |
| 6540 | |
Bram Moolenaar | 37c64c7 | 2017-09-19 22:06:03 +0200 | [diff] [blame] | 6541 | *'perldll'* |
| 6542 | 'perldll' string (default depends on the build) |
| 6543 | global |
Bram Moolenaar | 37c64c7 | 2017-09-19 22:06:03 +0200 | [diff] [blame] | 6544 | {only available when compiled with the |+perl/dyn| |
| 6545 | feature} |
| 6546 | Specifies the name of the Perl shared library. The default is |
| 6547 | DYNAMIC_PERL_DLL, which was specified at compile time. |
| 6548 | Environment variables are expanded |:set_env|. |
| 6549 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6550 | security reasons. |
| 6551 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6552 | *'preserveindent'* *'pi'* *'nopreserveindent'* *'nopi'* |
| 6553 | 'preserveindent' 'pi' boolean (default off) |
| 6554 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6555 | When changing the indent of the current line, preserve as much of the |
| 6556 | indent structure as possible. Normally the indent is replaced by a |
| 6557 | series of tabs followed by spaces as required (unless |'expandtab'| is |
| 6558 | enabled, in which case only spaces are used). Enabling this option |
| 6559 | means the indent will preserve as many existing characters as possible |
| 6560 | for indenting, and only add additional tabs or spaces as required. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 6561 | 'expandtab' does not apply to the preserved white space, a Tab remains |
| 6562 | a Tab. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6563 | NOTE: When using ">>" multiple times the resulting indent is a mix of |
| 6564 | tabs and spaces. You might not like this. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 6565 | NOTE: This option is reset when 'compatible' is set. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6566 | Also see 'copyindent'. |
| 6567 | Use |:retab| to clean up white space. |
| 6568 | |
| 6569 | *'previewheight'* *'pvh'* |
| 6570 | 'previewheight' 'pvh' number (default 12) |
| 6571 | global |
Bram Moolenaar | 62a0cb4 | 2019-08-18 16:35:23 +0200 | [diff] [blame] | 6572 | {not available when compiled without the |+quickfix| |
| 6573 | feature} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6574 | Default height for a preview window. Used for |:ptag| and associated |
Bram Moolenaar | 7964873 | 2019-07-18 21:43:07 +0200 | [diff] [blame] | 6575 | commands. Used for |CTRL-W_}| when no count is given. Not used when |
| 6576 | 'previewpopup' is set. |
| 6577 | |
| 6578 | *'previewpopup'* *'pvp'* |
| 6579 | 'previewpopup' 'pvp' string (default empty) |
| 6580 | global |
Bram Moolenaar | 62a0cb4 | 2019-08-18 16:35:23 +0200 | [diff] [blame] | 6581 | {not available when compiled without the |+textprop| |
| 6582 | or |+quickfix| feature} |
Bram Moolenaar | 7964873 | 2019-07-18 21:43:07 +0200 | [diff] [blame] | 6583 | When not empty a popup window is used for commands that would open a |
| 6584 | preview window. See |preview-popup|. |
Bram Moolenaar | 576a4a6 | 2019-08-18 15:25:17 +0200 | [diff] [blame] | 6585 | Not used for the insert completion info, add "popup" to |
| 6586 | 'completeopt' for that. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6587 | |
| 6588 | *'previewwindow'* *'nopreviewwindow'* |
| 6589 | *'pvw'* *'nopvw'* *E590* |
| 6590 | 'previewwindow' 'pvw' boolean (default off) |
Christian Brabandt | 596ad66 | 2023-08-16 00:11:09 +0200 | [diff] [blame] | 6591 | local to window |local-noglobal| |
Bram Moolenaar | 62a0cb4 | 2019-08-18 16:35:23 +0200 | [diff] [blame] | 6592 | {not available when compiled without the |+quickfix| |
| 6593 | feature} |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 6594 | Identifies the preview window. Only one window can have this option |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6595 | set. It's normally not set directly, but by using one of the commands |
| 6596 | |:ptag|, |:pedit|, etc. |
| 6597 | |
| 6598 | *'printdevice'* *'pdev'* |
| 6599 | 'printdevice' 'pdev' string (default empty) |
| 6600 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6601 | {only available when compiled with the |+printer| |
| 6602 | feature} |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 6603 | The name of the printer to be used for |:hardcopy|. |
| 6604 | See |pdev-option|. |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 6605 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6606 | security reasons. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6607 | |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 6608 | *'printencoding'* *'penc'* |
Bram Moolenaar | 95bafa2 | 2018-10-02 13:26:25 +0200 | [diff] [blame] | 6609 | 'printencoding' 'penc' string (default empty, except for some systems) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6610 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6611 | {only available when compiled with the |+printer| |
| 6612 | and |+postscript| features} |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 6613 | Sets the character encoding used when printing. |
| 6614 | See |penc-option|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6615 | |
| 6616 | *'printexpr'* *'pexpr'* |
Bram Moolenaar | 95bafa2 | 2018-10-02 13:26:25 +0200 | [diff] [blame] | 6617 | 'printexpr' 'pexpr' string (default: see below) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6618 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6619 | {only available when compiled with the |+printer| |
| 6620 | and |+postscript| features} |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 6621 | Expression used to print the PostScript produced with |:hardcopy|. |
| 6622 | See |pexpr-option|. |
Bram Moolenaar | 5162822 | 2016-12-01 23:03:28 +0100 | [diff] [blame] | 6623 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6624 | security reasons. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6625 | |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 6626 | *'printfont'* *'pfn'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6627 | 'printfont' 'pfn' string (default "courier") |
| 6628 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6629 | {only available when compiled with the |+printer| |
| 6630 | feature} |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 6631 | The name of the font that will be used for |:hardcopy|. |
| 6632 | See |pfn-option|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6633 | |
| 6634 | *'printheader'* *'pheader'* |
| 6635 | 'printheader' 'pheader' string (default "%<%f%h%m%=Page %N") |
| 6636 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6637 | {only available when compiled with the |+printer| |
| 6638 | feature} |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 6639 | The format of the header produced in |:hardcopy| output. |
| 6640 | See |pheader-option|. |
| 6641 | |
| 6642 | *'printmbcharset'* *'pmbcs'* |
| 6643 | 'printmbcharset' 'pmbcs' string (default "") |
| 6644 | global |
Bram Moolenaar | 4c92e75 | 2019-02-17 21:18:32 +0100 | [diff] [blame] | 6645 | {only available when compiled with the |+printer| |
| 6646 | and |+postscript| features} |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 6647 | The CJK character set to be used for CJK output from |:hardcopy|. |
| 6648 | See |pmbcs-option|. |
| 6649 | |
| 6650 | *'printmbfont'* *'pmbfn'* |
| 6651 | 'printmbfont' 'pmbfn' string (default "") |
| 6652 | global |
Bram Moolenaar | 4c92e75 | 2019-02-17 21:18:32 +0100 | [diff] [blame] | 6653 | {only available when compiled with the |+printer| |
| 6654 | and |+postscript| features} |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 6655 | List of font names to be used for CJK output from |:hardcopy|. |
| 6656 | See |pmbfn-option|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6657 | |
| 6658 | *'printoptions'* *'popt'* |
| 6659 | 'printoptions' 'popt' string (default "") |
| 6660 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6661 | {only available when compiled with |+printer| feature} |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 6662 | List of items that control the format of the output of |:hardcopy|. |
| 6663 | See |popt-option|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6664 | |
Bram Moolenaar | 26a60b4 | 2005-02-22 08:49:11 +0000 | [diff] [blame] | 6665 | *'prompt'* *'noprompt'* |
| 6666 | 'prompt' boolean (default on) |
| 6667 | global |
| 6668 | When on a ":" prompt is used in Ex mode. |
| 6669 | |
Bram Moolenaar | 7d47b6e | 2006-03-15 22:59:18 +0000 | [diff] [blame] | 6670 | *'pumheight'* *'ph'* |
| 6671 | 'pumheight' 'ph' number (default 0) |
| 6672 | global |
Bram Moolenaar | 06a89a5 | 2006-04-29 22:01:03 +0000 | [diff] [blame] | 6673 | Determines the maximum number of items to show in the popup menu for |
| 6674 | Insert mode completion. When zero as much space as available is used. |
Bram Moolenaar | 7d47b6e | 2006-03-15 22:59:18 +0000 | [diff] [blame] | 6675 | |ins-completion-menu|. |
| 6676 | |
glepnir | 88d7593 | 2025-03-27 20:09:07 +0100 | [diff] [blame] | 6677 | *'pummaxwidth'* *'pmw'* |
| 6678 | 'pummaxwidth' 'pmw' number (default 0) |
| 6679 | global |
| 6680 | Determines the maximum width to use for the popup menu for completion. |
| 6681 | When zero, there is no maximum width limit, otherwise the popup menu |
| 6682 | will never be wider than this value. Truncated text will be indicated |
glepnir | b876204 | 2025-04-07 20:57:14 +0200 | [diff] [blame] | 6683 | by "trunc" value of 'fillchars' option. |
| 6684 | |
| 6685 | This option takes precedence over 'pumwidth'. |
glepnir | 88d7593 | 2025-03-27 20:09:07 +0100 | [diff] [blame] | 6686 | |ins-completion-menu|. |
| 6687 | |
Bram Moolenaar | a8f04aa | 2018-02-10 15:36:55 +0100 | [diff] [blame] | 6688 | *'pumwidth'* *'pw'* |
Bram Moolenaar | cafafb3 | 2018-02-22 21:07:09 +0100 | [diff] [blame] | 6689 | 'pumwidth' 'pw' number (default 15) |
Bram Moolenaar | a8f04aa | 2018-02-10 15:36:55 +0100 | [diff] [blame] | 6690 | global |
Bram Moolenaar | 22f1d0e | 2018-02-27 14:53:30 +0100 | [diff] [blame] | 6691 | Determines the minimum width to use for the popup menu for Insert mode |
Bram Moolenaar | cafafb3 | 2018-02-22 21:07:09 +0100 | [diff] [blame] | 6692 | completion. |ins-completion-menu|. |
Bram Moolenaar | a8f04aa | 2018-02-10 15:36:55 +0100 | [diff] [blame] | 6693 | |
Bram Moolenaar | d94464e | 2015-11-02 15:28:18 +0100 | [diff] [blame] | 6694 | *'pythondll'* |
Bram Moolenaar | 3848e00 | 2016-03-19 18:42:29 +0100 | [diff] [blame] | 6695 | 'pythondll' string (default depends on the build) |
Bram Moolenaar | d94464e | 2015-11-02 15:28:18 +0100 | [diff] [blame] | 6696 | global |
Bram Moolenaar | d94464e | 2015-11-02 15:28:18 +0100 | [diff] [blame] | 6697 | {only available when compiled with the |+python/dyn| |
| 6698 | feature} |
Bram Moolenaar | 25e4fcd | 2016-01-09 14:57:47 +0100 | [diff] [blame] | 6699 | Specifies the name of the Python 2.x shared library. The default is |
| 6700 | DYNAMIC_PYTHON_DLL, which was specified at compile time. |
Bram Moolenaar | aa3b15d | 2016-04-21 08:53:19 +0200 | [diff] [blame] | 6701 | Environment variables are expanded |:set_env|. |
Bram Moolenaar | d94464e | 2015-11-02 15:28:18 +0100 | [diff] [blame] | 6702 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6703 | security reasons. |
Bram Moolenaar | 7d47b6e | 2006-03-15 22:59:18 +0000 | [diff] [blame] | 6704 | |
Bram Moolenaar | 9407316 | 2018-01-31 21:49:05 +0100 | [diff] [blame] | 6705 | *'pythonhome'* |
| 6706 | 'pythonhome' string (default "") |
| 6707 | global |
Bram Moolenaar | 9407316 | 2018-01-31 21:49:05 +0100 | [diff] [blame] | 6708 | {only available when compiled with the |+python/dyn| |
| 6709 | feature} |
| 6710 | Specifies the name of the Python 2.x home directory. When 'pythonhome' |
| 6711 | and the PYTHONHOME environment variable are not set, PYTHON_HOME, |
| 6712 | which was specified at compile time, will be used for the Python 2.x |
| 6713 | home directory. |
| 6714 | Environment variables are expanded |:set_env|. |
| 6715 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6716 | security reasons. |
| 6717 | |
Bram Moolenaar | b4ff518 | 2015-11-10 21:15:48 +0100 | [diff] [blame] | 6718 | *'pythonthreedll'* |
Bram Moolenaar | 25e4fcd | 2016-01-09 14:57:47 +0100 | [diff] [blame] | 6719 | 'pythonthreedll' string (default depends on the build) |
Bram Moolenaar | b4ff518 | 2015-11-10 21:15:48 +0100 | [diff] [blame] | 6720 | global |
Bram Moolenaar | b4ff518 | 2015-11-10 21:15:48 +0100 | [diff] [blame] | 6721 | {only available when compiled with the |+python3/dyn| |
| 6722 | feature} |
Bram Moolenaar | 25e4fcd | 2016-01-09 14:57:47 +0100 | [diff] [blame] | 6723 | Specifies the name of the Python 3 shared library. The default is |
| 6724 | DYNAMIC_PYTHON3_DLL, which was specified at compile time. |
Bram Moolenaar | aa3b15d | 2016-04-21 08:53:19 +0200 | [diff] [blame] | 6725 | Environment variables are expanded |:set_env|. |
Bram Moolenaar | b4ff518 | 2015-11-10 21:15:48 +0100 | [diff] [blame] | 6726 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6727 | security reasons. |
| 6728 | |
Bram Moolenaar | 9407316 | 2018-01-31 21:49:05 +0100 | [diff] [blame] | 6729 | *'pythonthreehome'* |
| 6730 | 'pythonthreehome' string (default "") |
| 6731 | global |
Bram Moolenaar | 9407316 | 2018-01-31 21:49:05 +0100 | [diff] [blame] | 6732 | {only available when compiled with the |+python3/dyn| |
| 6733 | feature} |
| 6734 | Specifies the name of the Python 3 home directory. When |
| 6735 | 'pythonthreehome' and the PYTHONHOME environment variable are not set, |
| 6736 | PYTHON3_HOME, which was specified at compile time, will be used for |
| 6737 | the Python 3 home directory. |
| 6738 | Environment variables are expanded |:set_env|. |
| 6739 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6740 | security reasons. |
| 6741 | |
Bram Moolenaar | f42dd3c | 2017-01-28 16:06:38 +0100 | [diff] [blame] | 6742 | *'pyxversion'* *'pyx'* |
| 6743 | 'pyxversion' 'pyx' number (default depends on the build) |
| 6744 | global |
Bram Moolenaar | f42dd3c | 2017-01-28 16:06:38 +0100 | [diff] [blame] | 6745 | {only available when compiled with the |+python| or |
| 6746 | the |+python3| feature} |
| 6747 | Specifies the python version used for pyx* functions and commands |
| 6748 | |python_x|. The default value is as follows: |
| 6749 | |
| 6750 | Compiled with Default ~ |
| 6751 | |+python| and |+python3| 0 |
| 6752 | only |+python| 2 |
| 6753 | only |+python3| 3 |
| 6754 | |
| 6755 | Available values are 0, 2 and 3. |
| 6756 | If 'pyxversion' is 0, it is set to 2 or 3 after the first execution of |
| 6757 | any python2/3 commands or functions. E.g. `:py` sets to 2, and `:py3` |
| 6758 | sets to 3. `:pyx` sets it to 3 if Python 3 is available, otherwise sets |
| 6759 | to 2 if Python 2 is available. |
| 6760 | See also: |has-pythonx| |
| 6761 | |
| 6762 | If Vim is compiled with only |+python| or |+python3| setting |
| 6763 | 'pyxversion' has no effect. The pyx* functions and commands are |
| 6764 | always the same as the compiled version. |
| 6765 | |
| 6766 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6767 | security reasons. |
| 6768 | |
Bram Moolenaar | 858ba06 | 2020-05-31 23:11:59 +0200 | [diff] [blame] | 6769 | *'quickfixtextfunc'* *'qftf'* |
| 6770 | 'quickfixtextfunc' 'qftf' string (default "") |
| 6771 | global |
| 6772 | {only available when compiled with the |+quickfix| |
| 6773 | feature} |
| 6774 | This option specifies a function to be used to get the text to display |
| 6775 | in the quickfix and location list windows. This can be used to |
| 6776 | customize the information displayed in the quickfix or location window |
| 6777 | for each entry in the corresponding quickfix or location list. See |
| 6778 | |quickfix-window-function| for an explanation of how to write the |
Yegappan Lakshmanan | 777175b | 2021-11-18 22:08:57 +0000 | [diff] [blame] | 6779 | function and an example. The value can be the name of a function, a |
| 6780 | |lambda| or a |Funcref|. See |option-value-function| for more |
| 6781 | information. |
Bram Moolenaar | 858ba06 | 2020-05-31 23:11:59 +0200 | [diff] [blame] | 6782 | |
| 6783 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 6784 | security reasons. |
| 6785 | |
Bram Moolenaar | 677ee68 | 2005-01-27 14:41:15 +0000 | [diff] [blame] | 6786 | *'quoteescape'* *'qe'* |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 6787 | 'quoteescape' 'qe' string (default "\") |
| 6788 | local to buffer |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 6789 | The characters that are used to escape quotes in a string. Used for |
| 6790 | objects like a', a" and a` |a'|. |
| 6791 | When one of the characters in this option is found inside a string, |
| 6792 | the following character will be skipped. The default value makes the |
| 6793 | text "foo\"bar\\" considered to be one string. |
| 6794 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6795 | *'readonly'* *'ro'* *'noreadonly'* *'noro'* |
| 6796 | 'readonly' 'ro' boolean (default off) |
Christian Brabandt | 596ad66 | 2023-08-16 00:11:09 +0200 | [diff] [blame] | 6797 | local to buffer |local-noglobal| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6798 | If on, writes fail unless you use a '!'. Protects you from |
| 6799 | accidentally overwriting a file. Default on when Vim is started |
| 6800 | in read-only mode ("vim -R") or when the executable is called "view". |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 6801 | When using ":w!" the 'readonly' option is reset for the current |
| 6802 | buffer, unless the 'Z' flag is in 'cpoptions'. |
Bram Moolenaar | 6c60f47 | 2019-04-28 16:00:35 +0200 | [diff] [blame] | 6803 | When using the ":view" command the 'readonly' option is set for the |
| 6804 | newly edited buffer. |
Bram Moolenaar | 369b6f5 | 2017-01-17 12:22:32 +0100 | [diff] [blame] | 6805 | See 'modifiable' for disallowing changes to the buffer. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6806 | |
Bram Moolenaar | 91a4e82 | 2008-01-19 14:59:58 +0000 | [diff] [blame] | 6807 | *'redrawtime'* *'rdt'* |
| 6808 | 'redrawtime' 'rdt' number (default 2000) |
| 6809 | global |
Bram Moolenaar | 91a4e82 | 2008-01-19 14:59:58 +0000 | [diff] [blame] | 6810 | {only available when compiled with the |+reltime| |
| 6811 | feature} |
| 6812 | The time in milliseconds for redrawing the display. This applies to |
Bram Moolenaar | 15142e2 | 2018-04-30 22:19:58 +0200 | [diff] [blame] | 6813 | searching for patterns for 'hlsearch', |:match| highlighting and syntax |
Bram Moolenaar | 06f1ed2 | 2017-06-18 22:41:03 +0200 | [diff] [blame] | 6814 | highlighting. |
Bram Moolenaar | 91a4e82 | 2008-01-19 14:59:58 +0000 | [diff] [blame] | 6815 | When redrawing takes more than this many milliseconds no further |
Bram Moolenaar | 06f1ed2 | 2017-06-18 22:41:03 +0200 | [diff] [blame] | 6816 | matches will be highlighted. |
| 6817 | For syntax highlighting the time applies per window. When over the |
| 6818 | limit syntax highlighting is disabled until |CTRL-L| is used. |
| 6819 | This is used to avoid that Vim hangs when using a very complicated |
| 6820 | pattern. |
Bram Moolenaar | 91a4e82 | 2008-01-19 14:59:58 +0000 | [diff] [blame] | 6821 | |
Bram Moolenaar | 543b7ef | 2013-06-01 14:50:56 +0200 | [diff] [blame] | 6822 | *'regexpengine'* *'re'* |
Bram Moolenaar | e6ae622 | 2013-05-21 21:01:10 +0200 | [diff] [blame] | 6823 | 'regexpengine' 're' number (default 0) |
| 6824 | global |
Bram Moolenaar | e6ae622 | 2013-05-21 21:01:10 +0200 | [diff] [blame] | 6825 | This selects the default regexp engine. |two-engines| |
| 6826 | The possible values are: |
| 6827 | 0 automatic selection |
| 6828 | 1 old engine |
| 6829 | 2 NFA engine |
| 6830 | Note that when using the NFA engine and the pattern contains something |
| 6831 | that is not supported the pattern will not match. This is only useful |
| 6832 | for debugging the regexp engine. |
Bram Moolenaar | fda3729 | 2014-11-05 14:27:36 +0100 | [diff] [blame] | 6833 | Using automatic selection enables Vim to switch the engine, if the |
| 6834 | default engine becomes too costly. E.g., when the NFA engine uses too |
| 6835 | many states. This should prevent Vim from hanging on a combination of |
| 6836 | a complex pattern with long text. |
Bram Moolenaar | e6ae622 | 2013-05-21 21:01:10 +0200 | [diff] [blame] | 6837 | |
Bram Moolenaar | 6448667 | 2010-05-16 15:46:46 +0200 | [diff] [blame] | 6838 | *'relativenumber'* *'rnu'* *'norelativenumber'* *'nornu'* |
| 6839 | 'relativenumber' 'rnu' boolean (default off) |
| 6840 | local to window |
Bram Moolenaar | 6448667 | 2010-05-16 15:46:46 +0200 | [diff] [blame] | 6841 | Show the line number relative to the line with the cursor in front of |
Bram Moolenaar | 06b5d51 | 2010-05-22 15:37:44 +0200 | [diff] [blame] | 6842 | each line. Relative line numbers help you use the |count| you can |
Bram Moolenaar | 6448667 | 2010-05-16 15:46:46 +0200 | [diff] [blame] | 6843 | precede some vertical motion commands (e.g. j k + -) with, without |
| 6844 | having to calculate it yourself. Especially useful in combination with |
| 6845 | other commands (e.g. y d c < > gq gw =). |
| 6846 | When the 'n' option is excluded from 'cpoptions' a wrapped |
| 6847 | line will not use the column of line numbers (this is the default when |
| 6848 | 'compatible' isn't set). |
| 6849 | The 'numberwidth' option can be used to set the room used for the line |
| 6850 | number. |
| 6851 | When a long, wrapped line doesn't start with the first character, '-' |
| 6852 | characters are put before the number. |
Bram Moolenaar | 61d35bd | 2012-03-28 20:51:51 +0200 | [diff] [blame] | 6853 | See |hl-LineNr| and |hl-CursorLineNr| for the highlighting used for |
| 6854 | the number. |
Bram Moolenaar | 22f1d0e | 2018-02-27 14:53:30 +0100 | [diff] [blame] | 6855 | |
Bram Moolenaar | 203d04d | 2013-06-06 21:36:40 +0200 | [diff] [blame] | 6856 | The number in front of the cursor line also depends on the value of |
| 6857 | 'number', see |number_relativenumber| for all combinations of the two |
| 6858 | options. |
Bram Moolenaar | 6448667 | 2010-05-16 15:46:46 +0200 | [diff] [blame] | 6859 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6860 | *'remap'* *'noremap'* |
| 6861 | 'remap' boolean (default on) |
| 6862 | global |
| 6863 | Allows for mappings to work recursively. If you do not want this for |
| 6864 | a single entry, use the :noremap[!] command. |
Bram Moolenaar | a3227e2 | 2006-03-08 21:32:40 +0000 | [diff] [blame] | 6865 | NOTE: To avoid portability problems with Vim scripts, always keep |
| 6866 | this option at the default "on". Only switch it off when working with |
| 6867 | old Vi scripts. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6868 | |
zeertzjq | d086b8f | 2024-02-25 15:42:52 +0800 | [diff] [blame] | 6869 | *'renderoptions'* *'rop'* |
Bram Moolenaar | b5a7a8b | 2014-08-06 14:52:30 +0200 | [diff] [blame] | 6870 | 'renderoptions' 'rop' string (default: empty) |
| 6871 | global |
Bram Moolenaar | b5a7a8b | 2014-08-06 14:52:30 +0200 | [diff] [blame] | 6872 | {only available when compiled with GUI and DIRECTX on |
| 6873 | MS-Windows} |
| 6874 | Select a text renderer and set its options. The options depend on the |
| 6875 | renderer. |
| 6876 | |
| 6877 | Syntax: > |
| 6878 | set rop=type:{renderer}(,{name}:{value})* |
| 6879 | < |
| 6880 | Currently, only one optional renderer is available. |
| 6881 | |
| 6882 | render behavior ~ |
| 6883 | directx Vim will draw text using DirectX (DirectWrite). It makes |
| 6884 | drawn glyphs more beautiful than default GDI. |
| 6885 | It requires 'encoding' is "utf-8", and only works on |
| 6886 | MS-Windows Vista or newer version. |
| 6887 | |
| 6888 | Options: |
| 6889 | name meaning type value ~ |
| 6890 | gamma gamma float 1.0 - 2.2 (maybe) |
| 6891 | contrast enhancedContrast float (unknown) |
| 6892 | level clearTypeLevel float (unknown) |
| 6893 | geom pixelGeometry int 0 - 2 (see below) |
| 6894 | renmode renderingMode int 0 - 6 (see below) |
| 6895 | taamode textAntialiasMode int 0 - 3 (see below) |
Bram Moolenaar | a338adc | 2018-01-31 20:51:47 +0100 | [diff] [blame] | 6896 | scrlines Scroll Lines int (deprecated) |
Bram Moolenaar | b5a7a8b | 2014-08-06 14:52:30 +0200 | [diff] [blame] | 6897 | |
Bram Moolenaar | 92467d3 | 2017-12-05 13:22:16 +0100 | [diff] [blame] | 6898 | See this URL for detail (except for scrlines): |
| 6899 | https://msdn.microsoft.com/en-us/library/dd368190.aspx |
Bram Moolenaar | b5a7a8b | 2014-08-06 14:52:30 +0200 | [diff] [blame] | 6900 | |
| 6901 | For geom: structure of a device pixel. |
| 6902 | 0 - DWRITE_PIXEL_GEOMETRY_FLAT |
| 6903 | 1 - DWRITE_PIXEL_GEOMETRY_RGB |
| 6904 | 2 - DWRITE_PIXEL_GEOMETRY_BGR |
| 6905 | |
| 6906 | See this URL for detail: |
Bram Moolenaar | 92467d3 | 2017-12-05 13:22:16 +0100 | [diff] [blame] | 6907 | https://msdn.microsoft.com/en-us/library/dd368114.aspx |
Bram Moolenaar | b5a7a8b | 2014-08-06 14:52:30 +0200 | [diff] [blame] | 6908 | |
| 6909 | For renmode: method of rendering glyphs. |
| 6910 | 0 - DWRITE_RENDERING_MODE_DEFAULT |
| 6911 | 1 - DWRITE_RENDERING_MODE_ALIASED |
| 6912 | 2 - DWRITE_RENDERING_MODE_GDI_CLASSIC |
| 6913 | 3 - DWRITE_RENDERING_MODE_GDI_NATURAL |
| 6914 | 4 - DWRITE_RENDERING_MODE_NATURAL |
| 6915 | 5 - DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC |
| 6916 | 6 - DWRITE_RENDERING_MODE_OUTLINE |
| 6917 | |
| 6918 | See this URL for detail: |
Bram Moolenaar | 92467d3 | 2017-12-05 13:22:16 +0100 | [diff] [blame] | 6919 | https://msdn.microsoft.com/en-us/library/dd368118.aspx |
Bram Moolenaar | b5a7a8b | 2014-08-06 14:52:30 +0200 | [diff] [blame] | 6920 | |
| 6921 | For taamode: antialiasing mode used for drawing text. |
| 6922 | 0 - D2D1_TEXT_ANTIALIAS_MODE_DEFAULT |
| 6923 | 1 - D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE |
| 6924 | 2 - D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE |
| 6925 | 3 - D2D1_TEXT_ANTIALIAS_MODE_ALIASED |
| 6926 | |
| 6927 | See this URL for detail: |
Bram Moolenaar | 92467d3 | 2017-12-05 13:22:16 +0100 | [diff] [blame] | 6928 | https://msdn.microsoft.com/en-us/library/dd368170.aspx |
| 6929 | |
Bram Moolenaar | a338adc | 2018-01-31 20:51:47 +0100 | [diff] [blame] | 6930 | For scrlines: |
| 6931 | This was used for optimizing scrolling behavior, however this |
| 6932 | is now deprecated. If specified, it is simply ignored. |
Bram Moolenaar | b5a7a8b | 2014-08-06 14:52:30 +0200 | [diff] [blame] | 6933 | |
| 6934 | Example: > |
| 6935 | set encoding=utf-8 |
Bram Moolenaar | d7ccc4d | 2017-11-26 14:29:32 +0100 | [diff] [blame] | 6936 | set gfn=Ricty_Diminished:h12 |
Bram Moolenaar | b5a7a8b | 2014-08-06 14:52:30 +0200 | [diff] [blame] | 6937 | set rop=type:directx |
| 6938 | < |
Bram Moolenaar | d7ccc4d | 2017-11-26 14:29:32 +0100 | [diff] [blame] | 6939 | If select a raster font (Courier, Terminal or FixedSys which |
| 6940 | have ".fon" extension in file name) to 'guifont', it will be |
Bram Moolenaar | 92467d3 | 2017-12-05 13:22:16 +0100 | [diff] [blame] | 6941 | drawn by GDI as a fallback. |
Bram Moolenaar | d7ccc4d | 2017-11-26 14:29:32 +0100 | [diff] [blame] | 6942 | |
| 6943 | NOTE: It is known that some fonts and options combination |
| 6944 | causes trouble on drawing glyphs. |
| 6945 | |
Bram Moolenaar | 92467d3 | 2017-12-05 13:22:16 +0100 | [diff] [blame] | 6946 | - 'renmode:5' and 'renmode:6' will not work with some |
Bram Moolenaar | d7ccc4d | 2017-11-26 14:29:32 +0100 | [diff] [blame] | 6947 | special made fonts (True-Type fonts which includes only |
| 6948 | bitmap glyphs). |
| 6949 | - 'taamode:3' will not work with some vector fonts. |
| 6950 | |
| 6951 | NOTE: With this option, you can display colored emoji |
| 6952 | (emoticon) in Windows 8.1 or later. To display colored emoji, |
| 6953 | there are some conditions which you should notice. |
| 6954 | |
| 6955 | - If your font includes non-colored emoji already, it will |
| 6956 | be used. |
| 6957 | - If your font doesn't have emoji, the system chooses an |
| 6958 | alternative symbol font. On Windows 10, "Segoe UI Emoji" |
| 6959 | will be used. |
| 6960 | - When this alternative font didn't have fixed width glyph, |
| 6961 | emoji might be rendered beyond the bounding box of drawing |
| 6962 | cell. |
Bram Moolenaar | b5a7a8b | 2014-08-06 14:52:30 +0200 | [diff] [blame] | 6963 | |
| 6964 | Other render types are currently not supported. |
| 6965 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6966 | *'report'* |
| 6967 | 'report' number (default 2) |
| 6968 | global |
| 6969 | Threshold for reporting number of lines changed. When the number of |
| 6970 | changed lines is more than 'report' a message will be given for most |
| 6971 | ":" commands. If you want it always, set 'report' to 0. |
| 6972 | For the ":substitute" command the number of substitutions is used |
| 6973 | instead of the number of lines. |
| 6974 | |
| 6975 | *'restorescreen'* *'rs'* *'norestorescreen'* *'nors'* |
| 6976 | 'restorescreen' 'rs' boolean (default on) |
| 6977 | global |
Bram Moolenaar | 8024f93 | 2020-01-14 19:29:13 +0100 | [diff] [blame] | 6978 | {only in MS-Windows console version} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6979 | When set, the screen contents is restored when exiting Vim. This also |
| 6980 | happens when executing external commands. |
| 6981 | |
| 6982 | For non-Windows Vim: You can set or reset the 't_ti' and 't_te' |
| 6983 | options in your .vimrc. To disable restoring: |
| 6984 | set t_ti= t_te= |
| 6985 | To enable restoring (for an xterm): |
| 6986 | set t_ti=^[7^[[r^[[?47h t_te=^[[?47l^[8 |
| 6987 | (Where ^[ is an <Esc>, type CTRL-V <Esc> to insert it) |
| 6988 | |
| 6989 | *'revins'* *'ri'* *'norevins'* *'nori'* |
| 6990 | 'revins' 'ri' boolean (default off) |
| 6991 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6992 | {only available when compiled with the |+rightleft| |
| 6993 | feature} |
| 6994 | Inserting characters in Insert mode will work backwards. See "typing |
| 6995 | backwards" |ins-reverse|. This option can be toggled with the CTRL-_ |
| 6996 | command in Insert mode, when 'allowrevins' is set. |
Bram Moolenaar | ca63501 | 2015-09-25 20:34:21 +0200 | [diff] [blame] | 6997 | NOTE: This option is reset when 'compatible' is set. |
| 6998 | This option is reset when 'paste' is set and restored when 'paste' is |
| 6999 | reset. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7000 | |
| 7001 | *'rightleft'* *'rl'* *'norightleft'* *'norl'* |
| 7002 | 'rightleft' 'rl' boolean (default off) |
| 7003 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7004 | {only available when compiled with the |+rightleft| |
| 7005 | feature} |
| 7006 | When on, display orientation becomes right-to-left, i.e., characters |
| 7007 | that are stored in the file appear from the right to the left. |
| 7008 | Using this option, it is possible to edit files for languages that |
| 7009 | are written from the right to the left such as Hebrew and Arabic. |
| 7010 | This option is per window, so it is possible to edit mixed files |
| 7011 | simultaneously, or to view the same file in both ways (this is |
| 7012 | useful whenever you have a mixed text file with both right-to-left |
| 7013 | and left-to-right strings so that both sets are displayed properly |
| 7014 | in different windows). Also see |rileft.txt|. |
| 7015 | |
Bram Moolenaar | 607cc1e | 2010-07-18 18:47:44 +0200 | [diff] [blame] | 7016 | *'rightleftcmd'* *'rlc'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7017 | 'rightleftcmd' 'rlc' string (default "search") |
| 7018 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7019 | {only available when compiled with the |+rightleft| |
| 7020 | feature} |
| 7021 | Each word in this option enables the command line editing to work in |
| 7022 | right-to-left mode for a group of commands: |
| 7023 | |
| 7024 | search "/" and "?" commands |
| 7025 | |
| 7026 | This is useful for languages such as Hebrew, Arabic and Farsi. |
| 7027 | The 'rightleft' option must be set for 'rightleftcmd' to take effect. |
| 7028 | |
Bram Moolenaar | d94464e | 2015-11-02 15:28:18 +0100 | [diff] [blame] | 7029 | *'rubydll'* |
Bram Moolenaar | 3848e00 | 2016-03-19 18:42:29 +0100 | [diff] [blame] | 7030 | 'rubydll' string (default: depends on the build) |
Bram Moolenaar | d94464e | 2015-11-02 15:28:18 +0100 | [diff] [blame] | 7031 | global |
Bram Moolenaar | d94464e | 2015-11-02 15:28:18 +0100 | [diff] [blame] | 7032 | {only available when compiled with the |+ruby/dyn| |
| 7033 | feature} |
Bram Moolenaar | 25e4fcd | 2016-01-09 14:57:47 +0100 | [diff] [blame] | 7034 | Specifies the name of the Ruby shared library. The default is |
| 7035 | DYNAMIC_RUBY_DLL, which was specified at compile time. |
Bram Moolenaar | aa3b15d | 2016-04-21 08:53:19 +0200 | [diff] [blame] | 7036 | Environment variables are expanded |:set_env|. |
Bram Moolenaar | d94464e | 2015-11-02 15:28:18 +0100 | [diff] [blame] | 7037 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 7038 | security reasons. |
| 7039 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7040 | *'ruler'* *'ru'* *'noruler'* *'noru'* |
Bram Moolenaar | 8c08b5b | 2016-07-28 22:24:15 +0200 | [diff] [blame] | 7041 | 'ruler' 'ru' boolean (default off, set in |defaults.vim|) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7042 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7043 | Show the line and column number of the cursor position, separated by a |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 7044 | comma. When there is room, the relative position of the displayed |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7045 | text in the file is shown on the far right: |
| 7046 | Top first line is visible |
| 7047 | Bot last line is visible |
| 7048 | All first and last line are visible |
| 7049 | 45% relative position in the file |
| 7050 | If 'rulerformat' is set, it will determine the contents of the ruler. |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 7051 | Each window has its own ruler. If a window has a status line, the |
Bram Moolenaar | a2a8973 | 2022-08-31 14:46:18 +0100 | [diff] [blame] | 7052 | ruler is shown there. Otherwise it is shown in the last line of the |
| 7053 | screen. If the statusline is given by 'statusline' (i.e. not empty), |
| 7054 | this option takes precedence over 'ruler' and 'rulerformat'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7055 | If the number of characters displayed is different from the number of |
Bram Moolenaar | 207f009 | 2020-08-30 17:20:20 +0200 | [diff] [blame] | 7056 | bytes in the text (e.g., for a TAB or a multibyte character), both |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7057 | the text column (byte number) and the screen column are shown, |
| 7058 | separated with a dash. |
| 7059 | For an empty line "0-1" is shown. |
| 7060 | For an empty buffer the line number will also be zero: "0,0-1". |
Bram Moolenaar | ca63501 | 2015-09-25 20:34:21 +0200 | [diff] [blame] | 7061 | This option is reset when 'paste' is set and restored when 'paste' is |
| 7062 | reset. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7063 | If you don't want to see the ruler all the time but want to know where |
| 7064 | you are, use "g CTRL-G" |g_CTRL-G|. |
| 7065 | NOTE: This option is reset when 'compatible' is set. |
| 7066 | |
| 7067 | *'rulerformat'* *'ruf'* |
| 7068 | 'rulerformat' 'ruf' string (default empty) |
| 7069 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7070 | {not available when compiled without the |+statusline| |
| 7071 | feature} |
| 7072 | When this option is not empty, it determines the content of the ruler |
| 7073 | string, as displayed for the 'ruler' option. |
Bram Moolenaar | a23ccb8 | 2006-02-27 00:08:02 +0000 | [diff] [blame] | 7074 | The format of this option is like that of 'statusline'. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 7075 | This option cannot be set in a modeline when 'modelineexpr' is off. |
| 7076 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7077 | The default ruler width is 17 characters. To make the ruler 15 |
| 7078 | characters wide, put "%15(" at the start and "%)" at the end. |
| 7079 | Example: > |
| 7080 | :set rulerformat=%15(%c%V\ %p%%%) |
| 7081 | < |
| 7082 | *'runtimepath'* *'rtp'* *vimfiles* |
| 7083 | 'runtimepath' 'rtp' string (default: |
Christian Brabandt | c3e6e39 | 2024-05-04 09:48:15 +0200 | [diff] [blame] | 7084 | Unix: "$HOME/.vim or |
| 7085 | $XDG_CONFIG_HOME/vim, |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7086 | $VIM/vimfiles, |
| 7087 | $VIMRUNTIME, |
| 7088 | $VIM/vimfiles/after, |
| 7089 | $HOME/.vim/after" |
| 7090 | Amiga: "home:vimfiles, |
| 7091 | $VIM/vimfiles, |
| 7092 | $VIMRUNTIME, |
| 7093 | $VIM/vimfiles/after, |
| 7094 | home:vimfiles/after" |
Bram Moolenaar | 942db23 | 2021-02-13 18:14:48 +0100 | [diff] [blame] | 7095 | MS-Windows: "$HOME/vimfiles, |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7096 | $VIM/vimfiles, |
| 7097 | $VIMRUNTIME, |
| 7098 | $VIM/vimfiles/after, |
| 7099 | $HOME/vimfiles/after" |
Bram Moolenaar | b3f7406 | 2020-02-26 16:16:53 +0100 | [diff] [blame] | 7100 | Haiku: "$BE_USER_SETTINGS/vim, |
| 7101 | $VIM/vimfiles, |
| 7102 | $VIMRUNTIME, |
| 7103 | $VIM/vimfiles/after, |
Bram Moolenaar | 942db23 | 2021-02-13 18:14:48 +0100 | [diff] [blame] | 7104 | $BE_USER_SETTINGS/vim/after" |
| 7105 | VMS: "sys$login:vimfiles, |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7106 | $VIM/vimfiles, |
| 7107 | $VIMRUNTIME, |
| 7108 | $VIM/vimfiles/after, |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 7109 | sys$login:vimfiles/after") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7110 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7111 | This is a list of directories which will be searched for runtime |
| 7112 | files: |
| 7113 | filetype.vim filetypes by file name |new-filetype| |
| 7114 | scripts.vim filetypes by file contents |new-filetype-scripts| |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 7115 | autoload/ automatically loaded scripts |autoload-functions| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7116 | colors/ color scheme files |:colorscheme| |
| 7117 | compiler/ compiler files |:compiler| |
| 7118 | doc/ documentation |write-local-help| |
| 7119 | ftplugin/ filetype plugins |write-filetype-plugin| |
Bram Moolenaar | 8a7d654 | 2020-01-26 15:56:19 +0100 | [diff] [blame] | 7120 | import/ files that are found by `:import` |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7121 | indent/ indent scripts |indent-expression| |
| 7122 | keymap/ key mapping files |mbyte-keymap| |
RestorerZ | 9650910 | 2024-07-11 21:14:15 +0200 | [diff] [blame] | 7123 | lang/ message translations |:menutrans| and |multi-lang| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7124 | menu.vim GUI menus |menu.vim| |
Bram Moolenaar | 2685212 | 2016-05-24 20:02:38 +0200 | [diff] [blame] | 7125 | pack/ packages |:packadd| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7126 | plugin/ plugin scripts |write-plugin| |
| 7127 | print/ files for printing |postscript-print-encoding| |
Bram Moolenaar | afeb4fa | 2006-02-01 21:51:12 +0000 | [diff] [blame] | 7128 | spell/ spell checking files |spell| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7129 | syntax/ syntax files |mysyntaxfile| |
| 7130 | tutor/ files for vimtutor |tutor| |
| 7131 | |
| 7132 | And any other file searched for with the |:runtime| command. |
| 7133 | |
Christian Brabandt | c3e6e39 | 2024-05-04 09:48:15 +0200 | [diff] [blame] | 7134 | For $XDG_CONFIG_HOME see |xdg-base-dir|. |
| 7135 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7136 | The defaults for most systems are setup to search five locations: |
| 7137 | 1. In your home directory, for your personal preferences. |
| 7138 | 2. In a system-wide Vim directory, for preferences from the system |
| 7139 | administrator. |
| 7140 | 3. In $VIMRUNTIME, for files distributed with Vim. |
| 7141 | *after-directory* |
| 7142 | 4. In the "after" directory in the system-wide Vim directory. This is |
| 7143 | for the system administrator to overrule or add to the distributed |
| 7144 | defaults (rarely needed) |
| 7145 | 5. In the "after" directory in your home directory. This is for |
| 7146 | personal preferences to overrule or add to the distributed defaults |
| 7147 | or system-wide settings (rarely needed). |
| 7148 | |
Bram Moolenaar | d079690 | 2016-09-16 20:02:31 +0200 | [diff] [blame] | 7149 | More entries are added when using |packages|. If it gets very long |
| 7150 | then `:set rtp` will be truncated, use `:echo &rtp` to see the full |
| 7151 | string. |
Bram Moolenaar | 2685212 | 2016-05-24 20:02:38 +0200 | [diff] [blame] | 7152 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7153 | Note that, unlike 'path', no wildcards like "**" are allowed. Normal |
| 7154 | wildcards are allowed, but can significantly slow down searching for |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 7155 | runtime files. For speed, use as few items as possible and avoid |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7156 | wildcards. |
| 7157 | See |:runtime|. |
| 7158 | Example: > |
| 7159 | :set runtimepath=~/vimruntime,/mygroup/vim,$VIMRUNTIME |
| 7160 | < This will use the directory "~/vimruntime" first (containing your |
| 7161 | personal Vim runtime files), then "/mygroup/vim" (shared between a |
| 7162 | group of people) and finally "$VIMRUNTIME" (the distributed runtime |
| 7163 | files). |
| 7164 | You probably should always include $VIMRUNTIME somewhere, to use the |
| 7165 | distributed runtime files. You can put a directory before $VIMRUNTIME |
| 7166 | to find files which replace a distributed runtime files. You can put |
| 7167 | a directory after $VIMRUNTIME to find files which add to distributed |
| 7168 | runtime files. |
Bram Moolenaar | b5b7562 | 2018-03-09 22:22:21 +0100 | [diff] [blame] | 7169 | When Vim is started with |--clean| the home directory entries are not |
| 7170 | included. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7171 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 7172 | security reasons. |
| 7173 | |
| 7174 | *'scroll'* *'scr'* |
| 7175 | 'scroll' 'scr' number (default: half the window height) |
Christian Brabandt | 596ad66 | 2023-08-16 00:11:09 +0200 | [diff] [blame] | 7176 | local to window |local-noglobal| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7177 | Number of lines to scroll with CTRL-U and CTRL-D commands. Will be |
| 7178 | set to half the number of lines in the window when the window size |
Bram Moolenaar | 7466706 | 2020-12-28 15:41:41 +0100 | [diff] [blame] | 7179 | changes. This may happen when enabling the |status-line| or |
| 7180 | 'tabline' option after setting the 'scroll' option. |
| 7181 | If you give a count to the CTRL-U or CTRL-D command it will |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 7182 | be used as the new value for 'scroll'. Reset to half the window |
Bram Moolenaar | 25c9c68 | 2019-05-05 18:13:34 +0200 | [diff] [blame] | 7183 | height with ":set scroll=0". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7184 | |
| 7185 | *'scrollbind'* *'scb'* *'noscrollbind'* *'noscb'* |
| 7186 | 'scrollbind' 'scb' boolean (default off) |
| 7187 | local to window |
zeertzjq | 5277cfa | 2023-09-28 01:00:12 +0800 | [diff] [blame] | 7188 | See also |scroll-binding|. When this option is set, scrolling the |
| 7189 | current window also scrolls other scrollbind windows (windows that |
| 7190 | also have this option set). This option is useful for viewing the |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7191 | differences between two versions of a file, see 'diff'. |
| 7192 | See |'scrollopt'| for options that determine how this option should be |
| 7193 | interpreted. |
| 7194 | This option is mostly reset when splitting a window to edit another |
| 7195 | file. This means that ":split | edit file" results in two windows |
| 7196 | with scroll-binding, but ":split file" does not. |
| 7197 | |
Bram Moolenaar | ae20f34 | 2019-11-05 21:09:23 +0100 | [diff] [blame] | 7198 | *'scrollfocus'* *'scf'* *'noscrollfocus'* *'noscf'* |
| 7199 | 'scrollfocus' 'scf' boolean (default off) |
| 7200 | global |
| 7201 | {only for MS-Windows GUI} |
| 7202 | When using the scroll wheel and this option is set, the window under |
| 7203 | the mouse pointer is scrolled. With this option off the current |
| 7204 | window is scrolled. |
Bram Moolenaar | 5ef1c6a | 2019-11-10 22:09:11 +0100 | [diff] [blame] | 7205 | Systems other than MS-Windows always behave like this option is on. |
Bram Moolenaar | ae20f34 | 2019-11-05 21:09:23 +0100 | [diff] [blame] | 7206 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7207 | *'scrolljump'* *'sj'* |
| 7208 | 'scrolljump' 'sj' number (default 1) |
| 7209 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7210 | Minimal number of lines to scroll when the cursor gets off the |
| 7211 | screen (e.g., with "j"). Not used for scroll commands (e.g., CTRL-E, |
| 7212 | CTRL-D). Useful if your terminal scrolls very slowly. |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 7213 | When set to a negative number from -1 to -100 this is used as the |
| 7214 | percentage of the window height. Thus -50 scrolls half the window |
| 7215 | height. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7216 | NOTE: This option is set to 1 when 'compatible' is set. |
| 7217 | |
| 7218 | *'scrolloff'* *'so'* |
Bram Moolenaar | 50ba526 | 2016-09-22 22:33:02 +0200 | [diff] [blame] | 7219 | 'scrolloff' 'so' number (default 0, set to 5 in |defaults.vim|) |
Bram Moolenaar | 375e339 | 2019-01-31 18:26:10 +0100 | [diff] [blame] | 7220 | global or local to window |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7221 | Minimal number of screen lines to keep above and below the cursor. |
| 7222 | This will make some context visible around where you are working. If |
| 7223 | you set it to a very large value (999) the cursor line will always be |
| 7224 | in the middle of the window (except at the start or end of the file or |
| 7225 | when long lines wrap). |
Bram Moolenaar | 375e339 | 2019-01-31 18:26:10 +0100 | [diff] [blame] | 7226 | After using the local value, go back the global value with one of |
| 7227 | these two: > |
| 7228 | setlocal scrolloff< |
| 7229 | setlocal scrolloff=-1 |
| 7230 | < For scrolling horizontally see 'sidescrolloff'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7231 | NOTE: This option is set to 0 when 'compatible' is set. |
| 7232 | |
| 7233 | *'scrollopt'* *'sbo'* |
| 7234 | 'scrollopt' 'sbo' string (default "ver,jump") |
| 7235 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7236 | This is a comma-separated list of words that specifies how |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 7237 | 'scrollbind' windows should behave. 'sbo' stands for ScrollBind |
| 7238 | Options. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7239 | The following words are available: |
| 7240 | ver Bind vertical scrolling for 'scrollbind' windows |
| 7241 | hor Bind horizontal scrolling for 'scrollbind' windows |
| 7242 | jump Applies to the offset between two windows for vertical |
| 7243 | scrolling. This offset is the difference in the first |
| 7244 | displayed line of the bound windows. When moving |
| 7245 | around in a window, another 'scrollbind' window may |
| 7246 | reach a position before the start or after the end of |
| 7247 | the buffer. The offset is not changed though, when |
| 7248 | moving back the 'scrollbind' window will try to scroll |
| 7249 | to the desired position when possible. |
| 7250 | When now making that window the current one, two |
| 7251 | things can be done with the relative offset: |
| 7252 | 1. When "jump" is not included, the relative offset is |
| 7253 | adjusted for the scroll position in the new current |
| 7254 | window. When going back to the other window, the |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 7255 | new relative offset will be used. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7256 | 2. When "jump" is included, the other windows are |
| 7257 | scrolled to keep the same relative offset. When |
| 7258 | going back to the other window, it still uses the |
| 7259 | same relative offset. |
| 7260 | Also see |scroll-binding|. |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 7261 | When 'diff' mode is active there always is vertical scroll binding, |
| 7262 | even when "ver" isn't there. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7263 | |
| 7264 | *'sections'* *'sect'* |
| 7265 | 'sections' 'sect' string (default "SHNHH HUnhsh") |
| 7266 | global |
| 7267 | Specifies the nroff macros that separate sections. These are pairs of |
| 7268 | two letters (See |object-motions|). The default makes a section start |
| 7269 | at the nroff macros ".SH", ".NH", ".H", ".HU", ".nh" and ".sh". |
| 7270 | |
| 7271 | *'secure'* *'nosecure'* *E523* |
| 7272 | 'secure' boolean (default off) |
| 7273 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7274 | When on, ":autocmd", shell and write commands are not allowed in |
| 7275 | ".vimrc" and ".exrc" in the current directory and map commands are |
| 7276 | displayed. Switch it off only if you know that you will not run into |
| 7277 | problems, or when the 'exrc' option is off. On Unix this option is |
| 7278 | only used if the ".vimrc" or ".exrc" is not owned by you. This can be |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 7279 | dangerous if the systems allows users to do a "chown". You better set |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7280 | 'secure' at the end of your ~/.vimrc then. |
| 7281 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 7282 | security reasons. |
| 7283 | |
| 7284 | *'selection'* *'sel'* |
| 7285 | 'selection' 'sel' string (default "inclusive") |
| 7286 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7287 | This option defines the behavior of the selection. It is only used |
| 7288 | in Visual and Select mode. |
| 7289 | Possible values: |
| 7290 | value past line inclusive ~ |
| 7291 | old no yes |
| 7292 | inclusive yes yes |
| 7293 | exclusive yes no |
| 7294 | "past line" means that the cursor is allowed to be positioned one |
| 7295 | character past the line. |
| 7296 | "inclusive" means that the last character of the selection is included |
| 7297 | in an operation. For example, when "x" is used to delete the |
| 7298 | selection. |
Bram Moolenaar | e4a3bcf | 2016-08-26 19:52:37 +0200 | [diff] [blame] | 7299 | When "old" is used and 'virtualedit' allows the cursor to move past |
| 7300 | the end of line the line break still isn't included. |
Christian Brabandt | ed89206 | 2024-12-14 20:23:39 +0100 | [diff] [blame] | 7301 | When "exclusive" is used, cursor position in visual mode will be |
| 7302 | adjusted for inclusive motions |inclusive-motion-selection-exclusive|. |
Christian Brabandt | bfeefc4 | 2025-06-02 19:56:57 +0200 | [diff] [blame] | 7303 | |
| 7304 | Note: |
| 7305 | - When "exclusive" is used and selecting from the end backwards, you |
| 7306 | cannot include the last character of a line, when starting in Normal |
| 7307 | mode and 'virtualedit' empty. |
| 7308 | - when "exclusive" is used with a single character visual selection, |
| 7309 | Vim will behave as if the 'selection' is inclusive (in other words, |
| 7310 | you cannot visually select an empty region). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7311 | |
| 7312 | The 'selection' option is set by the |:behave| command. |
| 7313 | |
| 7314 | *'selectmode'* *'slm'* |
| 7315 | 'selectmode' 'slm' string (default "") |
| 7316 | global |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 7317 | This is a comma-separated list of words, which specifies when to start |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7318 | Select mode instead of Visual mode, when a selection is started. |
| 7319 | Possible values: |
| 7320 | mouse when using the mouse |
| 7321 | key when using shifted special keys |
| 7322 | cmd when using "v", "V" or CTRL-V |
| 7323 | See |Select-mode|. |
| 7324 | The 'selectmode' option is set by the |:behave| command. |
| 7325 | |
| 7326 | *'sessionoptions'* *'ssop'* |
| 7327 | 'sessionoptions' 'ssop' string (default: "blank,buffers,curdir,folds, |
Bram Moolenaar | b5b7562 | 2018-03-09 22:22:21 +0100 | [diff] [blame] | 7328 | help,options,tabpages,winsize,terminal") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7329 | global |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 7330 | {not available when compiled without the |+mksession| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7331 | feature} |
| 7332 | Changes the effect of the |:mksession| command. It is a comma |
| 7333 | separated list of words. Each word enables saving and restoring |
| 7334 | something: |
| 7335 | word save and restore ~ |
| 7336 | blank empty windows |
| 7337 | buffers hidden and unloaded buffers, not just those in windows |
| 7338 | curdir the current directory |
| 7339 | folds manually created folds, opened/closed folds and local |
| 7340 | fold options |
| 7341 | globals global variables that start with an uppercase letter |
Bram Moolenaar | 1280586 | 2005-01-05 22:16:17 +0000 | [diff] [blame] | 7342 | and contain at least one lowercase letter. Only |
| 7343 | String and Number types are stored. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7344 | help the help window |
| 7345 | localoptions options and mappings local to a window or buffer (not |
| 7346 | global values for local options) |
| 7347 | options all options and mappings (also global values for local |
| 7348 | options) |
Bram Moolenaar | d23b714 | 2021-04-17 21:04:34 +0200 | [diff] [blame] | 7349 | skiprtp exclude 'runtimepath' and 'packpath' from the options |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7350 | resize size of the Vim window: 'lines' and 'columns' |
| 7351 | sesdir the directory in which the session file is located |
| 7352 | will become the current directory (useful with |
| 7353 | projects accessed over a network from different |
| 7354 | systems) |
| 7355 | slash backslashes in file names replaced with forward |
| 7356 | slashes |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 7357 | tabpages all tab pages; without this only the current tab page |
| 7358 | is restored, so that you can make a session for each |
| 7359 | tab page separately |
Bram Moolenaar | d473c8c | 2018-08-11 18:00:22 +0200 | [diff] [blame] | 7360 | terminal include terminal windows where the command can be |
| 7361 | restored |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7362 | unix with Unix end-of-line format (single <NL>), even when |
| 7363 | on Windows or DOS |
| 7364 | winpos position of the whole Vim window |
| 7365 | winsize window sizes |
| 7366 | |
| 7367 | Don't include both "curdir" and "sesdir". |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 7368 | When neither "curdir" nor "sesdir" is included, file names are stored |
| 7369 | with absolute paths. |
Bram Moolenaar | 2f0936c | 2022-01-08 21:51:59 +0000 | [diff] [blame] | 7370 | If you leave out "options" many things won't work well after restoring |
| 7371 | the session. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7372 | "slash" and "unix" are useful on Windows when sharing session files |
| 7373 | with Unix. The Unix version of Vim cannot source dos format scripts, |
| 7374 | but the Windows version of Vim can source unix format scripts. |
| 7375 | |
| 7376 | *'shell'* *'sh'* *E91* |
Bram Moolenaar | 95a9dd1 | 2019-12-19 22:12:03 +0100 | [diff] [blame] | 7377 | 'shell' 'sh' string (default $SHELL or "sh", Win32: "cmd.exe") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7378 | global |
| 7379 | Name of the shell to use for ! and :! commands. When changing the |
| 7380 | value also check these options: 'shelltype', 'shellpipe', 'shellslash' |
| 7381 | 'shellredir', 'shellquote', 'shellxquote' and 'shellcmdflag'. |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 7382 | It is allowed to give an argument to the command, e.g. "csh -f". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7383 | See |option-backslash| about including spaces and backslashes. |
| 7384 | Environment variables are expanded |:set_env|. |
Bram Moolenaar | 4bfa8af | 2018-02-03 15:14:46 +0100 | [diff] [blame] | 7385 | |
Bram Moolenaar | a2baa73 | 2022-02-04 16:09:54 +0000 | [diff] [blame] | 7386 | In |restricted-mode| shell commands will not be possible. This mode |
| 7387 | is used if the value of $SHELL ends in "false" or "nologin". |
| 7388 | |
Bram Moolenaar | 1ff14ba | 2019-11-02 14:09:23 +0100 | [diff] [blame] | 7389 | If the name of the shell contains a space, you need to enclose it in |
Bram Moolenaar | 5ef1c6a | 2019-11-10 22:09:11 +0100 | [diff] [blame] | 7390 | quotes and escape the space. Example with quotes: > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7391 | :set shell=\"c:\program\ files\unix\sh.exe\"\ -f |
| 7392 | < Note the backslash before each quote (to avoid starting a comment) and |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 7393 | each space (to avoid ending the option value). Also note that the |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7394 | "-f" is not inside the quotes, because it is not part of the command |
Bram Moolenaar | 4bfa8af | 2018-02-03 15:14:46 +0100 | [diff] [blame] | 7395 | name. Vim automagically recognizes the backslashes that are path |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7396 | separators. |
Bram Moolenaar | 4bfa8af | 2018-02-03 15:14:46 +0100 | [diff] [blame] | 7397 | Example with escaped space (Vim will do this when initializing the |
| 7398 | option from $SHELL): > |
| 7399 | :set shell=/bin/with\\\ space/sh |
Bram Moolenaar | d473c8c | 2018-08-11 18:00:22 +0200 | [diff] [blame] | 7400 | < The resulting value of 'shell' is "/bin/with\ space/sh", two |
Bram Moolenaar | 4bfa8af | 2018-02-03 15:14:46 +0100 | [diff] [blame] | 7401 | backslashes are consumed by `:set`. |
| 7402 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7403 | Under MS-Windows, when the executable ends in ".com" it must be |
| 7404 | included. Thus setting the shell to "command.com" or "4dos.com" |
| 7405 | works, but "command" and "4dos" do not work for all commands (e.g., |
| 7406 | filtering). |
| 7407 | For unknown reasons, when using "4dos.com" the current directory is |
| 7408 | changed to "C:\". To avoid this set 'shell' like this: > |
| 7409 | :set shell=command.com\ /c\ 4dos |
| 7410 | < This option cannot be set from a |modeline| or in the |sandbox|, for |
| 7411 | security reasons. |
| 7412 | |
| 7413 | *'shellcmdflag'* *'shcf'* |
Bram Moolenaar | 5dc6252 | 2012-02-13 00:05:22 +0100 | [diff] [blame] | 7414 | 'shellcmdflag' 'shcf' string (default: "-c"; |
Mike Williams | 1279502 | 2021-06-28 20:53:58 +0200 | [diff] [blame] | 7415 | Win32, when 'shell' contains "powershell": |
| 7416 | "-Command", or when it does not contain "sh" |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 7417 | somewhere: "/c") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7418 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7419 | Flag passed to the shell to execute "!" and ":!" commands; e.g., |
Mike Williams | 1279502 | 2021-06-28 20:53:58 +0200 | [diff] [blame] | 7420 | "bash.exe -c ls", "powershell.exe -Command dir", or "cmd.exe /c dir". |
| 7421 | For MS-Windows, the default is set according to the value of 'shell', |
| 7422 | to reduce the need to set this option by the user. |
Bram Moolenaar | 5302d9e | 2011-09-14 17:55:08 +0200 | [diff] [blame] | 7423 | On Unix it can have more than one flag. Each white space separated |
| 7424 | part is passed as an argument to the shell command. |
| 7425 | See |option-backslash| about including spaces and backslashes. |
Mike Williams | 1279502 | 2021-06-28 20:53:58 +0200 | [diff] [blame] | 7426 | Also see |dos-shell| and |dos-powershell| for MS-Windows. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7427 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 7428 | security reasons. |
| 7429 | |
| 7430 | *'shellpipe'* *'sp'* |
Mike Williams | 1279502 | 2021-06-28 20:53:58 +0200 | [diff] [blame] | 7431 | 'shellpipe' 'sp' string (default ">", ">%s 2>&1", "| tee", "|& tee" |
| 7432 | "2>&1| tee", or |
| 7433 | "2>&1 | Out-File -Encoding default") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7434 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7435 | {not available when compiled without the |+quickfix| |
| 7436 | feature} |
| 7437 | String to be used to put the output of the ":make" command in the |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 7438 | error file. See also |:make_makeprg|. See |option-backslash| about |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7439 | including spaces and backslashes. |
| 7440 | The name of the temporary file can be represented by "%s" if necessary |
| 7441 | (the file name is appended automatically if no %s appears in the value |
| 7442 | of this option). |
Mike Williams | 1279502 | 2021-06-28 20:53:58 +0200 | [diff] [blame] | 7443 | For the Amiga the default is ">". For MS-Windows using powershell the |
| 7444 | default is "2>&1 | Out-File -Encoding default", otherwise the default |
| 7445 | is ">%s 2>&1". The output is directly saved in a file and not echoed |
| 7446 | to the screen. |
Bram Moolenaar | 1c6737b | 2020-09-07 22:18:52 +0200 | [diff] [blame] | 7447 | For Unix the default is "| tee". The stdout of the compiler is saved |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7448 | in a file and echoed to the screen. If the 'shell' option is "csh" or |
| 7449 | "tcsh" after initializations, the default becomes "|& tee". If the |
Bram Moolenaar | 96f45c0 | 2019-10-26 19:53:45 +0200 | [diff] [blame] | 7450 | 'shell' option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta", |
Natanael Copa | 5631836 | 2021-05-06 18:46:35 +0200 | [diff] [blame] | 7451 | "bash", "fish", "ash" or "dash" the default becomes "2>&1| tee". This |
| 7452 | means that stderr is also included. Before using the 'shell' option a |
| 7453 | path is removed, thus "/bin/sh" uses "sh". |
Mike Williams | a3d1b29 | 2021-06-30 20:56:00 +0200 | [diff] [blame] | 7454 | For Unix and MS-Windows, when the 'shell' option is "pwsh" the default |
| 7455 | becomes ">%s 2>&1" and the output is not echoed to the screen. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7456 | The initialization of this option is done after reading the ".vimrc" |
| 7457 | and the other initializations, so that when the 'shell' option is set |
| 7458 | there, the 'shellpipe' option changes automatically, unless it was |
| 7459 | explicitly set before. |
| 7460 | When 'shellpipe' is set to an empty string, no redirection of the |
| 7461 | ":make" output will be done. This is useful if you use a 'makeprg' |
| 7462 | that writes to 'makeef' by itself. If you want no piping, but do |
| 7463 | want to include the 'makeef', set 'shellpipe' to a single space. |
| 7464 | Don't forget to precede the space with a backslash: ":set sp=\ ". |
| 7465 | In the future pipes may be used for filtering and this option will |
| 7466 | become obsolete (at least for Unix). |
| 7467 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 7468 | security reasons. |
| 7469 | |
| 7470 | *'shellquote'* *'shq'* |
Mike Williams | a3d1b29 | 2021-06-30 20:56:00 +0200 | [diff] [blame] | 7471 | 'shellquote' 'shq' string (default: "") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7472 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7473 | Quoting character(s), put around the command passed to the shell, for |
| 7474 | the "!" and ":!" commands. The redirection is kept outside of the |
| 7475 | quoting. See 'shellxquote' to include the redirection. It's |
| 7476 | probably not useful to set both options. |
| 7477 | This is an empty string by default. Only known to be useful for |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 7478 | third-party shells on MS-Windows-like systems, such as the MKS Korn |
Mike Williams | a3d1b29 | 2021-06-30 20:56:00 +0200 | [diff] [blame] | 7479 | Shell or bash, where it should be "\"". See |dos-shell|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7480 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 7481 | security reasons. |
| 7482 | |
| 7483 | *'shellredir'* *'srr'* |
Mike Williams | 1279502 | 2021-06-28 20:53:58 +0200 | [diff] [blame] | 7484 | 'shellredir' 'srr' string (default ">", ">&", ">%s 2>&1", or |
| 7485 | "2>&1 | Out-File -Encoding default") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7486 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7487 | String to be used to put the output of a filter command in a temporary |
| 7488 | file. See also |:!|. See |option-backslash| about including spaces |
| 7489 | and backslashes. |
| 7490 | The name of the temporary file can be represented by "%s" if necessary |
| 7491 | (the file name is appended automatically if no %s appears in the value |
| 7492 | of this option). |
Bram Moolenaar | 96f45c0 | 2019-10-26 19:53:45 +0200 | [diff] [blame] | 7493 | The default is ">". For Unix, if the 'shell' option is "csh" or |
| 7494 | "tcsh" during initializations, the default becomes ">&". If the |
Bram Moolenaar | 0c0734d | 2019-11-26 21:44:46 +0100 | [diff] [blame] | 7495 | 'shell' option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta", |
Mike Williams | a3d1b29 | 2021-06-30 20:56:00 +0200 | [diff] [blame] | 7496 | "bash", "fish", or "pwsh", the default becomes ">%s 2>&1". This means |
| 7497 | that stderr is also included. For Win32, the Unix checks are done and |
Mike Williams | 1279502 | 2021-06-28 20:53:58 +0200 | [diff] [blame] | 7498 | additionally "cmd" is checked for, which makes the default ">%s 2>&1", |
| 7499 | and "powershell" is checked for which makes the default |
Mike Williams | a3d1b29 | 2021-06-30 20:56:00 +0200 | [diff] [blame] | 7500 | "2>&1 | Out-File -Encoding default" (see |dos-powershell|). Also, the |
| 7501 | same names with ".exe" appended are checked for. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7502 | The initialization of this option is done after reading the ".vimrc" |
| 7503 | and the other initializations, so that when the 'shell' option is set |
| 7504 | there, the 'shellredir' option changes automatically unless it was |
| 7505 | explicitly set before. |
| 7506 | In the future pipes may be used for filtering and this option will |
| 7507 | become obsolete (at least for Unix). |
| 7508 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 7509 | security reasons. |
| 7510 | |
| 7511 | *'shellslash'* *'ssl'* *'noshellslash'* *'nossl'* |
| 7512 | 'shellslash' 'ssl' boolean (default off) |
| 7513 | global |
Bram Moolenaar | 6f345a1 | 2019-12-17 21:27:18 +0100 | [diff] [blame] | 7514 | {only for MS-Windows} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7515 | When set, a forward slash is used when expanding file names. This is |
Mike Williams | a3d1b29 | 2021-06-30 20:56:00 +0200 | [diff] [blame] | 7516 | useful when a Unix-like shell is used instead of cmd.exe, pwsh.exe, or |
Mike Williams | 1279502 | 2021-06-28 20:53:58 +0200 | [diff] [blame] | 7517 | powershell.exe. Backward slashes can still be typed, but they are |
| 7518 | changed to forward slashes by Vim. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7519 | Note that setting or resetting this option has no effect for some |
| 7520 | existing file names, thus this option needs to be set before opening |
| 7521 | any file for best results. This might change in the future. |
| 7522 | 'shellslash' only works when a backslash can be used as a path |
| 7523 | separator. To test if this is so use: > |
| 7524 | if exists('+shellslash') |
Bram Moolenaar | ac3150d | 2019-07-28 16:36:39 +0200 | [diff] [blame] | 7525 | < Also see 'completeslash'. |
| 7526 | |
Bram Moolenaar | 26a60b4 | 2005-02-22 08:49:11 +0000 | [diff] [blame] | 7527 | *'shelltemp'* *'stmp'* *'noshelltemp'* *'nostmp'* |
| 7528 | 'shelltemp' 'stmp' boolean (Vi default off, Vim default on) |
| 7529 | global |
Bram Moolenaar | 26a60b4 | 2005-02-22 08:49:11 +0000 | [diff] [blame] | 7530 | When on, use temp files for shell commands. When off use a pipe. |
| 7531 | When using a pipe is not possible temp files are used anyway. |
Bram Moolenaar | 9729301 | 2011-07-18 19:40:27 +0200 | [diff] [blame] | 7532 | Currently a pipe is only supported on Unix and MS-Windows 2K and |
| 7533 | later. You can check it with: > |
Bram Moolenaar | 26a60b4 | 2005-02-22 08:49:11 +0000 | [diff] [blame] | 7534 | :if has("filterpipe") |
| 7535 | < The advantage of using a pipe is that nobody can read the temp file |
| 7536 | and the 'shell' command does not need to support redirection. |
| 7537 | The advantage of using a temp file is that the file type and encoding |
| 7538 | can be detected. |
| 7539 | The |FilterReadPre|, |FilterReadPost| and |FilterWritePre|, |
| 7540 | |FilterWritePost| autocommands event are not triggered when |
| 7541 | 'shelltemp' is off. |
Bram Moolenaar | 269f595 | 2016-07-15 22:54:41 +0200 | [diff] [blame] | 7542 | The `system()` function does not respect this option and always uses |
| 7543 | temp files. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 7544 | NOTE: This option is set to the Vim default value when 'compatible' |
| 7545 | is reset. |
Bram Moolenaar | 26a60b4 | 2005-02-22 08:49:11 +0000 | [diff] [blame] | 7546 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7547 | *'shelltype'* *'st'* |
| 7548 | 'shelltype' 'st' number (default 0) |
| 7549 | global |
Bram Moolenaar | 6c60f47 | 2019-04-28 16:00:35 +0200 | [diff] [blame] | 7550 | {only for the Amiga} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7551 | On the Amiga this option influences the way how the commands work |
| 7552 | which use a shell. |
| 7553 | 0 and 1: always use the shell |
| 7554 | 2 and 3: use the shell only to filter lines |
| 7555 | 4 and 5: use shell only for ':sh' command |
| 7556 | When not using the shell, the command is executed directly. |
| 7557 | |
| 7558 | 0 and 2: use "shell 'shellcmdflag' cmd" to start external commands |
| 7559 | 1 and 3: use "shell cmd" to start external commands |
| 7560 | |
Bram Moolenaar | db7207e | 2012-02-22 17:30:19 +0100 | [diff] [blame] | 7561 | *'shellxescape'* *'sxe'* |
| 7562 | 'shellxescape' 'sxe' string (default: ""; |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 7563 | for MS-Windows: "\"&|<>()@^") |
Bram Moolenaar | db7207e | 2012-02-22 17:30:19 +0100 | [diff] [blame] | 7564 | global |
Bram Moolenaar | db7207e | 2012-02-22 17:30:19 +0100 | [diff] [blame] | 7565 | When 'shellxquote' is set to "(" then the characters listed in this |
| 7566 | option will be escaped with a '^' character. This makes it possible |
| 7567 | to execute most external commands with cmd.exe. |
dkearns | 8ebdbc9 | 2023-10-29 06:26:19 +1100 | [diff] [blame] | 7568 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 7569 | security reasons. |
Bram Moolenaar | db7207e | 2012-02-22 17:30:19 +0100 | [diff] [blame] | 7570 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7571 | *'shellxquote'* *'sxq'* |
| 7572 | 'shellxquote' 'sxq' string (default: ""; |
Bram Moolenaar | f66b3fc | 2012-02-20 22:18:30 +0100 | [diff] [blame] | 7573 | for Win32, when 'shell' is cmd.exe: "(" |
Mike Williams | 1279502 | 2021-06-28 20:53:58 +0200 | [diff] [blame] | 7574 | for Win32, when 'shell' is |
| 7575 | powershell.exe: "\"" |
Bram Moolenaar | f66b3fc | 2012-02-20 22:18:30 +0100 | [diff] [blame] | 7576 | for Win32, when 'shell' contains "sh" |
| 7577 | somewhere: "\"" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7578 | for Unix, when using system(): "\"") |
| 7579 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7580 | Quoting character(s), put around the command passed to the shell, for |
| 7581 | the "!" and ":!" commands. Includes the redirection. See |
| 7582 | 'shellquote' to exclude the redirection. It's probably not useful |
| 7583 | to set both options. |
Bram Moolenaar | f66b3fc | 2012-02-20 22:18:30 +0100 | [diff] [blame] | 7584 | When the value is '(' then ')' is appended. When the value is '"(' |
| 7585 | then ')"' is appended. |
| 7586 | When the value is '(' then also see 'shellxescape'. |
Bram Moolenaar | a64ba22 | 2012-02-12 23:23:31 +0100 | [diff] [blame] | 7587 | This is an empty string by default on most systems, but is known to be |
Mike Williams | a3d1b29 | 2021-06-30 20:56:00 +0200 | [diff] [blame] | 7588 | useful for on Win32 version, either for cmd.exe, powershell.exe, or |
| 7589 | pwsh.exe which automatically strips off the first and last quote on a |
| 7590 | command, or 3rd-party shells such as the MKS Korn Shell or bash, where |
| 7591 | it should be "\"". The default is adjusted according the value of |
Mike Williams | 1279502 | 2021-06-28 20:53:58 +0200 | [diff] [blame] | 7592 | 'shell', to reduce the need to set this option by the user. See |
| 7593 | |dos-shell|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7594 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 7595 | security reasons. |
| 7596 | |
| 7597 | *'shiftround'* *'sr'* *'noshiftround'* *'nosr'* |
| 7598 | 'shiftround' 'sr' boolean (default off) |
| 7599 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7600 | Round indent to multiple of 'shiftwidth'. Applies to > and < |
| 7601 | commands. CTRL-T and CTRL-D in Insert mode always round the indent to |
| 7602 | a multiple of 'shiftwidth' (this is Vi compatible). |
| 7603 | NOTE: This option is reset when 'compatible' is set. |
| 7604 | |
| 7605 | *'shiftwidth'* *'sw'* |
| 7606 | 'shiftwidth' 'sw' number (default 8) |
| 7607 | local to buffer |
Damien Lejay | 95ea0b0 | 2025-06-01 19:10:36 +0200 | [diff] [blame] | 7608 | Number of columns that make up one level of (auto)indentation. Used |
| 7609 | by |'cindent'|, |<<|, |>>|, etc. |
| 7610 | If set to 0, Vim uses the current 'tabstop' value. Use |shiftwidth()| |
| 7611 | to obtain the effective value in scripts. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7612 | |
| 7613 | *'shortmess'* *'shm'* |
Bram Moolenaar | 9dfa313 | 2019-05-04 21:08:40 +0200 | [diff] [blame] | 7614 | 'shortmess' 'shm' string (Vim default "filnxtToOS", Vi default: "S", |
| 7615 | POSIX default: "AS") |
Bram Moolenaar | f1dcd14 | 2022-12-31 15:30:45 +0000 | [diff] [blame] | 7616 | global *E1336* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7617 | This option helps to avoid all the |hit-enter| prompts caused by file |
Dominique Pellé | df62c62 | 2024-07-15 20:29:59 +0200 | [diff] [blame] | 7618 | messages, for example with CTRL-G, and to avoid some other messages. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7619 | It is a list of flags: |
| 7620 | flag meaning when present ~ |
Bram Moolenaar | 7db29e4 | 2022-12-11 15:53:04 +0000 | [diff] [blame] | 7621 | f use "(3 of 5)" instead of "(file 3 of 5)" *shm-f* |
| 7622 | i use "[noeol]" instead of "[Incomplete last line]" *shm-i* |
| 7623 | l use "999L, 888B" instead of "999 lines, 888 bytes" *shm-l* |
| 7624 | m use "[+]" instead of "[Modified]" *shm-m* |
| 7625 | n use "[New]" instead of "[New File]" *shm-n* |
| 7626 | r use "[RO]" instead of "[readonly]" *shm-r* |
| 7627 | w use "[w]" instead of "written" for file write message *shm-w* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7628 | and "[a]" instead of "appended" for ':w >> file' command |
Bram Moolenaar | 7db29e4 | 2022-12-11 15:53:04 +0000 | [diff] [blame] | 7629 | x use "[dos]" instead of "[dos format]", "[unix]" *shm-x* |
| 7630 | instead of "[unix format]" and "[mac]" instead of "[mac |
Bram Moolenaar | f1dcd14 | 2022-12-31 15:30:45 +0000 | [diff] [blame] | 7631 | format]" |
Bram Moolenaar | 7db29e4 | 2022-12-11 15:53:04 +0000 | [diff] [blame] | 7632 | a all of the above abbreviations *shm-a* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7633 | |
Bram Moolenaar | 7db29e4 | 2022-12-11 15:53:04 +0000 | [diff] [blame] | 7634 | o overwrite message for writing a file with subsequent *shm-o* |
| 7635 | message for reading a file (useful for ":wn" or when |
| 7636 | 'autowrite' on) |
Bram Moolenaar | f1dcd14 | 2022-12-31 15:30:45 +0000 | [diff] [blame] | 7637 | O message for reading a file overwrites any previous *shm-O* |
| 7638 | message; also for quickfix message (e.g., ":cn") |
Bram Moolenaar | 7db29e4 | 2022-12-11 15:53:04 +0000 | [diff] [blame] | 7639 | s don't give "search hit BOTTOM, continuing at TOP" or *shm-s* |
| 7640 | "search hit TOP, continuing at BOTTOM" messages; when using |
Christian Brabandt | e299591 | 2024-06-01 20:40:25 +0200 | [diff] [blame] | 7641 | the search count do not show "W" before the count message |
| 7642 | (see |shm-S| below) |
Bram Moolenaar | 7db29e4 | 2022-12-11 15:53:04 +0000 | [diff] [blame] | 7643 | t truncate file message at the start if it is too long *shm-t* |
| 7644 | to fit on the command-line, "<" will appear in the left most |
Bram Moolenaar | f1dcd14 | 2022-12-31 15:30:45 +0000 | [diff] [blame] | 7645 | column; ignored in Ex mode |
Bram Moolenaar | 7db29e4 | 2022-12-11 15:53:04 +0000 | [diff] [blame] | 7646 | T truncate other messages in the middle if they are too *shm-T* |
Bram Moolenaar | f1dcd14 | 2022-12-31 15:30:45 +0000 | [diff] [blame] | 7647 | long to fit on the command line; "..." will appear in the |
| 7648 | middle; ignored in Ex mode |
Bram Moolenaar | 7db29e4 | 2022-12-11 15:53:04 +0000 | [diff] [blame] | 7649 | W don't give "written" or "[w]" when writing a file *shm-W* |
| 7650 | A don't give the "ATTENTION" message when an existing *shm-A* |
Bram Moolenaar | f1dcd14 | 2022-12-31 15:30:45 +0000 | [diff] [blame] | 7651 | swap file is found |
Bram Moolenaar | 7db29e4 | 2022-12-11 15:53:04 +0000 | [diff] [blame] | 7652 | I don't give the intro message when starting Vim, *shm-I* |
Bram Moolenaar | 938ae28 | 2023-02-20 20:44:55 +0000 | [diff] [blame] | 7653 | see |:intro| |
Bram Moolenaar | f1dcd14 | 2022-12-31 15:30:45 +0000 | [diff] [blame] | 7654 | c don't give |ins-completion-menu| messages; for *shm-c* |
Bram Moolenaar | 7db29e4 | 2022-12-11 15:53:04 +0000 | [diff] [blame] | 7655 | example, "-- XXX completion (YYY)", "match 1 of 2", "The only |
| 7656 | match", "Pattern not found", "Back at original", etc. |
| 7657 | C don't give messages while scanning for ins-completion *shm-C* |
| 7658 | items, for instance "scanning tags" |
| 7659 | q use "recording" instead of "recording @a" *shm-q* |
| 7660 | F don't give the file info when editing a file, like *shm-F* |
| 7661 | `:silent` was used for the command; note that this also |
Shougo Matsushita | 9db39b0 | 2024-03-06 20:58:41 +0100 | [diff] [blame] | 7662 | affects messages from autocommands and 'autoread' reloading |
Bram Moolenaar | 938ae28 | 2023-02-20 20:44:55 +0000 | [diff] [blame] | 7663 | S do not show search count message when searching, e.g. *shm-S* |
Christian Brabandt | e299591 | 2024-06-01 20:40:25 +0200 | [diff] [blame] | 7664 | "[1/5]". When the "S" flag is not present (e.g. search count |
| 7665 | is shown), the "search hit BOTTOM, continuing at TOP" and |
| 7666 | "search hit TOP, continuing at BOTTOM" messages are only |
| 7667 | indicated by a "W" (Mnemonic: Wrapped) letter before the |
| 7668 | search count statistics. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7669 | |
| 7670 | This gives you the opportunity to avoid that a change between buffers |
| 7671 | requires you to hit <Enter>, but still gives as useful a message as |
| 7672 | possible for the space available. To get the whole message that you |
| 7673 | would have got with 'shm' empty, use ":file!" |
| 7674 | Useful values: |
| 7675 | shm= No abbreviation of message. |
| 7676 | shm=a Abbreviation, but no loss of information. |
| 7677 | shm=at Abbreviation, and truncate message when necessary. |
| 7678 | |
| 7679 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 7680 | set and to the Vim default value when 'compatible' is reset. |
| 7681 | |
| 7682 | *'shortname'* *'sn'* *'noshortname'* *'nosn'* |
| 7683 | 'shortname' 'sn' boolean (default off) |
| 7684 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7685 | Filenames are assumed to be 8 characters plus one extension of 3 |
| 7686 | characters. Multiple dots in file names are not allowed. When this |
| 7687 | option is on, dots in file names are replaced with underscores when |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 7688 | adding an extension (".~" or ".swp"). This option is useful |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7689 | when editing files on an MS-DOS compatible filesystem, e.g., messydos |
Bram Moolenaar | ade0d39 | 2020-01-21 22:33:58 +0100 | [diff] [blame] | 7690 | or crossdos. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7691 | |
| 7692 | *'showbreak'* *'sbr'* *E595* |
| 7693 | 'showbreak' 'sbr' string (default "") |
Bram Moolenaar | ee85702 | 2019-11-09 23:26:40 +0100 | [diff] [blame] | 7694 | global or local to window |global-local| |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 7695 | {not available when compiled without the |+linebreak| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7696 | feature} |
| 7697 | String to put at the start of lines that have been wrapped. Useful |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 7698 | values are "> " or "+++ ": > |
| 7699 | :set showbreak=>\ |
| 7700 | < Note the backslash to escape the trailing space. It's easier like |
| 7701 | this: > |
Bram Moolenaar | 1a38442 | 2010-07-14 19:53:30 +0200 | [diff] [blame] | 7702 | :let &showbreak = '+++ ' |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 7703 | < Only printable single-cell characters are allowed, excluding <Tab> and |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7704 | comma (in a future version the comma might be used to separate the |
| 7705 | part that is shown at the end and at the start of a line). |
| 7706 | The characters are highlighted according to the '@' flag in |
| 7707 | 'highlight'. |
| 7708 | Note that tabs after the showbreak will be displayed differently. |
| 7709 | If you want the 'showbreak' to appear in between line numbers, add the |
| 7710 | "n" flag to 'cpoptions'. |
Bram Moolenaar | ee85702 | 2019-11-09 23:26:40 +0100 | [diff] [blame] | 7711 | A window-local value overrules a global value. If the global value is |
| 7712 | set and you want no value in the current window use NONE: > |
| 7713 | :setlocal showbreak=NONE |
| 7714 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7715 | *'showcmd'* *'sc'* *'noshowcmd'* *'nosc'* |
Bram Moolenaar | 8c08b5b | 2016-07-28 22:24:15 +0200 | [diff] [blame] | 7716 | 'showcmd' 'sc' boolean (Vim default: on, off for Unix, |
| 7717 | Vi default: off, set in |defaults.vim|) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7718 | global |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 7719 | Show (partial) command in the last line of the screen. Set this |
| 7720 | option off if your terminal is slow. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7721 | In Visual mode the size of the selected area is shown: |
| 7722 | - When selecting characters within a line, the number of characters. |
Bram Moolenaar | f91787c | 2010-07-17 12:47:16 +0200 | [diff] [blame] | 7723 | If the number of bytes is different it is also displayed: "2-6" |
| 7724 | means two characters and six bytes. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7725 | - When selecting more than one line, the number of lines. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 7726 | - When selecting a block, the size in screen characters: |
| 7727 | {lines}x{columns}. |
Luuk van Baal | ba936f6 | 2022-12-15 13:15:39 +0000 | [diff] [blame] | 7728 | This information can be displayed in an alternative location using the |
| 7729 | 'showcmdloc' option. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7730 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 7731 | set and to the Vim default value when 'compatible' is reset. |
| 7732 | |
Luuk van Baal | ba936f6 | 2022-12-15 13:15:39 +0000 | [diff] [blame] | 7733 | *'showcmdloc'* *'sloc'* |
| 7734 | 'showcmdloc' 'sloc' string (default "last") |
Bram Moolenaar | f1dcd14 | 2022-12-31 15:30:45 +0000 | [diff] [blame] | 7735 | global |
Luuk van Baal | ba936f6 | 2022-12-15 13:15:39 +0000 | [diff] [blame] | 7736 | This option can be used to display the (partially) entered command in |
| 7737 | another location. Possible values are: |
| 7738 | last Last line of the screen (default). |
| 7739 | statusline Status line of the current window. |
Bram Moolenaar | f1dcd14 | 2022-12-31 15:30:45 +0000 | [diff] [blame] | 7740 | tabline First line of the screen if 'showtabline' is enabled. |
Luuk van Baal | ba936f6 | 2022-12-15 13:15:39 +0000 | [diff] [blame] | 7741 | Setting this option to "statusline" or "tabline" means that these will |
| 7742 | be redrawn whenever the command changes, which can be on every key |
| 7743 | pressed. |
| 7744 | The %S 'statusline' item can be used in 'statusline' or 'tabline' to |
| 7745 | place the text. Without a custom 'statusline' or 'tabline' it will be |
| 7746 | displayed in a convenient location. |
| 7747 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7748 | *'showfulltag'* *'sft'* *'noshowfulltag'* *'nosft'* |
| 7749 | 'showfulltag' 'sft' boolean (default off) |
| 7750 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7751 | When completing a word in insert mode (see |ins-completion|) from the |
| 7752 | tags file, show both the tag name and a tidied-up form of the search |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 7753 | pattern (if there is one) as possible matches. Thus, if you have |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7754 | matched a C function, you can see a template for what arguments are |
| 7755 | required (coding style permitting). |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 7756 | Note that this doesn't work well together with having "longest" in |
| 7757 | 'completeopt', because the completion from the search pattern may not |
| 7758 | match the typed text. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7759 | |
| 7760 | *'showmatch'* *'sm'* *'noshowmatch'* *'nosm'* |
| 7761 | 'showmatch' 'sm' boolean (default off) |
| 7762 | global |
| 7763 | When a bracket is inserted, briefly jump to the matching one. The |
| 7764 | jump is only done if the match can be seen on the screen. The time to |
| 7765 | show the match can be set with 'matchtime'. |
| 7766 | A Beep is given if there is no match (no matter if the match can be |
Bram Moolenaar | ca63501 | 2015-09-25 20:34:21 +0200 | [diff] [blame] | 7767 | seen or not). |
| 7768 | This option is reset when 'paste' is set and restored when 'paste' is |
| 7769 | reset. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7770 | When the 'm' flag is not included in 'cpoptions', typing a character |
| 7771 | will immediately move the cursor back to where it belongs. |
| 7772 | See the "sm" field in 'guicursor' for setting the cursor shape and |
| 7773 | blinking when showing the match. |
| 7774 | The 'matchpairs' option can be used to specify the characters to show |
| 7775 | matches for. 'rightleft' and 'revins' are used to look for opposite |
| 7776 | matches. |
Bram Moolenaar | fd2ac76 | 2006-03-01 22:09:21 +0000 | [diff] [blame] | 7777 | Also see the matchparen plugin for highlighting the match when moving |
| 7778 | around |pi_paren.txt|. |
| 7779 | Note: Use of the short form is rated PG. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7780 | |
| 7781 | *'showmode'* *'smd'* *'noshowmode'* *'nosmd'* |
| 7782 | 'showmode' 'smd' boolean (Vim default: on, Vi default: off) |
| 7783 | global |
| 7784 | If in Insert, Replace or Visual mode put a message on the last line. |
| 7785 | Use the 'M' flag in 'highlight' to set the type of highlighting for |
| 7786 | this message. |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 7787 | When |XIM| may be used the message will include "XIM". But this |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7788 | doesn't mean XIM is really active, especially when 'imactivatekey' is |
| 7789 | not set. |
| 7790 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 7791 | set and to the Vim default value when 'compatible' is reset. |
| 7792 | |
Bram Moolenaar | faa959a | 2006-02-20 21:37:40 +0000 | [diff] [blame] | 7793 | *'showtabline'* *'stal'* |
| 7794 | 'showtabline' 'stal' number (default 1) |
| 7795 | global |
Bram Moolenaar | faa959a | 2006-02-20 21:37:40 +0000 | [diff] [blame] | 7796 | The value of this option specifies when the line with tab page labels |
| 7797 | will be displayed: |
| 7798 | 0: never |
| 7799 | 1: only if there are at least two tab pages |
| 7800 | 2: always |
| 7801 | This is both for the GUI and non-GUI implementation of the tab pages |
| 7802 | line. |
| 7803 | See |tab-page| for more information about tab pages. |
| 7804 | |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 7805 | *'showtabpanel'* *'stpl'* |
| 7806 | 'showtabpanel' 'stpl' number (default 0) |
| 7807 | global |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 7808 | {not available when compiled without the |+tabpanel| |
| 7809 | feature} |
| 7810 | The value of this option specifies when the |tabpanel| with tab page |
| 7811 | labels will be displayed: |
| 7812 | 0: never |
| 7813 | 1: only if there are at least two tab pages |
| 7814 | 2: always |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 7815 | See |tab-page| for more information about tab page labels. |
| 7816 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7817 | *'sidescroll'* *'ss'* |
| 7818 | 'sidescroll' 'ss' number (default 0) |
| 7819 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7820 | The minimal number of columns to scroll horizontally. Used only when |
| 7821 | the 'wrap' option is off and the cursor is moved off of the screen. |
| 7822 | When it is zero the cursor will be put in the middle of the screen. |
| 7823 | When using a slow terminal set it to a large number or 0. When using |
| 7824 | a fast terminal use a small number or 1. Not used for "zh" and "zl" |
| 7825 | commands. |
| 7826 | |
| 7827 | *'sidescrolloff'* *'siso'* |
| 7828 | 'sidescrolloff' 'siso' number (default 0) |
Bram Moolenaar | 375e339 | 2019-01-31 18:26:10 +0100 | [diff] [blame] | 7829 | global or local to window |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7830 | The minimal number of screen columns to keep to the left and to the |
Bram Moolenaar | 482aaeb | 2005-09-29 18:26:07 +0000 | [diff] [blame] | 7831 | right of the cursor if 'nowrap' is set. Setting this option to a |
| 7832 | value greater than 0 while having |'sidescroll'| also at a non-zero |
| 7833 | value makes some context visible in the line you are scrolling in |
| 7834 | horizontally (except at beginning of the line). Setting this option |
| 7835 | to a large value (like 999) has the effect of keeping the cursor |
| 7836 | horizontally centered in the window, as long as one does not come too |
| 7837 | close to the beginning of the line. |
Bram Moolenaar | 375e339 | 2019-01-31 18:26:10 +0100 | [diff] [blame] | 7838 | After using the local value, go back the global value with one of |
| 7839 | these two: > |
| 7840 | setlocal sidescrolloff< |
| 7841 | setlocal sidescrolloff=-1 |
| 7842 | < NOTE: This option is set to 0 when 'compatible' is set. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7843 | |
| 7844 | Example: Try this together with 'sidescroll' and 'listchars' as |
| 7845 | in the following example to never allow the cursor to move |
Bram Moolenaar | 95ec9d6 | 2016-08-12 18:29:59 +0200 | [diff] [blame] | 7846 | onto the "extends" character: > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7847 | |
| 7848 | :set nowrap sidescroll=1 listchars=extends:>,precedes:< |
| 7849 | :set sidescrolloff=1 |
Bram Moolenaar | 95ec9d6 | 2016-08-12 18:29:59 +0200 | [diff] [blame] | 7850 | < |
| 7851 | *'signcolumn'* *'scl'* |
| 7852 | 'signcolumn' 'scl' string (default "auto") |
| 7853 | local to window |
Bram Moolenaar | 95ec9d6 | 2016-08-12 18:29:59 +0200 | [diff] [blame] | 7854 | {not available when compiled without the |+signs| |
| 7855 | feature} |
Bram Moolenaar | 0952131 | 2016-08-12 22:54:35 +0200 | [diff] [blame] | 7856 | Whether or not to draw the signcolumn. Valid values are: |
Bram Moolenaar | 938ae28 | 2023-02-20 20:44:55 +0000 | [diff] [blame] | 7857 | "auto" only when there is a sign to display |
| 7858 | "no" never |
| 7859 | "yes" always |
Bram Moolenaar | 394c5d8 | 2019-06-17 21:48:05 +0200 | [diff] [blame] | 7860 | "number" display signs in the 'number' column. If the number |
Bram Moolenaar | 6c1e157 | 2019-06-22 02:13:00 +0200 | [diff] [blame] | 7861 | column is not present, then behaves like "auto". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7862 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7863 | *'smartcase'* *'scs'* *'nosmartcase'* *'noscs'* |
| 7864 | 'smartcase' 'scs' boolean (default off) |
| 7865 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7866 | Override the 'ignorecase' option if the search pattern contains upper |
| 7867 | case characters. Only used when the search pattern is typed and |
| 7868 | 'ignorecase' option is on. Used for the commands "/", "?", "n", "N", |
Girish Palya | dc31405 | 2025-05-08 23:28:52 +0200 | [diff] [blame] | 7869 | ":g" and ":s" and when filtering matches for the completion menu |
| 7870 | |compl-states|. |
| 7871 | Not used for "*", "#", "gd", tag search, etc. After "*" and "#" you |
| 7872 | can make 'smartcase' used by doing a "/" command, recalling the search |
| 7873 | pattern from history and hitting <Enter>. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7874 | NOTE: This option is reset when 'compatible' is set. |
| 7875 | |
| 7876 | *'smartindent'* *'si'* *'nosmartindent'* *'nosi'* |
| 7877 | 'smartindent' 'si' boolean (default off) |
| 7878 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7879 | Do smart autoindenting when starting a new line. Works for C-like |
| 7880 | programs, but can also be used for other languages. 'cindent' does |
| 7881 | something like this, works better in most cases, but is more strict, |
Bram Moolenaar | 81af925 | 2010-12-10 20:35:50 +0100 | [diff] [blame] | 7882 | see |C-indenting|. When 'cindent' is on or 'indentexpr' is set, |
Bram Moolenaar | 166af9b | 2010-11-16 20:34:40 +0100 | [diff] [blame] | 7883 | setting 'si' has no effect. 'indentexpr' is a more advanced |
| 7884 | alternative. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7885 | Normally 'autoindent' should also be on when using 'smartindent'. |
| 7886 | An indent is automatically inserted: |
| 7887 | - After a line ending in '{'. |
| 7888 | - After a line starting with a keyword from 'cinwords'. |
| 7889 | - Before a line starting with '}' (only with the "O" command). |
| 7890 | When typing '}' as the first character in a new line, that line is |
| 7891 | given the same indent as the matching '{'. |
| 7892 | When typing '#' as the first character in a new line, the indent for |
| 7893 | that line is removed, the '#' is put in the first column. The indent |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 7894 | is restored for the next line. If you don't want this, use this |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7895 | mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H. |
| 7896 | When using the ">>" command, lines starting with '#' are not shifted |
| 7897 | right. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 7898 | NOTE: This option is reset when 'compatible' is set. |
Bram Moolenaar | ca63501 | 2015-09-25 20:34:21 +0200 | [diff] [blame] | 7899 | This option is reset when 'paste' is set and restored when 'paste' is |
| 7900 | reset. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7901 | |
| 7902 | *'smarttab'* *'sta'* *'nosmarttab'* *'nosta'* |
| 7903 | 'smarttab' 'sta' boolean (default off) |
| 7904 | global |
Damien Lejay | d6c9ac9 | 2025-06-04 21:19:18 +0200 | [diff] [blame] | 7905 | When enabled, the <Tab> key will indent by 'shiftwidth' if the cursor |
| 7906 | is in leading whitespace. The <BS> key has the opposite effect. |
Damien Lejay | bfa1636 | 2025-06-10 21:12:31 +0200 | [diff] [blame] | 7907 | In leading whitespace, this has the same effect as setting |
| 7908 | 'softtabstop' to the value of 'shiftwidth'. |
Damien Lejay | d6c9ac9 | 2025-06-04 21:19:18 +0200 | [diff] [blame] | 7909 | This option is reset when 'compatible' is set; it is temporarily |
| 7910 | disabled when 'paste' is enabled, and restored when 'paste' is turned |
| 7911 | off. |
Damien Lejay | bfa1636 | 2025-06-10 21:12:31 +0200 | [diff] [blame] | 7912 | NOTE: in most cases, using 'softtabstop' is a better option. Have a |
| 7913 | look at section |30.5| of the user guide for detailed |
Damien Lejay | d6c9ac9 | 2025-06-04 21:19:18 +0200 | [diff] [blame] | 7914 | explanations on how Vim works with tabs and spaces. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7915 | |
Bram Moolenaar | f6196f4 | 2022-10-02 21:29:55 +0100 | [diff] [blame] | 7916 | *'smoothscroll'* *'sms'* *'nosmoothscroll'* *'nosms'* |
| 7917 | 'smoothscroll' 'sms' boolean (default off) |
| 7918 | local to window |
| 7919 | Scrolling works with screen lines. When 'wrap' is set and the first |
| 7920 | line in the window wraps part of it may not be visible, as if it is |
Bram Moolenaar | f269eab | 2022-10-03 18:04:35 +0100 | [diff] [blame] | 7921 | above the window. "<<<" is displayed at the start of the first line, |
| 7922 | highlighted with |hl-NonText|. |
Bram Moolenaar | 10e8ff9 | 2023-06-10 21:40:39 +0100 | [diff] [blame] | 7923 | You may also want to add "lastline" to the 'display' option to show as |
| 7924 | much of the last line as possible. |
zeertzjq | ad493ef | 2024-03-29 10:23:19 +0100 | [diff] [blame] | 7925 | NOTE: partly implemented, doesn't work yet for |gj| and |gk|. |
Bram Moolenaar | f6196f4 | 2022-10-02 21:29:55 +0100 | [diff] [blame] | 7926 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7927 | *'softtabstop'* *'sts'* |
| 7928 | 'softtabstop' 'sts' number (default 0) |
| 7929 | local to buffer |
Damien Lejay | 91af4c4 | 2025-06-12 21:56:19 +0200 | [diff] [blame] | 7930 | Create soft tab stops, separated by 'softtabstop' number of columns. |
| 7931 | In Insert mode, pressing the <Tab> key will move the cursor to the |
| 7932 | next soft tab stop, instead of inserting a literal tab. <BS> behaves |
| 7933 | similarly in reverse. Vim inserts a minimal mix of tab and space |
| 7934 | characters to produce the visual effect. |
| 7935 | |
| 7936 | This setting does not affect the display of existing tab characters. |
| 7937 | |
| 7938 | A value of 0 disables this behaviour. A negative value makes Vim use |
| 7939 | 'shiftwidth'. If you plan to use 'sts' and 'shiftwidth' with |
| 7940 | different values, you might consider setting 'smarttab'. |
| 7941 | |
| 7942 | 'softtabstop' is temporarily set to 0 when 'paste' is on and reset |
| 7943 | when it is turned off. It is also reset when 'compatible' is set. |
| 7944 | |
| 7945 | The 'L' flag in 'cpoptions' alters tab behavior when 'list' is |
| 7946 | enabled. See also |ins-expandtab| ans user manual section |30.5| for |
| 7947 | in-depth explanations. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7948 | |
Bram Moolenaar | 04958cb | 2018-06-23 19:23:02 +0200 | [diff] [blame] | 7949 | If Vim is compiled with the |+vartabs| feature then the value of |
| 7950 | 'softtabstop' will be ignored if |'varsofttabstop'| is set to |
| 7951 | anything other than an empty string. |
| 7952 | |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 7953 | *'spell'* *'nospell'* |
| 7954 | 'spell' boolean (default off) |
| 7955 | local to window |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 7956 | {not available when compiled without the |+syntax| |
| 7957 | feature} |
| 7958 | When on spell checking will be done. See |spell|. |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 7959 | The languages are specified with 'spelllang'. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 7960 | |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 7961 | *'spellcapcheck'* *'spc'* |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 7962 | 'spellcapcheck' 'spc' string (default "[.?!]\_[\])'" \t]\+") |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 7963 | local to buffer |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 7964 | {not available when compiled without the |+syntax| |
| 7965 | feature} |
| 7966 | Pattern to locate the end of a sentence. The following word will be |
| 7967 | checked to start with a capital letter. If not then it is highlighted |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 7968 | with SpellCap |hl-SpellCap| (unless the word is also badly spelled). |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 7969 | When this check is not wanted make this option empty. |
| 7970 | Only used when 'spell' is set. |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 7971 | Be careful with special characters, see |option-backslash| about |
| 7972 | including spaces and backslashes. |
Bram Moolenaar | 90cfdbe | 2005-08-12 19:59:19 +0000 | [diff] [blame] | 7973 | To set this option automatically depending on the language, see |
| 7974 | |set-spc-auto|. |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 7975 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 7976 | *'spellfile'* *'spf'* |
| 7977 | 'spellfile' 'spf' string (default empty) |
| 7978 | local to buffer |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 7979 | {not available when compiled without the |+syntax| |
| 7980 | feature} |
| 7981 | Name of the word list file where words are added for the |zg| and |zw| |
Bram Moolenaar | 045e82d | 2005-07-08 22:25:33 +0000 | [diff] [blame] | 7982 | commands. It must end in ".{encoding}.add". You need to include the |
| 7983 | path, otherwise the file is placed in the current directory. |
Bram Moolenaar | 48c3f4e | 2022-08-08 15:42:38 +0100 | [diff] [blame] | 7984 | The path may include characters from 'isfname', space, comma and '@'. |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 7985 | *E765* |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 7986 | It may also be a comma-separated list of names. A count before the |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 7987 | |zg| and |zw| commands can be used to access each. This allows using |
| 7988 | a personal word list file and a project word list file. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 7989 | When a word is added while this option is empty Vim will set it for |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 7990 | you: Using the first directory in 'runtimepath' that is writable. If |
| 7991 | there is no "spell" directory yet it will be created. For the file |
| 7992 | name the first language name that appears in 'spelllang' is used, |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 7993 | ignoring the region. |
| 7994 | The resulting ".spl" file will be used for spell checking, it does not |
| 7995 | have to appear in 'spelllang'. |
| 7996 | Normally one file is used for all regions, but you can add the region |
| 7997 | name if you want to. However, it will then only be used when |
| 7998 | 'spellfile' is set to it, for entries in 'spelllang' only files |
| 7999 | without region name will be found. |
Bram Moolenaar | e756604 | 2005-06-17 22:00:15 +0000 | [diff] [blame] | 8000 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 8001 | security reasons. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 8002 | |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 8003 | *'spelllang'* *'spl'* |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 8004 | 'spelllang' 'spl' string (default "en") |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 8005 | local to buffer |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 8006 | {not available when compiled without the |+syntax| |
| 8007 | feature} |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 8008 | A comma-separated list of word list names. When the 'spell' option is |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 8009 | on spellchecking will be done for these languages. Example: > |
| 8010 | set spelllang=en_us,nl,medical |
| 8011 | < This means US English, Dutch and medical words are recognized. Words |
| 8012 | that are not recognized will be highlighted. |
Bram Moolenaar | 911ead1 | 2019-04-21 00:03:35 +0200 | [diff] [blame] | 8013 | The word list name must consist of alphanumeric characters, a dash or |
| 8014 | an underscore. It should not include a comma or dot. Using a dash is |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 8015 | recommended to separate the two letter language name from a |
| 8016 | specification. Thus "en-rare" is used for rare English words. |
| 8017 | A region name must come last and have the form "_xx", where "xx" is |
| 8018 | the two-letter, lower case region name. You can use more than one |
| 8019 | region by listing them: "en_us,en_ca" supports both US and Canadian |
| 8020 | English, but not words specific for Australia, New Zealand or Great |
Bram Moolenaar | fa73534 | 2016-01-03 22:14:44 +0100 | [diff] [blame] | 8021 | Britain. (Note: currently en_au and en_nz dictionaries are older than |
| 8022 | en_ca, en_gb and en_us). |
Bram Moolenaar | cc63c64 | 2013-11-12 04:44:01 +0100 | [diff] [blame] | 8023 | If the name "cjk" is included East Asian characters are excluded from |
| 8024 | spell checking. This is useful when editing text that also has Asian |
| 8025 | words. |
Bram Moolenaar | 6c391a7 | 2021-09-09 21:55:11 +0200 | [diff] [blame] | 8026 | Note that the "medical" dictionary does not exist, it is just an |
| 8027 | example of a longer name. |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 8028 | *E757* |
Bram Moolenaar | ce0842a | 2005-07-18 21:58:11 +0000 | [diff] [blame] | 8029 | As a special case the name of a .spl file can be given as-is. The |
| 8030 | first "_xx" in the name is removed and used as the region name |
| 8031 | (_xx is an underscore, two letters and followed by a non-letter). |
| 8032 | This is mainly for testing purposes. You must make sure the correct |
| 8033 | encoding is used, Vim doesn't check it. |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 8034 | When 'encoding' is set the word lists are reloaded. Thus it's a good |
Bram Moolenaar | ce0842a | 2005-07-18 21:58:11 +0000 | [diff] [blame] | 8035 | idea to set 'spelllang' after setting 'encoding' to avoid loading the |
| 8036 | files twice. |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 8037 | How the related spell files are found is explained here: |spell-load|. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 8038 | |
Bram Moolenaar | 9869207 | 2006-02-04 00:57:42 +0000 | [diff] [blame] | 8039 | If the |spellfile.vim| plugin is active and you use a language name |
| 8040 | for which Vim cannot find the .spl file in 'runtimepath' the plugin |
| 8041 | will ask you if you want to download the file. |
| 8042 | |
Bram Moolenaar | 90cfdbe | 2005-08-12 19:59:19 +0000 | [diff] [blame] | 8043 | After this option has been set successfully, Vim will source the files |
| 8044 | "spell/LANG.vim" in 'runtimepath'. "LANG" is the value of 'spelllang' |
Bram Moolenaar | b730f0c | 2018-11-25 03:56:26 +0100 | [diff] [blame] | 8045 | up to the first character that is not an ASCII letter or number and |
| 8046 | not a dash. Also see |set-spc-auto|. |
Bram Moolenaar | 90cfdbe | 2005-08-12 19:59:19 +0000 | [diff] [blame] | 8047 | |
Bram Moolenaar | 362b44b | 2020-06-10 21:47:00 +0200 | [diff] [blame] | 8048 | *'spelloptions'* *'spo'* |
| 8049 | 'spelloptions' 'spo' string (default "") |
| 8050 | local to buffer |
| 8051 | {not available when compiled without the |+syntax| |
| 8052 | feature} |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 8053 | A comma-separated list of options for spell checking: |
Bram Moolenaar | 362b44b | 2020-06-10 21:47:00 +0200 | [diff] [blame] | 8054 | camel When a word is CamelCased, assume "Cased" is a |
| 8055 | separate word: every upper-case character in a word |
| 8056 | that comes after a lower case character indicates the |
| 8057 | start of a new word. |
Bram Moolenaar | 90cfdbe | 2005-08-12 19:59:19 +0000 | [diff] [blame] | 8058 | |
Bram Moolenaar | d857f0e | 2005-06-21 22:37:39 +0000 | [diff] [blame] | 8059 | *'spellsuggest'* *'sps'* |
| 8060 | 'spellsuggest' 'sps' string (default "best") |
| 8061 | global |
Bram Moolenaar | d857f0e | 2005-06-21 22:37:39 +0000 | [diff] [blame] | 8062 | {not available when compiled without the |+syntax| |
| 8063 | feature} |
Bram Moolenaar | 2c7a29c | 2005-12-12 22:02:31 +0000 | [diff] [blame] | 8064 | Methods used for spelling suggestions. Both for the |z=| command and |
Bram Moolenaar | 24bbcfe | 2005-06-28 23:32:02 +0000 | [diff] [blame] | 8065 | the |spellsuggest()| function. This is a comma-separated list of |
| 8066 | items: |
Bram Moolenaar | d857f0e | 2005-06-21 22:37:39 +0000 | [diff] [blame] | 8067 | |
Bram Moolenaar | 24bbcfe | 2005-06-28 23:32:02 +0000 | [diff] [blame] | 8068 | best Internal method that works best for English. Finds |
| 8069 | changes like "fast" and uses a bit of sound-a-like |
| 8070 | scoring to improve the ordering. |
| 8071 | |
| 8072 | double Internal method that uses two methods and mixes the |
| 8073 | results. The first method is "fast", the other method |
Bram Moolenaar | d857f0e | 2005-06-21 22:37:39 +0000 | [diff] [blame] | 8074 | computes how much the suggestion sounds like the bad |
Bram Moolenaar | 24bbcfe | 2005-06-28 23:32:02 +0000 | [diff] [blame] | 8075 | word. That only works when the language specifies |
| 8076 | sound folding. Can be slow and doesn't always give |
| 8077 | better results. |
| 8078 | |
| 8079 | fast Internal method that only checks for simple changes: |
| 8080 | character inserts/deletes/swaps. Works well for |
| 8081 | simple typing mistakes. |
| 8082 | |
Bram Moolenaar | 2c7a29c | 2005-12-12 22:02:31 +0000 | [diff] [blame] | 8083 | {number} The maximum number of suggestions listed for |z=|. |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 8084 | Not used for |spellsuggest()|. The number of |
| 8085 | suggestions is never more than the value of 'lines' |
| 8086 | minus two. |
| 8087 | |
Bram Moolenaar | 585ee07 | 2022-01-29 11:22:17 +0000 | [diff] [blame] | 8088 | timeout:{millisec} Limit the time searching for suggestions to |
Dominique Pellé | df62c62 | 2024-07-15 20:29:59 +0200 | [diff] [blame] | 8089 | {millisec} milliseconds. Applies to the following |
Bram Moolenaar | 585ee07 | 2022-01-29 11:22:17 +0000 | [diff] [blame] | 8090 | methods. When omitted the limit is 5000. When |
| 8091 | negative there is no limit. {only works when built |
Bram Moolenaar | 8a3b805 | 2022-06-26 12:21:15 +0100 | [diff] [blame] | 8092 | with the |+reltime| feature} |
Bram Moolenaar | 585ee07 | 2022-01-29 11:22:17 +0000 | [diff] [blame] | 8093 | |
Bram Moolenaar | 24bbcfe | 2005-06-28 23:32:02 +0000 | [diff] [blame] | 8094 | file:{filename} Read file {filename}, which must have two columns, |
| 8095 | separated by a slash. The first column contains the |
| 8096 | bad word, the second column the suggested good word. |
| 8097 | Example: |
| 8098 | theribal/terrible ~ |
| 8099 | Use this for common mistakes that do not appear at the |
| 8100 | top of the suggestion list with the internal methods. |
| 8101 | Lines without a slash are ignored, use this for |
| 8102 | comments. |
Bram Moolenaar | bcb9898 | 2014-05-01 14:08:19 +0200 | [diff] [blame] | 8103 | The word in the second column must be correct, |
| 8104 | otherwise it will not be used. Add the word to an |
| 8105 | ".add" file if it is currently flagged as a spelling |
| 8106 | mistake. |
Bram Moolenaar | 24bbcfe | 2005-06-28 23:32:02 +0000 | [diff] [blame] | 8107 | The file is used for all languages. |
| 8108 | |
| 8109 | expr:{expr} Evaluate expression {expr}. Use a function to avoid |
Bram Moolenaar | a4e0b97 | 2022-10-01 19:43:52 +0100 | [diff] [blame] | 8110 | trouble with spaces. Best is to call a function |
| 8111 | without arguments, see |expr-option-function|. |
| 8112 | |v:val| holds the badly spelled word. The expression |
| 8113 | must evaluate to a List of Lists, each with a |
| 8114 | suggestion and a score. |
Bram Moolenaar | 24bbcfe | 2005-06-28 23:32:02 +0000 | [diff] [blame] | 8115 | Example: |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 8116 | [['the', 33], ['that', 44]] ~ |
Bram Moolenaar | 2c7a29c | 2005-12-12 22:02:31 +0000 | [diff] [blame] | 8117 | Set 'verbose' and use |z=| to see the scores that the |
Bram Moolenaar | 24bbcfe | 2005-06-28 23:32:02 +0000 | [diff] [blame] | 8118 | internal methods use. A lower score is better. |
| 8119 | This may invoke |spellsuggest()| if you temporarily |
| 8120 | set 'spellsuggest' to exclude the "expr:" part. |
| 8121 | Errors are silently ignored, unless you set the |
| 8122 | 'verbose' option to a non-zero value. |
| 8123 | |
| 8124 | Only one of "best", "double" or "fast" may be used. The others may |
| 8125 | appear several times in any order. Example: > |
| 8126 | :set sps=file:~/.vim/sugg,best,expr:MySuggest() |
| 8127 | < |
| 8128 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 8129 | security reasons. |
Bram Moolenaar | d857f0e | 2005-06-21 22:37:39 +0000 | [diff] [blame] | 8130 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8131 | *'splitbelow'* *'sb'* *'nosplitbelow'* *'nosb'* |
| 8132 | 'splitbelow' 'sb' boolean (default off) |
| 8133 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8134 | When on, splitting a window will put the new window below the current |
| 8135 | one. |:split| |
| 8136 | |
Bram Moolenaar | 3c053a1 | 2022-10-16 13:11:12 +0100 | [diff] [blame] | 8137 | *'splitkeep'* *'spk'* |
Luuk van Baal | 13ece2a | 2022-10-03 15:28:08 +0100 | [diff] [blame] | 8138 | 'splitkeep' 'spk' string (default "cursor") |
| 8139 | global |
| 8140 | The value of this option determines the scroll behavior when opening, |
| 8141 | closing or resizing horizontal splits. |
| 8142 | |
| 8143 | Possible values are: |
| 8144 | cursor Keep the same relative cursor position. |
| 8145 | screen Keep the text on the same screen line. |
| 8146 | topline Keep the topline the same. |
| 8147 | |
| 8148 | For the "screen" and "topline" values, the cursor position will be |
| 8149 | changed when necessary. In this case, the jumplist will be populated |
| 8150 | with the previous cursor position. For "screen", the text cannot always |
Bram Moolenaar | 3c053a1 | 2022-10-16 13:11:12 +0100 | [diff] [blame] | 8151 | be kept on the same screen line when 'wrap' is enabled. |
Luuk van Baal | 13ece2a | 2022-10-03 15:28:08 +0100 | [diff] [blame] | 8152 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8153 | *'splitright'* *'spr'* *'nosplitright'* *'nospr'* |
| 8154 | 'splitright' 'spr' boolean (default off) |
| 8155 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8156 | When on, splitting a window will put the new window right of the |
| 8157 | current one. |:vsplit| |
| 8158 | |
| 8159 | *'startofline'* *'sol'* *'nostartofline'* *'nosol'* |
| 8160 | 'startofline' 'sol' boolean (default on) |
| 8161 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8162 | When "on" the commands listed below move the cursor to the first |
Bram Moolenaar | 843ee41 | 2004-06-30 16:16:41 +0000 | [diff] [blame] | 8163 | non-blank of the line. When off the cursor is kept in the same column |
Bram Moolenaar | 71badf9 | 2023-04-22 22:40:14 +0100 | [diff] [blame] | 8164 | (if possible). This applies to the commands: |
| 8165 | - CTRL-D, CTRL-U, CTRL-B, CTRL-F, "G", "H", "M", "L", "gg" |
Christian Brabandt | fd4e47e | 2024-10-06 17:57:53 +0200 | [diff] [blame] | 8166 | - "d", "<<", "==" and ">>" with a linewise operator |
| 8167 | (|operator-resulting-pos|) |
Bram Moolenaar | 71badf9 | 2023-04-22 22:40:14 +0100 | [diff] [blame] | 8168 | - "%" with a count |
| 8169 | - buffer changing commands (CTRL-^, :bnext, :bNext, etc.) |
| 8170 | - Ex commands that only has a line number, e.g., ":25" or ":+". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8171 | In case of buffer changing commands the cursor is placed at the column |
| 8172 | where it was the last time the buffer was edited. |
| 8173 | NOTE: This option is set when 'compatible' is set. |
| 8174 | |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 8175 | *'statusline'* *'stl'* *E540* *E542* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8176 | 'statusline' 'stl' string (default empty) |
Bram Moolenaar | b5bf5b8 | 2004-12-24 14:35:23 +0000 | [diff] [blame] | 8177 | global or local to window |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8178 | {not available when compiled without the |+statusline| |
| 8179 | feature} |
Bram Moolenaar | 944697a | 2022-02-20 19:48:20 +0000 | [diff] [blame] | 8180 | When non-empty, this option determines the content of the status line. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8181 | Also see |status-line|. |
| 8182 | |
| 8183 | The option consists of printf style '%' items interspersed with |
| 8184 | normal text. Each status line item is of the form: |
| 8185 | %-0{minwid}.{maxwid}{item} |
Bram Moolenaar | 5e9b2fa | 2016-02-01 22:37:05 +0100 | [diff] [blame] | 8186 | All fields except the {item} are optional. A single percent sign can |
Bram Moolenaar | 8133cc6 | 2020-10-26 21:05:27 +0100 | [diff] [blame] | 8187 | be given as "%%". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8188 | |
Yegappan Lakshmanan | ac023e8 | 2024-11-27 20:55:45 +0100 | [diff] [blame] | 8189 | *stl-%!* |
Bram Moolenaar | 238a564 | 2006-02-21 22:12:05 +0000 | [diff] [blame] | 8190 | When the option starts with "%!" then it is used as an expression, |
| 8191 | evaluated and the result is used as the option value. Example: > |
| 8192 | :set statusline=%!MyStatusLine() |
Bram Moolenaar | 1c6fd1e | 2019-05-23 22:11:59 +0200 | [diff] [blame] | 8193 | < The *g:statusline_winid* variable will be set to the |window-ID| of the |
| 8194 | window that the status line belongs to. |
| 8195 | The result can contain %{} items that will be evaluated too. |
Bram Moolenaar | 61d35bd | 2012-03-28 20:51:51 +0200 | [diff] [blame] | 8196 | Note that the "%!" expression is evaluated in the context of the |
| 8197 | current window and buffer, while %{} items are evaluated in the |
| 8198 | context of the window that the statusline belongs to. |
Bram Moolenaar | 238a564 | 2006-02-21 22:12:05 +0000 | [diff] [blame] | 8199 | |
| 8200 | When there is error while evaluating the option then it will be made |
| 8201 | empty to avoid further errors. Otherwise screen updating would loop. |
Bram Moolenaar | 1b5f03e | 2023-01-09 20:12:45 +0000 | [diff] [blame] | 8202 | When the result contains unprintable characters the result is |
| 8203 | unpredictable. |
Bram Moolenaar | 238a564 | 2006-02-21 22:12:05 +0000 | [diff] [blame] | 8204 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8205 | Note that the only effect of 'ruler' when this option is set (and |
| 8206 | 'laststatus' is 2) is controlling the output of |CTRL-G|. |
| 8207 | |
| 8208 | field meaning ~ |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 8209 | - Left justify the item. The default is right justified |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8210 | when minwid is larger than the length of the item. |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 8211 | 0 Leading zeroes in numeric items. Overridden by '-'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8212 | minwid Minimum width of the item, padding as set by '-' & '0'. |
| 8213 | Value must be 50 or less. |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 8214 | maxwid Maximum width of the item. Truncation occurs with a '<' |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8215 | on the left for text items. Numeric items will be |
| 8216 | shifted down to maxwid-2 digits followed by '>'number |
| 8217 | where number is the amount of missing digits, much like |
| 8218 | an exponential notation. |
| 8219 | item A one letter code as described below. |
| 8220 | |
| 8221 | Following is a description of the possible statusline items. The |
| 8222 | second character in "item" is the type: |
| 8223 | N for number |
| 8224 | S for string |
| 8225 | F for flags as described below |
| 8226 | - not applicable |
| 8227 | |
| 8228 | item meaning ~ |
Bram Moolenaar | 0246787 | 2007-05-06 13:22:01 +0000 | [diff] [blame] | 8229 | f S Path to the file in the buffer, as typed or relative to current |
| 8230 | directory. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8231 | F S Full path to the file in the buffer. |
| 8232 | t S File name (tail) of file in the buffer. |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 8233 | m F Modified flag, text is "[+]"; "[-]" if 'modifiable' is off. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8234 | M F Modified flag, text is ",+" or ",-". |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 8235 | r F Readonly flag, text is "[RO]". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8236 | R F Readonly flag, text is ",RO". |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 8237 | h F Help buffer flag, text is "[help]". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8238 | H F Help buffer flag, text is ",HLP". |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 8239 | w F Preview window flag, text is "[Preview]". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8240 | W F Preview window flag, text is ",PRV". |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 8241 | y F Type of file in the buffer, e.g., "[vim]". See 'filetype'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8242 | Y F Type of file in the buffer, e.g., ",VIM". See 'filetype'. |
Bram Moolenaar | 7fd7320 | 2010-07-25 16:58:46 +0200 | [diff] [blame] | 8243 | q S "[Quickfix List]", "[Location List]" or empty. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8244 | k S Value of "b:keymap_name" or 'keymap' when |:lmap| mappings are |
| 8245 | being used: "<keymap>" |
| 8246 | n N Buffer number. |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 8247 | b N Value of character under cursor. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8248 | B N As above, in hexadecimal. |
| 8249 | o N Byte number in file of byte under cursor, first byte is 1. |
| 8250 | Mnemonic: Offset from start of file (with one added) |
| 8251 | {not available when compiled without |+byte_offset| feature} |
| 8252 | O N As above, in hexadecimal. |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 8253 | N N Printer page number. (Only works in the 'printheader' option.) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8254 | l N Line number. |
| 8255 | L N Number of lines in buffer. |
Bram Moolenaar | 1d59aa1 | 2020-09-19 18:50:13 +0200 | [diff] [blame] | 8256 | c N Column number (byte index). |
| 8257 | v N Virtual column number (screen column). |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 8258 | V N Virtual column number as -{num}. Not displayed if equal to 'c'. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8259 | p N Percentage through file in lines as in |CTRL-G|. |
| 8260 | P S Percentage through file of displayed window. This is like the |
Bram Moolenaar | 14b6945 | 2013-06-29 23:05:20 +0200 | [diff] [blame] | 8261 | percentage described for 'ruler'. Always 3 in length, unless |
| 8262 | translated. |
Luuk van Baal | ba936f6 | 2022-12-15 13:15:39 +0000 | [diff] [blame] | 8263 | S S 'showcmd' content, see 'showcmdloc'. |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 8264 | a S Argument list status as in default title. ({current} of {max}) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8265 | Empty if the argument file count is zero or one. |
Bram Moolenaar | 238a564 | 2006-02-21 22:12:05 +0000 | [diff] [blame] | 8266 | { NF Evaluate expression between '%{' and '}' and substitute result. |
Bram Moolenaar | 6d150f7 | 2018-04-21 20:03:20 +0200 | [diff] [blame] | 8267 | Note that there is no '%' before the closing '}'. The |
| 8268 | expression cannot contain a '}' character, call a function to |
Bram Moolenaar | 0c0734d | 2019-11-26 21:44:46 +0100 | [diff] [blame] | 8269 | work around that. See |stl-%{| below. |
shadmansaleh | 30e3de2 | 2021-05-15 17:23:28 +0200 | [diff] [blame] | 8270 | {% - This is almost same as { except the result of the expression is |
| 8271 | re-evaluated as a statusline format string. Thus if the |
| 8272 | return value of expr contains % items they will get expanded. |
| 8273 | The expression can contain the } character, the end of |
| 8274 | expression is denoted by %}. |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 8275 | For example: > |
shadmansaleh | 30e3de2 | 2021-05-15 17:23:28 +0200 | [diff] [blame] | 8276 | func! Stl_filename() abort |
| 8277 | return "%t" |
| 8278 | endfunc |
| 8279 | < `stl=%{Stl_filename()}` results in `"%t"` |
| 8280 | `stl=%{%Stl_filename()%}` results in `"Name of current file"` |
Bram Moolenaar | 2286304 | 2021-10-16 15:23:36 +0100 | [diff] [blame] | 8281 | %} - End of `{%` expression |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8282 | ( - Start of item group. Can be used for setting the width and |
| 8283 | alignment of a section. Must be followed by %) somewhere. |
| 8284 | ) - End of item group. No width fields allowed. |
Bram Moolenaar | d1f56e6 | 2006-02-22 21:25:37 +0000 | [diff] [blame] | 8285 | T N For 'tabline': start of tab page N label. Use %T after the last |
| 8286 | label. This information is used for mouse clicks. |
| 8287 | X N For 'tabline': start of close tab N label. Use %X after the |
| 8288 | label, e.g.: %3Xclose%X. Use %999X for a "close current tab" |
| 8289 | mark. This information is used for mouse clicks. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8290 | < - Where to truncate line if too long. Default is at the start. |
| 8291 | No width fields allowed. |
Yegappan Lakshmanan | 3ec78f9 | 2023-02-11 11:15:25 +0000 | [diff] [blame] | 8292 | = - Separation point between alignment sections. Each section will |
| 8293 | be separated by an equal number of spaces. With one %= what |
| 8294 | comes after it will be right-aligned. With two %= there is a |
| 8295 | middle part, with white space left and right of it. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8296 | No width fields allowed. |
Bram Moolenaar | 238a564 | 2006-02-21 22:12:05 +0000 | [diff] [blame] | 8297 | # - Set highlight group. The name must follow and then a # again. |
| 8298 | Thus use %#HLname# for highlight group HLname. The same |
| 8299 | highlighting is used, also for the statusline of non-current |
| 8300 | windows. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8301 | * - Set highlight group to User{N}, where {N} is taken from the |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 8302 | minwid field, e.g. %1*. Restore normal highlight with %* or %0*. |
Bram Moolenaar | be4e016 | 2023-02-02 13:59:48 +0000 | [diff] [blame] | 8303 | The difference between User{N} and StatusLine will be applied to |
| 8304 | StatusLineNC for the statusline of non-current windows. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8305 | The number N must be between 1 and 9. See |hl-User1..9| |
| 8306 | |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 8307 | When displaying a flag, Vim removes the leading comma, if any, when |
| 8308 | that flag comes right after plaintext. This will make a nice display |
| 8309 | when flags are used like in the examples below. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8310 | |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 8311 | When all items in a group becomes an empty string (i.e. flags that are |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8312 | not set) and a minwid is not set for the group, the whole group will |
| 8313 | become empty. This will make a group like the following disappear |
| 8314 | completely from the statusline when none of the flags are set. > |
| 8315 | :set statusline=...%(\ [%M%R%H]%)... |
Bram Moolenaar | 1c6fd1e | 2019-05-23 22:11:59 +0200 | [diff] [blame] | 8316 | < Beware that an expression is evaluated each and every time the status |
| 8317 | line is displayed. |
Bram Moolenaar | 0c0734d | 2019-11-26 21:44:46 +0100 | [diff] [blame] | 8318 | *stl-%{* *g:actual_curbuf* *g:actual_curwin* |
Bram Moolenaar | ade0d39 | 2020-01-21 22:33:58 +0100 | [diff] [blame] | 8319 | While evaluating %{} the current buffer and current window will be set |
| 8320 | temporarily to that of the window (and buffer) whose statusline is |
Bram Moolenaar | 0c0734d | 2019-11-26 21:44:46 +0100 | [diff] [blame] | 8321 | currently being drawn. The expression will evaluate in this context. |
| 8322 | The variable "g:actual_curbuf" is set to the `bufnr()` number of the |
| 8323 | real current buffer and "g:actual_curwin" to the |window-ID| of the |
| 8324 | real current window. These values are strings. |
Bram Moolenaar | b71eaae | 2006-01-20 23:10:18 +0000 | [diff] [blame] | 8325 | |
Bram Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 8326 | The 'statusline' option will be evaluated in the |sandbox| if set from |
| 8327 | a modeline, see |sandbox-option|. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 8328 | This option cannot be set in a modeline when 'modelineexpr' is off. |
Bram Moolenaar | b71eaae | 2006-01-20 23:10:18 +0000 | [diff] [blame] | 8329 | |
| 8330 | It is not allowed to change text or jump to another window while |
| 8331 | evaluating 'statusline' |textlock|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8332 | |
| 8333 | If the statusline is not updated when you want it (e.g., after setting |
| 8334 | a variable that's used in an expression), you can force an update by |
Bram Moolenaar | cfa8f9a | 2022-06-03 21:59:47 +0100 | [diff] [blame] | 8335 | using `:redrawstatus`. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8336 | |
Bram Moolenaar | cfa8f9a | 2022-06-03 21:59:47 +0100 | [diff] [blame] | 8337 | A result of all digits is regarded a number for display purposes. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8338 | Otherwise the result is taken as flag text and applied to the rules |
| 8339 | described above. |
| 8340 | |
Bram Moolenaar | cd71fa3 | 2005-03-11 22:46:48 +0000 | [diff] [blame] | 8341 | Watch out for errors in expressions. They may render Vim unusable! |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8342 | If you are stuck, hold down ':' or 'Q' to get a prompt, then quit and |
Bram Moolenaar | c4da113 | 2017-07-15 19:39:43 +0200 | [diff] [blame] | 8343 | edit your .vimrc or whatever with "vim --clean" to get it right. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8344 | |
| 8345 | Examples: |
| 8346 | Emulate standard status line with 'ruler' set > |
saher | 7b5e52d | 2024-10-14 19:52:50 +0200 | [diff] [blame] | 8347 | :set statusline=%<%f\ %h%w%m%r%=%-14.(%l,%c%V%)\ %P |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8348 | < Similar, but add ASCII value of char under the cursor (like "ga") > |
| 8349 | :set statusline=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P |
| 8350 | < Display byte count and byte value, modified flag in red. > |
| 8351 | :set statusline=%<%f%=\ [%1*%M%*%n%R%H]\ %-19(%3l,%02c%03V%)%O'%02b' |
| 8352 | :hi User1 term=inverse,bold cterm=inverse,bold ctermfg=red |
| 8353 | < Display a ,GZ flag if a compressed file is loaded > |
| 8354 | :set statusline=...%r%{VarExists('b:gzflag','\ [GZ]')}%h... |
| 8355 | < In the |:autocmd|'s: > |
| 8356 | :let b:gzflag = 1 |
| 8357 | < And: > |
| 8358 | :unlet b:gzflag |
| 8359 | < And define this function: > |
| 8360 | :function VarExists(var, val) |
| 8361 | : if exists(a:var) | return a:val | else | return '' | endif |
| 8362 | :endfunction |
| 8363 | < |
| 8364 | *'suffixes'* *'su'* |
| 8365 | 'suffixes' 'su' string (default ".bak,~,.o,.h,.info,.swp,.obj") |
| 8366 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8367 | Files with these suffixes get a lower priority when multiple files |
| 8368 | match a wildcard. See |suffixes|. Commas can be used to separate the |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 8369 | suffixes. Spaces after the comma are ignored. A dot is also seen as |
| 8370 | the start of a suffix. To avoid a dot or comma being recognized as a |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8371 | separator, precede it with a backslash (see |option-backslash| about |
| 8372 | including spaces and backslashes). |
| 8373 | See 'wildignore' for completely ignoring files. |
| 8374 | The use of |:set+=| and |:set-=| is preferred when adding or removing |
| 8375 | suffixes from the list. This avoids problems when a future version |
| 8376 | uses another default. |
| 8377 | |
| 8378 | *'suffixesadd'* *'sua'* |
| 8379 | 'suffixesadd' 'sua' string (default "") |
| 8380 | local to buffer |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 8381 | Comma-separated list of suffixes, which are used when searching for a |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8382 | file for the "gf", "[I", etc. commands. Example: > |
| 8383 | :set suffixesadd=.java |
| 8384 | < |
| 8385 | *'swapfile'* *'swf'* *'noswapfile'* *'noswf'* |
| 8386 | 'swapfile' 'swf' boolean (default on) |
| 8387 | local to buffer |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 8388 | Use a swapfile for the buffer. This option can be reset when a |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8389 | swapfile is not wanted for a specific buffer. For example, with |
| 8390 | confidential information that even root must not be able to access. |
| 8391 | Careful: All text will be in memory: |
| 8392 | - Don't use this for big files. |
| 8393 | - Recovery will be impossible! |
| 8394 | A swapfile will only be present when |'updatecount'| is non-zero and |
| 8395 | 'swapfile' is set. |
| 8396 | When 'swapfile' is reset, the swap file for the current buffer is |
| 8397 | immediately deleted. When 'swapfile' is set, and 'updatecount' is |
| 8398 | non-zero, a swap file is immediately created. |
| 8399 | Also see |swap-file| and |'swapsync'|. |
Bram Moolenaar | 76f3b1a | 2014-03-27 22:30:07 +0100 | [diff] [blame] | 8400 | If you want to open a new buffer without creating a swap file for it, |
| 8401 | use the |:noswapfile| modifier. |
Bram Moolenaar | 22f1d0e | 2018-02-27 14:53:30 +0100 | [diff] [blame] | 8402 | See 'directory' for where the swap file is created. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8403 | |
| 8404 | This option is used together with 'bufhidden' and 'buftype' to |
| 8405 | specify special kinds of buffers. See |special-buffers|. |
| 8406 | |
| 8407 | *'swapsync'* *'sws'* |
| 8408 | 'swapsync' 'sws' string (default "fsync") |
| 8409 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8410 | When this option is not empty a swap file is synced to disk after |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 8411 | writing to it. This takes some time, especially on busy unix systems. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8412 | When this option is empty parts of the swap file may be in memory and |
| 8413 | not written to disk. When the system crashes you may lose more work. |
| 8414 | On Unix the system does a sync now and then without Vim asking for it, |
| 8415 | so the disadvantage of setting this option off is small. On some |
| 8416 | systems the swap file will not be written at all. For a unix system |
| 8417 | setting it to "sync" will use the sync() call instead of the default |
| 8418 | fsync(), which may work better on some systems. |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 8419 | The 'fsync' option is used for the actual file. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8420 | |
| 8421 | *'switchbuf'* *'swb'* |
| 8422 | 'switchbuf' 'swb' string (default "") |
| 8423 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8424 | This option controls the behavior when switching between buffers. |
Yegappan Lakshmanan | 54be5fb | 2023-05-12 17:49:13 +0100 | [diff] [blame] | 8425 | This option is checked, when |
| 8426 | - jumping to errors with the |quickfix| commands (|:cc|, |:cn|, |:cp|, |
h_east | 5985879 | 2023-10-25 22:47:05 +0900 | [diff] [blame] | 8427 | etc.). |
Yegappan Lakshmanan | 54be5fb | 2023-05-12 17:49:13 +0100 | [diff] [blame] | 8428 | - jumping to a tag using the |:stag| command. |
| 8429 | - opening a file using the |CTRL-W_f| or |CTRL-W_F| command. |
| 8430 | - jumping to a buffer using a buffer split command (e.g. |:sbuffer|, |
| 8431 | |:sbnext|, or |:sbrewind|). |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 8432 | Possible values (comma-separated list): |
Yegappan Lakshmanan | 54be5fb | 2023-05-12 17:49:13 +0100 | [diff] [blame] | 8433 | useopen If included, jump to the first open window in the |
| 8434 | current tab page that contains the specified buffer |
| 8435 | (if there is one). Otherwise: Do not examine other |
| 8436 | windows. |
Bram Moolenaar | 779b74b | 2006-04-10 14:55:34 +0000 | [diff] [blame] | 8437 | usetab Like "useopen", but also consider windows in other tab |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 8438 | pages. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8439 | split If included, split the current window before loading |
Bram Moolenaar | 1514667 | 2011-10-20 22:22:38 +0200 | [diff] [blame] | 8440 | a buffer for a |quickfix| command that display errors. |
Bram Moolenaar | 63b74a8 | 2019-03-24 15:09:13 +0100 | [diff] [blame] | 8441 | Otherwise: do not split, use current window (when used |
| 8442 | in the quickfix window: the previously used window or |
| 8443 | split if there is no other window). |
Bram Moolenaar | a594d77 | 2015-06-19 14:41:49 +0200 | [diff] [blame] | 8444 | vsplit Just like "split" but split vertically. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 8445 | newtab Like "split", but open a new tab page. Overrules |
Bram Moolenaar | 0bc380a | 2010-07-10 13:52:13 +0200 | [diff] [blame] | 8446 | "split" when both are present. |
Bram Moolenaar | 539aa6b | 2019-11-17 18:09:38 +0100 | [diff] [blame] | 8447 | uselast If included, jump to the previously used window when |
| 8448 | jumping to errors with |quickfix| commands. |
Colin Kennedy | 2157035 | 2024-03-03 16:16:47 +0100 | [diff] [blame] | 8449 | If a window has 'winfixbuf' enabled, 'switchbuf' is currently not |
| 8450 | applied to the split window. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8451 | |
Bram Moolenaar | 3b56eb3 | 2005-07-11 22:40:32 +0000 | [diff] [blame] | 8452 | *'synmaxcol'* *'smc'* |
| 8453 | 'synmaxcol' 'smc' number (default 3000) |
| 8454 | local to buffer |
Bram Moolenaar | 3b56eb3 | 2005-07-11 22:40:32 +0000 | [diff] [blame] | 8455 | {not available when compiled without the |+syntax| |
| 8456 | feature} |
Bram Moolenaar | ce0842a | 2005-07-18 21:58:11 +0000 | [diff] [blame] | 8457 | Maximum column in which to search for syntax items. In long lines the |
| 8458 | text after this column is not highlighted and following lines may not |
| 8459 | be highlighted correctly, because the syntax state is cleared. |
Bram Moolenaar | 3b56eb3 | 2005-07-11 22:40:32 +0000 | [diff] [blame] | 8460 | This helps to avoid very slow redrawing for an XML file that is one |
| 8461 | long line. |
| 8462 | Set to zero to remove the limit. |
| 8463 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8464 | *'syntax'* *'syn'* |
| 8465 | 'syntax' 'syn' string (default empty) |
Christian Brabandt | 596ad66 | 2023-08-16 00:11:09 +0200 | [diff] [blame] | 8466 | local to buffer |local-noglobal| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8467 | {not available when compiled without the |+syntax| |
| 8468 | feature} |
| 8469 | When this option is set, the syntax with this name is loaded, unless |
| 8470 | syntax highlighting has been switched off with ":syntax off". |
| 8471 | Otherwise this option does not always reflect the current syntax (the |
| 8472 | b:current_syntax variable does). |
| 8473 | This option is most useful in a modeline, for a file which syntax is |
Bram Moolenaar | 97b2ad3 | 2006-03-18 21:40:56 +0000 | [diff] [blame] | 8474 | not automatically recognized. Example, in an IDL file: |
| 8475 | /* vim: set syntax=idl : */ ~ |
| 8476 | When a dot appears in the value then this separates two filetype |
| 8477 | names. Example: |
| 8478 | /* vim: set syntax=c.doxygen : */ ~ |
| 8479 | This will use the "c" syntax first, then the "doxygen" syntax. |
| 8480 | Note that the second one must be prepared to be loaded as an addition, |
| 8481 | otherwise it will be skipped. More than one dot may appear. |
| 8482 | To switch off syntax highlighting for the current file, use: > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8483 | :set syntax=OFF |
| 8484 | < To switch syntax highlighting on according to the current value of the |
| 8485 | 'filetype' option: > |
| 8486 | :set syntax=ON |
| 8487 | < What actually happens when setting the 'syntax' option is that the |
| 8488 | Syntax autocommand event is triggered with the value as argument. |
| 8489 | This option is not copied to another buffer, independent of the 's' or |
| 8490 | 'S' flag in 'cpoptions'. |
Milly | ae62fe5 | 2024-10-02 19:30:41 +0200 | [diff] [blame] | 8491 | Only alphanumeric characters, '.', '-' and '_' can be used. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8492 | |
LemonBoy | 5247b0b | 2024-07-12 19:30:58 +0200 | [diff] [blame] | 8493 | *'tabclose'* *'tcl'* |
| 8494 | 'tabclose' 'tcl' string (default "") |
| 8495 | global |
| 8496 | This option controls the behavior when closing tab pages (e.g., using |
| 8497 | |:tabclose|). When empty Vim goes to the next (right) tab page. |
| 8498 | |
| 8499 | Possible values (comma-separated list): |
| 8500 | left If included, go to the previous tab page instead of |
| 8501 | the next one. |
| 8502 | uselast If included, go to the previously used tab page if |
| 8503 | possible. This option takes precedence over the |
| 8504 | others. |
| 8505 | |
Bram Moolenaar | fd2ac76 | 2006-03-01 22:09:21 +0000 | [diff] [blame] | 8506 | *'tabline'* *'tal'* |
Bram Moolenaar | faa959a | 2006-02-20 21:37:40 +0000 | [diff] [blame] | 8507 | 'tabline' 'tal' string (default empty) |
Bram Moolenaar | 7e8fd63 | 2006-02-18 22:14:51 +0000 | [diff] [blame] | 8508 | global |
Bram Moolenaar | 944697a | 2022-02-20 19:48:20 +0000 | [diff] [blame] | 8509 | When non-empty, this option determines the content of the tab pages |
Bram Moolenaar | faa959a | 2006-02-20 21:37:40 +0000 | [diff] [blame] | 8510 | line at the top of the Vim window. When empty Vim will use a default |
Bram Moolenaar | d1f56e6 | 2006-02-22 21:25:37 +0000 | [diff] [blame] | 8511 | tab pages line. See |setting-tabline| for more info. |
Bram Moolenaar | faa959a | 2006-02-20 21:37:40 +0000 | [diff] [blame] | 8512 | |
| 8513 | The tab pages line only appears as specified with the 'showtabline' |
Bram Moolenaar | 5c8837f | 2006-02-25 21:52:33 +0000 | [diff] [blame] | 8514 | option and only when there is no GUI tab line. When 'e' is in |
| 8515 | 'guioptions' and the GUI supports a tab line 'guitablabel' is used |
Bram Moolenaar | 7f03644 | 2010-08-15 15:24:20 +0200 | [diff] [blame] | 8516 | instead. Note that the two tab pages lines are very different. |
Bram Moolenaar | faa959a | 2006-02-20 21:37:40 +0000 | [diff] [blame] | 8517 | |
| 8518 | The value is evaluated like with 'statusline'. You can use |
| 8519 | |tabpagenr()|, |tabpagewinnr()| and |tabpagebuflist()| to figure out |
Bram Moolenaar | d1f56e6 | 2006-02-22 21:25:37 +0000 | [diff] [blame] | 8520 | the text to be displayed. Use "%1T" for the first label, "%2T" for |
| 8521 | the second one, etc. Use "%X" items for closing labels. |
Bram Moolenaar | faa959a | 2006-02-20 21:37:40 +0000 | [diff] [blame] | 8522 | |
Bram Moolenaar | e12bab3 | 2019-01-08 22:02:56 +0100 | [diff] [blame] | 8523 | When changing something that is used in 'tabline' that does not |
| 8524 | trigger it to be updated, use |:redrawtabline|. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 8525 | This option cannot be set in a modeline when 'modelineexpr' is off. |
Bram Moolenaar | e12bab3 | 2019-01-08 22:02:56 +0100 | [diff] [blame] | 8526 | |
Bram Moolenaar | faa959a | 2006-02-20 21:37:40 +0000 | [diff] [blame] | 8527 | Keep in mind that only one of the tab pages is the current one, others |
| 8528 | are invisible and you can't jump to their windows. |
| 8529 | |
Bram Moolenaar | fd2ac76 | 2006-03-01 22:09:21 +0000 | [diff] [blame] | 8530 | *'tabpagemax'* *'tpm'* |
| 8531 | 'tabpagemax' 'tpm' number (default 10) |
| 8532 | global |
Bram Moolenaar | fd2ac76 | 2006-03-01 22:09:21 +0000 | [diff] [blame] | 8533 | Maximum number of tab pages to be opened by the |-p| command line |
| 8534 | argument or the ":tab all" command. |tabpage| |
| 8535 | |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 8536 | *'tabpanel'* *'tpl'* *g:actual_curtabpage* |
Hirohito Higashi | 8f7256a | 2025-06-07 18:31:42 +0200 | [diff] [blame] | 8537 | 'tabpanel' 'tpl' string (default empty) |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 8538 | global |
Christ van Willegen | d65cdad | 2025-05-30 16:05:58 +0200 | [diff] [blame] | 8539 | When non-empty, this option determines the content of the |tabpanel|. |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 8540 | The option consists of printf style '%' items interspersed with |
| 8541 | normal text, similar to the 'statusline' or 'tabline'. |
| 8542 | |
| 8543 | When changing something that is used in 'tabpanel' that does not |
| 8544 | trigger it to be updated, use |:redrawtabpanel|. |
| 8545 | This option cannot be set in a modeline when 'modelineexpr' is off. |
| 8546 | |
| 8547 | You can use |g:actual_curtabpage| within a function assigned to |
| 8548 | tabpanel. |g:actual_curtabpage| represents current tab's label number. |
Hirohito Higashi | 8f7256a | 2025-06-07 18:31:42 +0200 | [diff] [blame] | 8549 | The option value can contain line breaks: > |
| 8550 | |
| 8551 | set tabpanel=%!TabPanel() |
| 8552 | function! TabPanel() abort |
| 8553 | return printf("(%2d)\n %%f", g:actual_curtabpage) |
| 8554 | endfunction |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 8555 | < |
| 8556 | The result is: |
| 8557 | > |
| 8558 | +-----------+--------------------------------- |
| 8559 | |(1) | |
| 8560 | | ~/aaa.txt| |
| 8561 | |(2) | |
| 8562 | | ~/.vimrc | |
| 8563 | | | |
| 8564 | | | |
| 8565 | | | |
| 8566 | < |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 8567 | *'tabpanelopt'* *'tplo'* |
Hirohito Higashi | 8f7256a | 2025-06-07 18:31:42 +0200 | [diff] [blame] | 8568 | 'tabpanelopt' 'tplo' string (default "") |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 8569 | global |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 8570 | Optional settings for the |tabpanel|, It can consist of the following |
| 8571 | items. Items must be separated by a comma. |
| 8572 | |
Christ van Willegen | d65cdad | 2025-05-30 16:05:58 +0200 | [diff] [blame] | 8573 | align:{text} Specifies the position of the tabpanel. |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 8574 | Currently supported positions are: |
| 8575 | |
Hirohito Higashi | 8f7256a | 2025-06-07 18:31:42 +0200 | [diff] [blame] | 8576 | left left-side |
| 8577 | right right-side |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 8578 | |
| 8579 | (default "left") |
| 8580 | |
Hirohito Higashi | 8f7256a | 2025-06-07 18:31:42 +0200 | [diff] [blame] | 8581 | columns:{n} Number of columns of the tabpanel. |
| 8582 | If this value is 0 or less than 'columns', the |
| 8583 | tab panel will not be displayed. |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 8584 | (default 20) |
| 8585 | |
| 8586 | vert Use a vertical separator for tabpanel. |
Hirohito Higashi | 8f7256a | 2025-06-07 18:31:42 +0200 | [diff] [blame] | 8587 | The vertical separator character is taken from |
| 8588 | "tpl_vert" in 'fillchars'. |
Naruhiko Nishino | be5bd4d | 2025-05-14 21:20:28 +0200 | [diff] [blame] | 8589 | (default off) |
| 8590 | |
| 8591 | Examples: > |
| 8592 | :set tabpanelopt=columns:16,align:right |
| 8593 | :set tabpanelopt= |
| 8594 | :set tabpanelopt=vert,align:right |
| 8595 | :set tabpanelopt=columns:16 |
| 8596 | < |
Bram Moolenaar | fd2ac76 | 2006-03-01 22:09:21 +0000 | [diff] [blame] | 8597 | *'tabstop'* *'ts'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8598 | 'tabstop' 'ts' number (default 8) |
| 8599 | local to buffer |
Damien Lejay | a4a3f71 | 2025-05-30 17:36:37 +0200 | [diff] [blame] | 8600 | Defines the column multiple used to display the Horizontal Tab |
Hirohito Higashi | 8f7256a | 2025-06-07 18:31:42 +0200 | [diff] [blame] | 8601 | character (ASCII 9); a Horizontal Tab always advances to the next tab |
| 8602 | stop. |
Damien Lejay | a4a3f71 | 2025-05-30 17:36:37 +0200 | [diff] [blame] | 8603 | The value must be at least 1 and at most 9999. |
Hirohito Higashi | 8f7256a | 2025-06-07 18:31:42 +0200 | [diff] [blame] | 8604 | If Vim was compiled with |+vartabs| and |'vartabstop'| is set, this |
| 8605 | option is ignored. |
Damien Lejay | a4a3f71 | 2025-05-30 17:36:37 +0200 | [diff] [blame] | 8606 | Leave it at 8 unless you have a strong reason (see usr |30.5|). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8607 | |
Bram Moolenaar | 04958cb | 2018-06-23 19:23:02 +0200 | [diff] [blame] | 8608 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8609 | *'tagbsearch'* *'tbs'* *'notagbsearch'* *'notbs'* |
| 8610 | 'tagbsearch' 'tbs' boolean (default on) |
| 8611 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8612 | When searching for a tag (e.g., for the |:ta| command), Vim can either |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 8613 | use a binary search or a linear search in a tags file. Binary |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8614 | searching makes searching for a tag a LOT faster, but a linear search |
| 8615 | will find more tags if the tags file wasn't properly sorted. |
| 8616 | Vim normally assumes that your tags files are sorted, or indicate that |
| 8617 | they are not sorted. Only when this is not the case does the |
| 8618 | 'tagbsearch' option need to be switched off. |
| 8619 | |
| 8620 | When 'tagbsearch' is on, binary searching is first used in the tags |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 8621 | files. In certain situations, Vim will do a linear search instead for |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8622 | certain files, or retry all files with a linear search. When |
| 8623 | 'tagbsearch' is off, only a linear search is done. |
| 8624 | |
| 8625 | Linear searching is done anyway, for one file, when Vim finds a line |
| 8626 | at the start of the file indicating that it's not sorted: > |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 8627 | !_TAG_FILE_SORTED 0 /some comment/ |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8628 | < [The whitespace before and after the '0' must be a single <Tab>] |
| 8629 | |
| 8630 | When a binary search was done and no match was found in any of the |
Bram Moolenaar | 0f6562e | 2015-11-24 18:48:14 +0100 | [diff] [blame] | 8631 | files listed in 'tags', and case is ignored or a pattern is used |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8632 | instead of a normal tag name, a retry is done with a linear search. |
| 8633 | Tags in unsorted tags files, and matches with different case will only |
| 8634 | be found in the retry. |
| 8635 | |
Bram Moolenaar | d4755bb | 2004-09-02 19:12:26 +0000 | [diff] [blame] | 8636 | If a tag file indicates that it is case-fold sorted, the second, |
Bram Moolenaar | 0f6562e | 2015-11-24 18:48:14 +0100 | [diff] [blame] | 8637 | linear search can be avoided when case is ignored. Use a value of '2' |
| 8638 | in the "!_TAG_FILE_SORTED" line for this. A tag file can be case-fold |
| 8639 | sorted with the -f switch to "sort" in most unices, as in the command: |
Bram Moolenaar | 47c532e | 2022-03-19 15:18:53 +0000 | [diff] [blame] | 8640 | "sort -f -o tags tags". For Universal ctags and Exuberant ctags |
| 8641 | version 5.x or higher (at least 5.5) the --sort=foldcase switch can be |
| 8642 | used for this as well. Note that case must be folded to uppercase for |
| 8643 | this to work. |
Bram Moolenaar | 0f6562e | 2015-11-24 18:48:14 +0100 | [diff] [blame] | 8644 | |
| 8645 | By default, tag searches are case-sensitive. Case is ignored when |
| 8646 | 'ignorecase' is set and 'tagcase' is "followic", or when 'tagcase' is |
| 8647 | "ignore". |
Bram Moolenaar | 66e29d7 | 2016-08-20 16:57:02 +0200 | [diff] [blame] | 8648 | Also when 'tagcase' is "followscs" and 'smartcase' is set, or |
| 8649 | 'tagcase' is "smart", and the pattern contains only lowercase |
| 8650 | characters. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8651 | |
| 8652 | When 'tagbsearch' is off, tags searching is slower when a full match |
| 8653 | exists, but faster when no full match exists. Tags in unsorted tags |
| 8654 | files may only be found with 'tagbsearch' off. |
| 8655 | When the tags file is not sorted, or sorted in a wrong way (not on |
| 8656 | ASCII byte value), 'tagbsearch' should be off, or the line given above |
| 8657 | must be included in the tags file. |
| 8658 | This option doesn't affect commands that find all matching tags (e.g., |
| 8659 | command-line completion and ":help"). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8660 | |
Bram Moolenaar | 0f6562e | 2015-11-24 18:48:14 +0100 | [diff] [blame] | 8661 | *'tagcase'* *'tc'* |
| 8662 | 'tagcase' 'tc' string (default "followic") |
| 8663 | global or local to buffer |global-local| |
Bram Moolenaar | 0f6562e | 2015-11-24 18:48:14 +0100 | [diff] [blame] | 8664 | This option specifies how case is handled when searching the tags |
| 8665 | file: |
| 8666 | followic Follow the 'ignorecase' option |
Bram Moolenaar | 66e29d7 | 2016-08-20 16:57:02 +0200 | [diff] [blame] | 8667 | followscs Follow the 'smartcase' and 'ignorecase' options |
Bram Moolenaar | 0f6562e | 2015-11-24 18:48:14 +0100 | [diff] [blame] | 8668 | ignore Ignore case |
| 8669 | match Match case |
Bram Moolenaar | 66e29d7 | 2016-08-20 16:57:02 +0200 | [diff] [blame] | 8670 | smart Ignore case unless an upper case letter is used |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 8671 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 8672 | set and to the Vim default value when 'compatible' is reset. |
Bram Moolenaar | 0f6562e | 2015-11-24 18:48:14 +0100 | [diff] [blame] | 8673 | |
Bram Moolenaar | 45e18cb | 2019-04-28 18:05:35 +0200 | [diff] [blame] | 8674 | *'tagfunc'* *'tfu'* |
| 8675 | 'tagfunc' 'tfu' string (default: empty) |
| 8676 | local to buffer |
| 8677 | {not available when compiled without the |+eval| |
| 8678 | feature} |
Christian Brabandt | fb08192 | 2025-04-30 19:31:58 +0200 | [diff] [blame] | 8679 | This option specifies a function to be used to perform tag searches |
| 8680 | (including |taglist()|). |
Bram Moolenaar | 45e18cb | 2019-04-28 18:05:35 +0200 | [diff] [blame] | 8681 | The function gets the tag pattern and should return a List of matching |
| 8682 | tags. See |tag-function| for an explanation of how to write the |
Yegappan Lakshmanan | 19916a8 | 2021-11-24 16:32:55 +0000 | [diff] [blame] | 8683 | function and an example. The value can be the name of a function, a |
| 8684 | |lambda| or a |Funcref|. See |option-value-function| for more |
| 8685 | information. |
dkearns | 8ebdbc9 | 2023-10-29 06:26:19 +1100 | [diff] [blame] | 8686 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 8687 | security reasons. |
Bram Moolenaar | 45e18cb | 2019-04-28 18:05:35 +0200 | [diff] [blame] | 8688 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8689 | *'taglength'* *'tl'* |
| 8690 | 'taglength' 'tl' number (default 0) |
| 8691 | global |
| 8692 | If non-zero, tags are significant up to this number of characters. |
| 8693 | |
| 8694 | *'tagrelative'* *'tr'* *'notagrelative'* *'notr'* |
| 8695 | 'tagrelative' 'tr' boolean (Vim default: on, Vi default: off) |
| 8696 | global |
Bram Moolenaar | c6fe919 | 2006-04-09 21:54:49 +0000 | [diff] [blame] | 8697 | If on and using a tags file in another directory, file names in that |
| 8698 | tags file are relative to the directory where the tags file is. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8699 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 8700 | set and to the Vim default value when 'compatible' is reset. |
| 8701 | |
| 8702 | *'tags'* *'tag'* *E433* |
| 8703 | 'tags' 'tag' string (default "./tags,tags", when compiled with |
| 8704 | |+emacs_tags|: "./tags,./TAGS,tags,TAGS") |
| 8705 | global or local to buffer |global-local| |
| 8706 | Filenames for the tag command, separated by spaces or commas. To |
Yee Cheng Chin | 5484485 | 2023-10-09 18:12:31 +0200 | [diff] [blame] | 8707 | include a space or comma in a file name, precede it with backslashes |
| 8708 | (see |option-backslash| about including spaces/commas and backslashes). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8709 | When a file name starts with "./", the '.' is replaced with the path |
| 8710 | of the current file. But only when the 'd' flag is not included in |
| 8711 | 'cpoptions'. Environment variables are expanded |:set_env|. Also see |
| 8712 | |tags-option|. |
| 8713 | "*", "**" and other wildcards can be used to search for tags files in |
Bram Moolenaar | e2b590e | 2010-08-08 18:29:48 +0200 | [diff] [blame] | 8714 | a directory tree. See |file-searching|. E.g., "/lib/**/tags" will |
| 8715 | find all files named "tags" below "/lib". The filename itself cannot |
| 8716 | contain wildcards, it is used as-is. E.g., "/lib/**/tags?" will find |
Bram Moolenaar | 2bd9dbc | 2022-08-25 18:12:06 +0100 | [diff] [blame] | 8717 | files called "tags?". |
Bram Moolenaar | e7eb9df | 2005-09-09 19:49:30 +0000 | [diff] [blame] | 8718 | The |tagfiles()| function can be used to get a list of the file names |
| 8719 | actually used. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8720 | If Vim was compiled with the |+emacs_tags| feature, Emacs-style tag |
| 8721 | files are also supported. They are automatically recognized. The |
| 8722 | default value becomes "./tags,./TAGS,tags,TAGS", unless case |
| 8723 | differences are ignored (MS-Windows). |emacs-tags| |
| 8724 | The use of |:set+=| and |:set-=| is preferred when adding or removing |
| 8725 | file names from the list. This avoids problems when a future version |
| 8726 | uses another default. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8727 | |
| 8728 | *'tagstack'* *'tgst'* *'notagstack'* *'notgst'* |
| 8729 | 'tagstack' 'tgst' boolean (default on) |
| 8730 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8731 | When on, the |tagstack| is used normally. When off, a ":tag" or |
| 8732 | ":tselect" command with an argument will not push the tag onto the |
| 8733 | tagstack. A following ":tag" without an argument, a ":pop" command or |
| 8734 | any other command that uses the tagstack will use the unmodified |
| 8735 | tagstack, but does change the pointer to the active entry. |
| 8736 | Resetting this option is useful when using a ":tag" command in a |
| 8737 | mapping which should not change the tagstack. |
| 8738 | |
Bram Moolenaar | 8a5115c | 2016-01-09 19:41:11 +0100 | [diff] [blame] | 8739 | *'tcldll'* |
Bram Moolenaar | 3848e00 | 2016-03-19 18:42:29 +0100 | [diff] [blame] | 8740 | 'tcldll' string (default depends on the build) |
Bram Moolenaar | 8a5115c | 2016-01-09 19:41:11 +0100 | [diff] [blame] | 8741 | global |
Bram Moolenaar | 8a5115c | 2016-01-09 19:41:11 +0100 | [diff] [blame] | 8742 | {only available when compiled with the |+tcl/dyn| |
| 8743 | feature} |
| 8744 | Specifies the name of the Tcl shared library. The default is |
| 8745 | DYNAMIC_TCL_DLL, which was specified at compile time. |
Bram Moolenaar | aa3b15d | 2016-04-21 08:53:19 +0200 | [diff] [blame] | 8746 | Environment variables are expanded |:set_env|. |
Bram Moolenaar | 8a5115c | 2016-01-09 19:41:11 +0100 | [diff] [blame] | 8747 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 8748 | security reasons. |
| 8749 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8750 | *'term'* *E529* *E530* *E531* |
| 8751 | 'term' string (default is $TERM, if that fails: |
| 8752 | in the GUI: "builtin_gui" |
| 8753 | on Amiga: "amiga" |
Bram Moolenaar | b3f7406 | 2020-02-26 16:16:53 +0100 | [diff] [blame] | 8754 | on Haiku: "xterm" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8755 | on Mac: "mac-ansi" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8756 | on Unix: "ansi" |
| 8757 | on VMS: "ansi" |
| 8758 | on Win 32: "win32") |
| 8759 | global |
| 8760 | Name of the terminal. Used for choosing the terminal control |
| 8761 | characters. Environment variables are expanded |:set_env|. |
| 8762 | For example: > |
| 8763 | :set term=$TERM |
| 8764 | < See |termcap|. |
| 8765 | |
| 8766 | *'termbidi'* *'tbidi'* |
| 8767 | *'notermbidi'* *'notbidi'* |
| 8768 | 'termbidi' 'tbidi' boolean (default off, on for "mlterm") |
| 8769 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8770 | {only available when compiled with the |+arabic| |
| 8771 | feature} |
| 8772 | The terminal is in charge of Bi-directionality of text (as specified |
| 8773 | by Unicode). The terminal is also expected to do the required shaping |
| 8774 | that some languages (such as Arabic) require. |
| 8775 | Setting this option implies that 'rightleft' will not be set when |
| 8776 | 'arabic' is set and the value of 'arabicshape' will be ignored. |
| 8777 | Note that setting 'termbidi' has the immediate effect that |
| 8778 | 'arabicshape' is ignored, but 'rightleft' isn't changed automatically. |
| 8779 | This option is reset when the GUI is started. |
| 8780 | For further details see |arabic.txt|. |
| 8781 | |
| 8782 | *'termencoding'* *'tenc'* |
Bram Moolenaar | 3d1cde8 | 2020-08-15 18:55:18 +0200 | [diff] [blame] | 8783 | 'termencoding' 'tenc' string (default ""; with GTK+ GUI: "utf-8") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8784 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8785 | Encoding used for the terminal. This specifies what character |
| 8786 | encoding the keyboard produces and the display will understand. For |
Bram Moolenaar | 3848e00 | 2016-03-19 18:42:29 +0100 | [diff] [blame] | 8787 | the GUI it only applies to the keyboard ('encoding' is used for the |
Bram Moolenaar | 3d1cde8 | 2020-08-15 18:55:18 +0200 | [diff] [blame] | 8788 | display). |
Bram Moolenaar | 4b7cdca | 2020-01-01 16:18:38 +0100 | [diff] [blame] | 8789 | *E617* *E950* |
Bram Moolenaar | 3df0173 | 2017-02-17 22:47:16 +0100 | [diff] [blame] | 8790 | Note: This does not apply to the GTK+ GUI. After the GUI has been |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8791 | successfully initialized, 'termencoding' is forcibly set to "utf-8". |
| 8792 | Any attempts to set a different value will be rejected, and an error |
| 8793 | message is shown. |
Bram Moolenaar | ac360bf | 2015-09-01 20:31:20 +0200 | [diff] [blame] | 8794 | For the Win32 GUI and console versions 'termencoding' is not used, |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8795 | because the Win32 system always passes Unicode characters. |
| 8796 | When empty, the same encoding is used as for the 'encoding' option. |
| 8797 | This is the normal value. |
| 8798 | Not all combinations for 'termencoding' and 'encoding' are valid. See |
| 8799 | |encoding-table|. |
| 8800 | The value for this option must be supported by internal conversions or |
| 8801 | iconv(). When this is not possible no conversion will be done and you |
| 8802 | will probably experience problems with non-ASCII characters. |
| 8803 | Example: You are working with the locale set to euc-jp (Japanese) and |
| 8804 | want to edit a UTF-8 file: > |
| 8805 | :let &termencoding = &encoding |
| 8806 | :set encoding=utf-8 |
| 8807 | < You need to do this when your system has no locale support for UTF-8. |
| 8808 | |
Bram Moolenaar | 938ae28 | 2023-02-20 20:44:55 +0000 | [diff] [blame] | 8809 | *'termguicolors'* *'tgc'* *'notermguicolors'* *'notgc'* *E954* |
Christian Brabandt | d7f5854 | 2025-01-31 16:13:14 +0100 | [diff] [blame] | 8810 | 'termguicolors' 'tgc' boolean (default off unless Vim detects that it runs |
| 8811 | in a capable terminal) |
Bram Moolenaar | 61be73b | 2016-04-29 22:59:22 +0200 | [diff] [blame] | 8812 | global |
Bram Moolenaar | 61be73b | 2016-04-29 22:59:22 +0200 | [diff] [blame] | 8813 | {not available when compiled without the |
| 8814 | |+termguicolors| feature} |
| 8815 | When on, uses |highlight-guifg| and |highlight-guibg| attributes in |
Bram Moolenaar | cafafb3 | 2018-02-22 21:07:09 +0100 | [diff] [blame] | 8816 | the terminal (thus using 24-bit color). |
Bram Moolenaar | 22f1d0e | 2018-02-27 14:53:30 +0100 | [diff] [blame] | 8817 | |
Bram Moolenaar | cafafb3 | 2018-02-22 21:07:09 +0100 | [diff] [blame] | 8818 | Requires a ISO-8613-3 compatible terminal. If setting this option |
| 8819 | does not work (produces a colorless UI) reading |xterm-true-color| |
| 8820 | might help. |
| 8821 | |
| 8822 | For Win32 console, Windows 10 version 1703 (Creators Update) or later |
| 8823 | is required. Use this check to find out: > |
| 8824 | if has('vcon') |
Bram Moolenaar | 22f1d0e | 2018-02-27 14:53:30 +0100 | [diff] [blame] | 8825 | < This requires Vim to be built with the |+vtp| feature. |
| 8826 | |
Bram Moolenaar | 6aa8cea | 2017-06-05 14:44:35 +0200 | [diff] [blame] | 8827 | Note that the "cterm" attributes are still used, not the "gui" ones. |
Yasuhiro Matsumoto | aa04e1b | 2022-05-07 14:09:19 +0100 | [diff] [blame] | 8828 | |
| 8829 | When using Vim with Windows Terminal, the background of Windows |
| 8830 | Terminal is normally filled with the Vim background color. Setting |
| 8831 | 'termguicolors' and the guibg of the Normal highlight group to NONE |
| 8832 | will make the background transparent: > |
| 8833 | :hi Normal guibg=NONE |
| 8834 | < |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 8835 | NOTE: This option is reset when 'compatible' is set. |
Bram Moolenaar | 61be73b | 2016-04-29 22:59:22 +0200 | [diff] [blame] | 8836 | |
Bram Moolenaar | 7dda86f | 2018-04-20 22:36:41 +0200 | [diff] [blame] | 8837 | *'termwinkey'* *'twk'* |
| 8838 | 'termwinkey' 'twk' string (default "") |
Bram Moolenaar | 74675a6 | 2017-07-15 13:53:23 +0200 | [diff] [blame] | 8839 | local to window |
Bram Moolenaar | f55e4c8 | 2017-08-01 20:44:53 +0200 | [diff] [blame] | 8840 | The key that starts a CTRL-W command in a terminal window. Other keys |
Bram Moolenaar | 74675a6 | 2017-07-15 13:53:23 +0200 | [diff] [blame] | 8841 | are sent to the job running in the window. |
Milly | a9c6f90 | 2024-10-06 16:47:02 +0200 | [diff] [blame] | 8842 | The key can be specified as a single character, a |key-notation| (e.g. |
| 8843 | <Up>, <C-F>) or a letter preceded with a caret (e.g. `^F` is CTRL-F): > |
| 8844 | :set twk=X |
| 8845 | :set twk=^I |
| 8846 | :set twk=<C-L> |
Bram Moolenaar | f55e4c8 | 2017-08-01 20:44:53 +0200 | [diff] [blame] | 8847 | < The string must be one key stroke but can be multiple bytes. |
| 8848 | When not set CTRL-W is used, so that CTRL-W : gets you to the command |
Bram Moolenaar | 7dda86f | 2018-04-20 22:36:41 +0200 | [diff] [blame] | 8849 | line. If 'termwinkey' is set to CTRL-L then CTRL-L : gets you to the |
Bram Moolenaar | f55e4c8 | 2017-08-01 20:44:53 +0200 | [diff] [blame] | 8850 | command line. |
Bram Moolenaar | 74675a6 | 2017-07-15 13:53:23 +0200 | [diff] [blame] | 8851 | |
Bram Moolenaar | 6c60f47 | 2019-04-28 16:00:35 +0200 | [diff] [blame] | 8852 | *'termwinscroll'* *'twsl'* |
| 8853 | 'termwinscroll' 'twsl' number (default 10000) |
| 8854 | local to buffer |
| 8855 | {not available when compiled without the |
| 8856 | |+terminal| feature} |
| 8857 | Number of scrollback lines to keep. When going over this limit the |
| 8858 | first 10% of the scrollback lines are deleted. This is just to reduce |
| 8859 | the memory usage. See |Terminal-Normal|. |
Bram Moolenaar | 36968af | 2021-11-15 17:13:11 +0000 | [diff] [blame] | 8860 | Also used as a limit for text sent to the terminal in one write, |
| 8861 | multiplied by the number of columns times 3 (average number of bytes |
| 8862 | per cell). |
Bram Moolenaar | 6c60f47 | 2019-04-28 16:00:35 +0200 | [diff] [blame] | 8863 | |
Bram Moolenaar | 7dda86f | 2018-04-20 22:36:41 +0200 | [diff] [blame] | 8864 | *'termwinsize'* *'tws'* |
| 8865 | 'termwinsize' 'tws' string (default "") |
Bram Moolenaar | 74675a6 | 2017-07-15 13:53:23 +0200 | [diff] [blame] | 8866 | local to window |
Bram Moolenaar | 1c6737b | 2020-09-07 22:18:52 +0200 | [diff] [blame] | 8867 | Size used when opening the |terminal| window. Format: |
| 8868 | {rows}x{columns} or {rows}*{columns}. |
Bram Moolenaar | 74675a6 | 2017-07-15 13:53:23 +0200 | [diff] [blame] | 8869 | - When empty the terminal gets the size from the window. |
Bram Moolenaar | 498c256 | 2018-04-15 23:45:15 +0200 | [diff] [blame] | 8870 | - When set with a "x" (e.g., "24x80") the terminal size is not |
| 8871 | adjusted to the window size. If the window is smaller only the |
| 8872 | top-left part is displayed. |
| 8873 | - When set with a "*" (e.g., "10*50") the terminal size follows the |
| 8874 | window size, but will not be smaller than the specified rows and/or |
| 8875 | columns. |
| 8876 | - When rows is zero then use the height of the window. |
| 8877 | - When columns is zero then use the width of the window. |
| 8878 | - Using "0x0" or "0*0" is the same as empty. |
Bram Moolenaar | 1c6737b | 2020-09-07 22:18:52 +0200 | [diff] [blame] | 8879 | - Can be overruled in the |term_start()| options with "term_rows" and |
| 8880 | "term_cols". |
Bram Moolenaar | 498c256 | 2018-04-15 23:45:15 +0200 | [diff] [blame] | 8881 | |
| 8882 | Examples: |
| 8883 | "30x0" uses 30 rows and the current window width. |
| 8884 | "20*0" uses at least 20 rows and the current window width. |
| 8885 | "0*40" uses the current window height and at least 40 columns. |
Bram Moolenaar | 1f2903c | 2017-07-23 19:51:01 +0200 | [diff] [blame] | 8886 | Note that the command running in the terminal window may still change |
| 8887 | the size of the terminal. In that case the Vim window will be |
| 8888 | adjusted to that size, if possible. |
Bram Moolenaar | 74675a6 | 2017-07-15 13:53:23 +0200 | [diff] [blame] | 8889 | |
Bram Moolenaar | c6ddce3 | 2019-02-08 12:47:03 +0100 | [diff] [blame] | 8890 | *'termwintype'* *'twt'* |
| 8891 | 'termwintype' 'twt' string (default "") |
| 8892 | global |
Bram Moolenaar | c6ddce3 | 2019-02-08 12:47:03 +0100 | [diff] [blame] | 8893 | {only available when compiled with the |terminal| |
| 8894 | feature on MS-Windows} |
| 8895 | Specify the virtual console (pty) used when opening the terminal |
| 8896 | window. |
| 8897 | |
| 8898 | Possible values are: |
Bram Moolenaar | d9ef1b8 | 2019-02-13 19:23:10 +0100 | [diff] [blame] | 8899 | "" use ConPTY if it is stable, winpty otherwise |
Bram Moolenaar | c6ddce3 | 2019-02-08 12:47:03 +0100 | [diff] [blame] | 8900 | "winpty" use winpty, fail if not supported |
| 8901 | "conpty" use |ConPTY|, fail if not supported |
| 8902 | |
Bram Moolenaar | d9ef1b8 | 2019-02-13 19:23:10 +0100 | [diff] [blame] | 8903 | |ConPTY| support depends on the platform. Windows 10 October 2018 |
| 8904 | Update is the first version that supports ConPTY, however it is still |
| 8905 | considered unstable. ConPTY might become stable in the next release |
| 8906 | of Windows 10. winpty support needs to be installed. If neither is |
Bram Moolenaar | c6ddce3 | 2019-02-08 12:47:03 +0100 | [diff] [blame] | 8907 | supported then you cannot open a terminal window. |
| 8908 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8909 | *'terse'* *'noterse'* |
| 8910 | 'terse' boolean (default off) |
| 8911 | global |
| 8912 | When set: Add 's' flag to 'shortmess' option (this makes the message |
| 8913 | for a search that hits the start or end of the file not being |
| 8914 | displayed). When reset: Remove 's' flag from 'shortmess' option. {Vi |
| 8915 | shortens a lot of messages} |
| 8916 | |
| 8917 | *'textauto'* *'ta'* *'notextauto'* *'nota'* |
| 8918 | 'textauto' 'ta' boolean (Vim default: on, Vi default: off) |
| 8919 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8920 | This option is obsolete. Use 'fileformats'. |
| 8921 | For backwards compatibility, when 'textauto' is set, 'fileformats' is |
| 8922 | set to the default value for the current system. When 'textauto' is |
| 8923 | reset, 'fileformats' is made empty. |
| 8924 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 8925 | set and to the Vim default value when 'compatible' is reset. |
| 8926 | |
| 8927 | *'textmode'* *'tx'* *'notextmode'* *'notx'* |
Bram Moolenaar | 6f345a1 | 2019-12-17 21:27:18 +0100 | [diff] [blame] | 8928 | 'textmode' 'tx' boolean (Win32: default on, |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8929 | others: default off) |
| 8930 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8931 | This option is obsolete. Use 'fileformat'. |
| 8932 | For backwards compatibility, when 'textmode' is set, 'fileformat' is |
| 8933 | set to "dos". When 'textmode' is reset, 'fileformat' is set to |
| 8934 | "unix". |
| 8935 | |
| 8936 | *'textwidth'* *'tw'* |
| 8937 | 'textwidth' 'tw' number (default 0) |
| 8938 | local to buffer |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8939 | Maximum width of text that is being inserted. A longer line will be |
| 8940 | broken after white space to get this width. A zero value disables |
Bram Moolenaar | ca63501 | 2015-09-25 20:34:21 +0200 | [diff] [blame] | 8941 | this. |
| 8942 | 'textwidth' is set to 0 when the 'paste' option is set and restored |
| 8943 | when 'paste' is reset. |
| 8944 | When 'textwidth' is zero, 'wrapmargin' may be used. See also |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8945 | 'formatoptions' and |ins-textwidth|. |
Bram Moolenaar | fc1421e | 2006-04-20 22:17:20 +0000 | [diff] [blame] | 8946 | When 'formatexpr' is set it will be used to break the line. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8947 | NOTE: This option is set to 0 when 'compatible' is set. |
| 8948 | |
| 8949 | *'thesaurus'* *'tsr'* |
| 8950 | 'thesaurus' 'tsr' string (default "") |
| 8951 | global or local to buffer |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8952 | List of file names, separated by commas, that are used to lookup words |
Bram Moolenaar | f4d8b76 | 2021-10-17 14:13:09 +0100 | [diff] [blame] | 8953 | for thesaurus completion commands |i_CTRL-X_CTRL-T|. See |
| 8954 | |compl-thesaurus|. |
Bram Moolenaar | f0d58ef | 2018-11-16 16:13:44 +0100 | [diff] [blame] | 8955 | |
Bram Moolenaar | f4d8b76 | 2021-10-17 14:13:09 +0100 | [diff] [blame] | 8956 | This option is not used if 'thesaurusfunc' is set, either for the |
| 8957 | buffer or globally. |
Bram Moolenaar | f0d58ef | 2018-11-16 16:13:44 +0100 | [diff] [blame] | 8958 | |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 8959 | To include a comma in a file name precede it with a backslash. Spaces |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8960 | after a comma are ignored, otherwise spaces are included in the file |
Bram Moolenaar | f4d8b76 | 2021-10-17 14:13:09 +0100 | [diff] [blame] | 8961 | name. See |option-backslash| about using backslashes. The use of |
| 8962 | |:set+=| and |:set-=| is preferred when adding or removing directories |
| 8963 | from the list. This avoids problems when a future version uses |
| 8964 | another default. Backticks cannot be used in this option for security |
| 8965 | reasons. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8966 | |
Bram Moolenaar | 2f0936c | 2022-01-08 21:51:59 +0000 | [diff] [blame] | 8967 | *'thesaurusfunc'* *'tsrfu'* |
Yegappan Lakshmanan | 160e994 | 2021-10-16 15:41:29 +0100 | [diff] [blame] | 8968 | 'thesaurusfunc' 'tsrfu' string (default: empty) |
Bram Moolenaar | f4d8b76 | 2021-10-17 14:13:09 +0100 | [diff] [blame] | 8969 | global or local to buffer |global-local| |
Yegappan Lakshmanan | 160e994 | 2021-10-16 15:41:29 +0100 | [diff] [blame] | 8970 | {not available when compiled without the |+eval| |
| 8971 | feature} |
| 8972 | This option specifies a function to be used for thesaurus completion |
Bram Moolenaar | f4d8b76 | 2021-10-17 14:13:09 +0100 | [diff] [blame] | 8973 | with CTRL-X CTRL-T. |i_CTRL-X_CTRL-T| See |compl-thesaurusfunc|. |
Yegappan Lakshmanan | 8658c75 | 2021-12-03 11:09:29 +0000 | [diff] [blame] | 8974 | The value can be the name of a function, a |lambda| or a |Funcref|. |
| 8975 | See |option-value-function| for more information. |
Bram Moolenaar | f4d8b76 | 2021-10-17 14:13:09 +0100 | [diff] [blame] | 8976 | |
Yegappan Lakshmanan | 160e994 | 2021-10-16 15:41:29 +0100 | [diff] [blame] | 8977 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 8978 | security reasons. |
| 8979 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8980 | *'tildeop'* *'top'* *'notildeop'* *'notop'* |
| 8981 | 'tildeop' 'top' boolean (default off) |
| 8982 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8983 | When on: The tilde command "~" behaves like an operator. |
| 8984 | NOTE: This option is reset when 'compatible' is set. |
| 8985 | |
| 8986 | *'timeout'* *'to'* *'notimeout'* *'noto'* |
| 8987 | 'timeout' 'to' boolean (default on) |
| 8988 | global |
laburnumT | 3f7855a | 2023-12-05 18:37:03 +0100 | [diff] [blame] | 8989 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8990 | *'ttimeout'* *'nottimeout'* |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 8991 | 'ttimeout' boolean (default off, set in |defaults.vim|) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8992 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8993 | These two options together determine the behavior when part of a |
| 8994 | mapped key sequence or keyboard code has been received: |
| 8995 | |
| 8996 | 'timeout' 'ttimeout' action ~ |
| 8997 | off off do not time out |
| 8998 | on on or off time out on :mappings and key codes |
| 8999 | off on time out on key codes |
| 9000 | |
| 9001 | If both options are off, Vim will wait until either the complete |
| 9002 | mapping or key sequence has been received, or it is clear that there |
| 9003 | is no mapping or key sequence for the received characters. For |
| 9004 | example: if you have mapped "vl" and Vim has received 'v', the next |
| 9005 | character is needed to see if the 'v' is followed by an 'l'. |
| 9006 | When one of the options is on, Vim will wait for about 1 second for |
| 9007 | the next character to arrive. After that the already received |
| 9008 | characters are interpreted as single characters. The waiting time can |
| 9009 | be changed with the 'timeoutlen' option. |
| 9010 | On slow terminals or very busy systems timing out may cause |
| 9011 | malfunctioning cursor keys. If both options are off, Vim waits |
| 9012 | forever after an entered <Esc> if there are key codes that start |
| 9013 | with <Esc>. You will have to type <Esc> twice. If you do not have |
| 9014 | problems with key codes, but would like to have :mapped key |
| 9015 | sequences not timing out in 1 second, set the 'ttimeout' option and |
| 9016 | reset the 'timeout' option. |
| 9017 | |
| 9018 | NOTE: 'ttimeout' is reset when 'compatible' is set. |
| 9019 | |
| 9020 | *'timeoutlen'* *'tm'* |
| 9021 | 'timeoutlen' 'tm' number (default 1000) |
| 9022 | global |
Bram Moolenaar | 25c9c68 | 2019-05-05 18:13:34 +0200 | [diff] [blame] | 9023 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9024 | *'ttimeoutlen'* *'ttm'* |
Bram Moolenaar | 9423749 | 2017-04-23 18:40:21 +0200 | [diff] [blame] | 9025 | 'ttimeoutlen' 'ttm' number (default -1, set to 100 in |defaults.vim|) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9026 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9027 | The time in milliseconds that is waited for a key code or mapped key |
| 9028 | sequence to complete. Also used for CTRL-\ CTRL-N and CTRL-\ CTRL-G |
| 9029 | when part of a command has been typed. |
| 9030 | Normally only 'timeoutlen' is used and 'ttimeoutlen' is -1. When a |
| 9031 | different timeout value for key codes is desired set 'ttimeoutlen' to |
| 9032 | a non-negative number. |
| 9033 | |
| 9034 | ttimeoutlen mapping delay key code delay ~ |
| 9035 | < 0 'timeoutlen' 'timeoutlen' |
| 9036 | >= 0 'timeoutlen' 'ttimeoutlen' |
| 9037 | |
| 9038 | The timeout only happens when the 'timeout' and 'ttimeout' options |
| 9039 | tell so. A useful setting would be > |
| 9040 | :set timeout timeoutlen=3000 ttimeoutlen=100 |
| 9041 | < (time out on mapping after three seconds, time out on key codes after |
| 9042 | a tenth of a second). |
| 9043 | |
| 9044 | *'title'* *'notitle'* |
| 9045 | 'title' boolean (default off, on when title can be restored) |
| 9046 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9047 | When on, the title of the window will be set to the value of |
| 9048 | 'titlestring' (if it is not empty), or to: |
| 9049 | filename [+=-] (path) - VIM |
| 9050 | Where: |
| 9051 | filename the name of the file being edited |
| 9052 | - indicates the file cannot be modified, 'ma' off |
| 9053 | + indicates the file was modified |
| 9054 | = indicates the file is read-only |
| 9055 | =+ indicates the file is read-only and modified |
| 9056 | (path) is the path of the file being edited |
| 9057 | - VIM the server name |v:servername| or "VIM" |
| 9058 | Only works if the terminal supports setting window titles |
| 9059 | (currently Amiga console, Win32 console, all GUI versions and |
Bram Moolenaar | d1caa94 | 2020-04-10 22:10:56 +0200 | [diff] [blame] | 9060 | terminals with a non-empty 't_ts' option - these are Unix xterm and |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9061 | iris-ansi by default, where 't_ts' is taken from the builtin termcap). |
| 9062 | *X11* |
| 9063 | When Vim was compiled with HAVE_X11 defined, the original title will |
| 9064 | be restored if possible. The output of ":version" will include "+X11" |
| 9065 | when HAVE_X11 was defined, otherwise it will be "-X11". This also |
| 9066 | works for the icon name |'icon'|. |
| 9067 | But: When Vim was started with the |-X| argument, restoring the title |
| 9068 | will not work (except in the GUI). |
| 9069 | If the title cannot be restored, it is set to the value of 'titleold'. |
| 9070 | You might want to restore the title outside of Vim then. |
Christian Brabandt | 1b7fbe7 | 2024-01-30 20:41:07 +0100 | [diff] [blame] | 9071 | When using an xterm from a remote machine you can use this command: > |
| 9072 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9073 | rsh machine_name xterm -display $DISPLAY & |
Christian Brabandt | 1b7fbe7 | 2024-01-30 20:41:07 +0100 | [diff] [blame] | 9074 | ssh -X machine_name xterm & |
| 9075 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9076 | then the WINDOWID environment variable should be inherited and the |
| 9077 | title of the window should change back to what it should be after |
| 9078 | exiting Vim. |
| 9079 | |
| 9080 | *'titlelen'* |
| 9081 | 'titlelen' number (default 85) |
| 9082 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9083 | Gives the percentage of 'columns' to use for the length of the window |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 9084 | title. When the title is longer, only the end of the path name is |
| 9085 | shown. A '<' character before the path name is used to indicate this. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9086 | Using a percentage makes this adapt to the width of the window. But |
| 9087 | it won't work perfectly, because the actual number of characters |
| 9088 | available also depends on the font used and other things in the title |
| 9089 | bar. When 'titlelen' is zero the full path is used. Otherwise, |
| 9090 | values from 1 to 30000 percent can be used. |
| 9091 | 'titlelen' is also used for the 'titlestring' option. |
| 9092 | |
| 9093 | *'titleold'* |
| 9094 | 'titleold' string (default "Thanks for flying Vim") |
| 9095 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9096 | This option will be used for the window title when exiting Vim if the |
| 9097 | original title cannot be restored. Only happens if 'title' is on or |
| 9098 | 'titlestring' is not empty. |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 9099 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 9100 | security reasons. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9101 | *'titlestring'* |
| 9102 | 'titlestring' string (default "") |
| 9103 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9104 | When this option is not empty, it will be used for the title of the |
| 9105 | window. This happens only when the 'title' option is on. |
| 9106 | Only works if the terminal supports setting window titles (currently |
| 9107 | Amiga console, Win32 console, all GUI versions and terminals with a |
| 9108 | non-empty 't_ts' option). |
| 9109 | When Vim was compiled with HAVE_X11 defined, the original title will |
Bram Moolenaar | 5162822 | 2016-12-01 23:03:28 +0100 | [diff] [blame] | 9110 | be restored if possible, see |X11|. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 9111 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9112 | When this option contains printf-style '%' items, they will be |
Milly | 6c2fc37 | 2024-10-16 22:11:17 +0200 | [diff] [blame] | 9113 | expanded according to the rules used for 'statusline'. If it contains |
| 9114 | an invalid '%' format, the value is used as-is and no error or warning |
| 9115 | will be given when the value is set. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 9116 | This option cannot be set in a modeline when 'modelineexpr' is off. |
| 9117 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9118 | Example: > |
Bram Moolenaar | c51cf03 | 2022-02-26 12:25:45 +0000 | [diff] [blame] | 9119 | :auto BufEnter * let &titlestring = hostname() .. "/" .. expand("%:p") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9120 | :set title titlestring=%<%F%=%l/%L-%P titlelen=70 |
| 9121 | < The value of 'titlelen' is used to align items in the middle or right |
| 9122 | of the available space. |
| 9123 | Some people prefer to have the file name first: > |
| 9124 | :set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:.:h\")})%)%(\ %a%) |
| 9125 | < Note the use of "%{ }" and an expression to get the path of the file, |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 9126 | without the file name. The "%( %)" constructs are used to add a |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9127 | separating space only when needed. |
| 9128 | NOTE: Use of special characters in 'titlestring' may cause the display |
| 9129 | to be garbled (e.g., when it contains a CR or NL character). |
| 9130 | {not available when compiled without the |+statusline| feature} |
| 9131 | |
| 9132 | *'toolbar'* *'tb'* |
| 9133 | 'toolbar' 'tb' string (default "icons,tooltips") |
| 9134 | global |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 9135 | {only for |+GUI_GTK|, |+GUI_Motif| and |+GUI_Photon|} |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 9136 | The contents of this option controls various toolbar settings. The |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9137 | possible values are: |
| 9138 | icons Toolbar buttons are shown with icons. |
| 9139 | text Toolbar buttons shown with text. |
| 9140 | horiz Icon and text of a toolbar button are |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 9141 | horizontally arranged. {only in GTK+ 2 GUI} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9142 | tooltips Tooltips are active for toolbar buttons. |
| 9143 | Tooltips refer to the popup help text which appears after the mouse |
| 9144 | cursor is placed over a toolbar button for a brief moment. |
| 9145 | |
| 9146 | If you want the toolbar to be shown with icons as well as text, do the |
| 9147 | following: > |
| 9148 | :set tb=icons,text |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 9149 | < Motif cannot display icons and text at the same time. They |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9150 | will show icons if both are requested. |
| 9151 | |
| 9152 | If none of the strings specified in 'toolbar' are valid or if |
| 9153 | 'toolbar' is empty, this option is ignored. If you want to disable |
| 9154 | the toolbar, you need to set the 'guioptions' option. For example: > |
| 9155 | :set guioptions-=T |
| 9156 | < Also see |gui-toolbar|. |
| 9157 | |
| 9158 | *'toolbariconsize'* *'tbis'* |
| 9159 | 'toolbariconsize' 'tbis' string (default "small") |
| 9160 | global |
Bram Moolenaar | 3df0173 | 2017-02-17 22:47:16 +0100 | [diff] [blame] | 9161 | {only in the GTK+ GUI} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9162 | Controls the size of toolbar icons. The possible values are: |
Bram Moolenaar | 77cdfd1 | 2016-03-12 12:57:59 +0100 | [diff] [blame] | 9163 | tiny Use tiny icons. |
| 9164 | small Use small icons (default). |
| 9165 | medium Use medium-sized icons. |
| 9166 | large Use large icons. |
| 9167 | huge Use even larger icons. |
| 9168 | giant Use very big icons. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9169 | The exact dimensions in pixels of the various icon sizes depend on |
Bram Moolenaar | 77cdfd1 | 2016-03-12 12:57:59 +0100 | [diff] [blame] | 9170 | the current theme. Common dimensions are giant=48x48, huge=32x32, |
| 9171 | large=24x24, medium=24x24, small=20x20 and tiny=16x16. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9172 | |
| 9173 | If 'toolbariconsize' is empty, the global default size as determined |
| 9174 | by user preferences or the current theme is used. |
| 9175 | |
| 9176 | *'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'* |
| 9177 | 'ttybuiltin' 'tbi' boolean (default on) |
| 9178 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9179 | When on, the builtin termcaps are searched before the external ones. |
| 9180 | When off the builtin termcaps are searched after the external ones. |
| 9181 | When this option is changed, you should set the 'term' option next for |
| 9182 | the change to take effect, for example: > |
| 9183 | :set notbi term=$TERM |
| 9184 | < See also |termcap|. |
| 9185 | Rationale: The default for this option is "on", because the builtin |
| 9186 | termcap entries are generally better (many systems contain faulty |
| 9187 | xterm entries...). |
| 9188 | |
| 9189 | *'ttyfast'* *'tf'* *'nottyfast'* *'notf'* |
Bram Moolenaar | c1cf4c9 | 2022-11-25 15:09:35 +0000 | [diff] [blame] | 9190 | 'ttyfast' 'tf' boolean (default on) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9191 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9192 | Indicates a fast terminal connection. More characters will be sent to |
| 9193 | the screen for redrawing, instead of using insert/delete line |
| 9194 | commands. Improves smoothness of redrawing when there are multiple |
| 9195 | windows and the terminal does not support a scrolling region. |
| 9196 | Also enables the extra writing of characters at the end of each screen |
| 9197 | line for lines that wrap. This helps when using copy/paste with the |
| 9198 | mouse in an xterm and other terminals. |
| 9199 | |
Bram Moolenaar | c1cf4c9 | 2022-11-25 15:09:35 +0000 | [diff] [blame] | 9200 | The default used to be set only for some terminal names, but these |
| 9201 | days nearly all terminals are fast, therefore the default is now "on". |
| 9202 | If you have a slow connection you may want to set this option off, |
| 9203 | e.g. depending on the host name: > |
| 9204 | if hostname() =~ 'faraway' |
| 9205 | set nottyfast |
| 9206 | endif |
| 9207 | < |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9208 | *'ttymouse'* *'ttym'* |
| 9209 | 'ttymouse' 'ttym' string (default depends on 'term') |
| 9210 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9211 | {only in Unix and VMS, doesn't work in the GUI; not |
| 9212 | available when compiled without |+mouse|} |
| 9213 | Name of the terminal type for which mouse codes are to be recognized. |
Bram Moolenaar | 2c7a763 | 2007-05-10 18:19:11 +0000 | [diff] [blame] | 9214 | Currently these strings are valid: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9215 | *xterm-mouse* |
| 9216 | xterm xterm-like mouse handling. The mouse generates |
| 9217 | "<Esc>[Mscr", where "scr" is three bytes: |
| 9218 | "s" = button state |
| 9219 | "c" = column plus 33 |
| 9220 | "r" = row plus 33 |
Bram Moolenaar | e968e36 | 2014-05-13 20:23:24 +0200 | [diff] [blame] | 9221 | This only works up to 223 columns! See "dec", |
| 9222 | "urxvt", and "sgr" for solutions. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9223 | xterm2 Works like "xterm", but with the xterm reporting the |
| 9224 | mouse position while the mouse is dragged. This works |
| 9225 | much faster and more precise. Your xterm must at |
Bram Moolenaar | bc7aa85 | 2005-03-06 23:38:09 +0000 | [diff] [blame] | 9226 | least at patchlevel 88 / XFree 3.3.3 for this to |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9227 | work. See below for how Vim detects this |
| 9228 | automatically. |
| 9229 | *netterm-mouse* |
Bram Moolenaar | 25c9c68 | 2019-05-05 18:13:34 +0200 | [diff] [blame] | 9230 | netterm NetTerm mouse handling. A left mouse click generates |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9231 | "<Esc>}r,c<CR>", where "r,c" are two decimal numbers |
Bram Moolenaar | 25c9c68 | 2019-05-05 18:13:34 +0200 | [diff] [blame] | 9232 | for the row and column. No other mouse events are |
| 9233 | supported. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9234 | *dec-mouse* |
| 9235 | dec DEC terminal mouse handling. The mouse generates a |
| 9236 | rather complex sequence, starting with "<Esc>[". |
Bram Moolenaar | e4efc3b | 2005-03-07 23:16:51 +0000 | [diff] [blame] | 9237 | This is also available for an Xterm, if it was |
| 9238 | configured with "--enable-dec-locator". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9239 | *jsbterm-mouse* |
| 9240 | jsbterm JSB term mouse handling. |
| 9241 | *pterm-mouse* |
| 9242 | pterm QNX pterm mouse handling. |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9243 | *urxvt-mouse* |
| 9244 | urxvt Mouse handling for the urxvt (rxvt-unicode) terminal. |
Bram Moolenaar | e968e36 | 2014-05-13 20:23:24 +0200 | [diff] [blame] | 9245 | The mouse works only if the terminal supports this |
| 9246 | encoding style, but it does not have 223 columns limit |
| 9247 | unlike "xterm" or "xterm2". |
Bram Moolenaar | 9b45125 | 2012-08-15 17:43:31 +0200 | [diff] [blame] | 9248 | *sgr-mouse* |
| 9249 | sgr Mouse handling for the terminal that emits SGR-styled |
Bram Moolenaar | e968e36 | 2014-05-13 20:23:24 +0200 | [diff] [blame] | 9250 | mouse reporting. The mouse works even in columns |
| 9251 | beyond 223. This option is backward compatible with |
| 9252 | "xterm2" because it can also decode "xterm2" style |
| 9253 | mouse codes. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9254 | |
| 9255 | The mouse handling must be enabled at compile time |+mouse_xterm| |
Bram Moolenaar | e968e36 | 2014-05-13 20:23:24 +0200 | [diff] [blame] | 9256 | |+mouse_dec| |+mouse_netterm| |+mouse_jsbterm| |+mouse_urxvt| |
| 9257 | |+mouse_sgr|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9258 | Only "xterm"(2) is really recognized. NetTerm mouse codes are always |
| 9259 | recognized, if enabled at compile time. DEC terminal mouse codes |
| 9260 | are recognized if enabled at compile time, and 'ttymouse' is not |
Bram Moolenaar | e968e36 | 2014-05-13 20:23:24 +0200 | [diff] [blame] | 9261 | "xterm", "xterm2", "urxvt" or "sgr" (because dec mouse codes conflict |
| 9262 | with them). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9263 | This option is automatically set to "xterm", when the 'term' option is |
Bram Moolenaar | 4575876 | 2016-10-12 23:08:06 +0200 | [diff] [blame] | 9264 | set to a name that starts with "xterm", "mlterm", "screen", "tmux", |
| 9265 | "st" (full match only), "st-" or "stterm", and 'ttymouse' is not set |
| 9266 | already. |
Bram Moolenaar | 06cd14d | 2023-01-10 12:37:38 +0000 | [diff] [blame] | 9267 | If the terminfo/termcap entry "XM" exists and the first number is |
| 9268 | "1006" then 'ttymouse' will be set to "sgr". This works for many |
| 9269 | modern terminals. |
Bram Moolenaar | e968e36 | 2014-05-13 20:23:24 +0200 | [diff] [blame] | 9270 | Additionally, if vim is compiled with the |+termresponse| feature and |
| 9271 | |t_RV| is set to the escape sequence to request the xterm version |
Bram Moolenaar | f8a0712 | 2019-07-01 22:06:07 +0200 | [diff] [blame] | 9272 | number, more intelligent detection is done. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9273 | The "xterm2" value will be set if the xterm version is reported to be |
Bram Moolenaar | d47d522 | 2018-12-09 20:43:55 +0100 | [diff] [blame] | 9274 | from 95 to 276. The "sgr" value will be set if Vim detects Mac |
| 9275 | Terminal.app, iTerm2 or mintty, and when the xterm version is 277 or |
| 9276 | higher. |
Bram Moolenaar | e968e36 | 2014-05-13 20:23:24 +0200 | [diff] [blame] | 9277 | If you do not want 'ttymouse' to be set to "xterm2" or "sgr" |
| 9278 | automatically, set t_RV to an empty string: > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9279 | :set t_RV= |
| 9280 | < |
| 9281 | *'ttyscroll'* *'tsl'* |
| 9282 | 'ttyscroll' 'tsl' number (default 999) |
| 9283 | global |
| 9284 | Maximum number of lines to scroll the screen. If there are more lines |
| 9285 | to scroll the window is redrawn. For terminals where scrolling is |
| 9286 | very slow and redrawing is not slow this can be set to a small number, |
| 9287 | e.g., 3, to speed up displaying. |
| 9288 | |
| 9289 | *'ttytype'* *'tty'* |
| 9290 | 'ttytype' 'tty' string (default from $TERM) |
| 9291 | global |
| 9292 | Alias for 'term', see above. |
| 9293 | |
Bram Moolenaar | 55debbe | 2010-05-23 23:34:36 +0200 | [diff] [blame] | 9294 | *'undodir'* *'udir'* |
| 9295 | 'undodir' 'udir' string (default ".") |
| 9296 | global |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 9297 | {only when compiled with the |+persistent_undo| feature} |
Bram Moolenaar | 55debbe | 2010-05-23 23:34:36 +0200 | [diff] [blame] | 9298 | List of directory names for undo files, separated with commas. |
Bram Moolenaar | b230bd5 | 2010-05-25 21:02:00 +0200 | [diff] [blame] | 9299 | See |'backupdir'| for details of the format. |
Bram Moolenaar | 6a244fe | 2010-05-24 22:02:24 +0200 | [diff] [blame] | 9300 | "." means using the directory of the file. The undo file name for |
| 9301 | "file.txt" is ".file.txt.un~". |
| 9302 | For other directories the file name is the full path of the edited |
| 9303 | file, with path separators replaced with "%". |
Bram Moolenaar | 55debbe | 2010-05-23 23:34:36 +0200 | [diff] [blame] | 9304 | When writing: The first directory that exists is used. "." always |
| 9305 | works, no directories after "." will be used for writing. |
| 9306 | When reading all entries are tried to find an undo file. The first |
| 9307 | undo file that exists is used. When it cannot be read an error is |
| 9308 | given, no further entry is used. |
| 9309 | See |undo-persistence|. |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 9310 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 9311 | security reasons. |
Bram Moolenaar | 55debbe | 2010-05-23 23:34:36 +0200 | [diff] [blame] | 9312 | |
Bram Moolenaar | 543b7ef | 2013-06-01 14:50:56 +0200 | [diff] [blame] | 9313 | *'undofile'* *'noundofile'* *'udf'* *'noudf'* |
Bram Moolenaar | 55debbe | 2010-05-23 23:34:36 +0200 | [diff] [blame] | 9314 | 'undofile' 'udf' boolean (default off) |
| 9315 | local to buffer |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 9316 | {only when compiled with the |+persistent_undo| feature} |
Bram Moolenaar | 55debbe | 2010-05-23 23:34:36 +0200 | [diff] [blame] | 9317 | When on, Vim automatically saves undo history to an undo file when |
| 9318 | writing a buffer to a file, and restores undo history from the same |
| 9319 | file on buffer read. |
Bram Moolenaar | b230bd5 | 2010-05-25 21:02:00 +0200 | [diff] [blame] | 9320 | The directory where the undo file is stored is specified by 'undodir'. |
| 9321 | For more information about this feature see |undo-persistence|. |
Bram Moolenaar | 59f931e | 2010-07-24 20:27:03 +0200 | [diff] [blame] | 9322 | The undo file is not read when 'undoreload' causes the buffer from |
| 9323 | before a reload to be saved for undo. |
Bram Moolenaar | 97d6249 | 2012-11-15 21:28:22 +0100 | [diff] [blame] | 9324 | When 'undofile' is turned off the undo file is NOT deleted. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 9325 | NOTE: This option is reset when 'compatible' is set. |
Bram Moolenaar | 55debbe | 2010-05-23 23:34:36 +0200 | [diff] [blame] | 9326 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9327 | *'undolevels'* *'ul'* |
Bram Moolenaar | 8024f93 | 2020-01-14 19:29:13 +0100 | [diff] [blame] | 9328 | 'undolevels' 'ul' number (default 100, 1000 for Unix, VMS and Win32) |
Bram Moolenaar | f5a2fd8 | 2013-11-06 05:26:15 +0100 | [diff] [blame] | 9329 | global or local to buffer |global-local| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9330 | Maximum number of changes that can be undone. Since undo information |
Bram Moolenaar | 5be4cee | 2019-09-27 19:34:08 +0200 | [diff] [blame] | 9331 | is kept in memory, higher numbers will cause more memory to be used. |
| 9332 | Nevertheless, a single change can already use a large amount of memory. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9333 | Set to 0 for Vi compatibility: One level of undo and "u" undoes |
| 9334 | itself: > |
| 9335 | set ul=0 |
| 9336 | < But you can also get Vi compatibility by including the 'u' flag in |
| 9337 | 'cpoptions', and still be able to use CTRL-R to repeat undo. |
Bram Moolenaar | 945e2db | 2010-06-05 17:43:32 +0200 | [diff] [blame] | 9338 | Also see |undo-two-ways|. |
Bram Moolenaar | f5a2fd8 | 2013-11-06 05:26:15 +0100 | [diff] [blame] | 9339 | Set to -1 for no undo at all. You might want to do this only for the |
| 9340 | current buffer: > |
| 9341 | setlocal ul=-1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9342 | < This helps when you run out of memory for a single change. |
Bram Moolenaar | 32efaf6 | 2014-11-05 17:02:17 +0100 | [diff] [blame] | 9343 | |
| 9344 | The local value is set to -123456 when the global value is to be used. |
| 9345 | |
Bram Moolenaar | 945e2db | 2010-06-05 17:43:32 +0200 | [diff] [blame] | 9346 | Also see |clear-undo|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9347 | |
Bram Moolenaar | 59f931e | 2010-07-24 20:27:03 +0200 | [diff] [blame] | 9348 | *'undoreload'* *'ur'* |
| 9349 | 'undoreload' 'ur' number (default 10000) |
| 9350 | global |
Bram Moolenaar | 59f931e | 2010-07-24 20:27:03 +0200 | [diff] [blame] | 9351 | Save the whole buffer for undo when reloading it. This applies to the |
| 9352 | ":e!" command and reloading for when the buffer changed outside of |
| 9353 | Vim. |FileChangedShell| |
Bram Moolenaar | 24a98a0 | 2017-09-27 22:23:55 +0200 | [diff] [blame] | 9354 | The save only happens when this option is negative or when the number |
Bram Moolenaar | 59f931e | 2010-07-24 20:27:03 +0200 | [diff] [blame] | 9355 | of lines is smaller than the value of this option. |
| 9356 | Set this option to zero to disable undo for a reload. |
| 9357 | |
| 9358 | When saving undo for a reload, any undo file is not read. |
| 9359 | |
| 9360 | Note that this causes the whole buffer to be stored in memory. Set |
| 9361 | this option to a lower value if you run out of memory. |
| 9362 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9363 | *'updatecount'* *'uc'* |
| 9364 | 'updatecount' 'uc' number (default: 200) |
| 9365 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9366 | After typing this many characters the swap file will be written to |
| 9367 | disk. When zero, no swap file will be created at all (see chapter on |
| 9368 | recovery |crash-recovery|). 'updatecount' is set to zero by starting |
| 9369 | Vim with the "-n" option, see |startup|. When editing in readonly |
| 9370 | mode this option will be initialized to 10000. |
| 9371 | The swapfile can be disabled per buffer with |'swapfile'|. |
| 9372 | When 'updatecount' is set from zero to non-zero, swap files are |
| 9373 | created for all buffers that have 'swapfile' set. When 'updatecount' |
| 9374 | is set to zero, existing swap files are not deleted. |
| 9375 | Also see |'swapsync'|. |
| 9376 | This option has no meaning in buffers where |'buftype'| is "nofile" |
| 9377 | or "nowrite". |
| 9378 | |
| 9379 | *'updatetime'* *'ut'* |
| 9380 | 'updatetime' 'ut' number (default 4000) |
| 9381 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9382 | If this many milliseconds nothing is typed the swap file will be |
| 9383 | written to disk (see |crash-recovery|). Also used for the |
| 9384 | |CursorHold| autocommand event. |
| 9385 | |
Bram Moolenaar | 04958cb | 2018-06-23 19:23:02 +0200 | [diff] [blame] | 9386 | *'varsofttabstop'* *'vsts'* |
| 9387 | 'varsofttabstop' 'vsts' string (default "") |
| 9388 | local to buffer |
| 9389 | {only available when compiled with the |+vartabs| |
| 9390 | feature} |
Damien Lejay | 91af4c4 | 2025-06-12 21:56:19 +0200 | [diff] [blame] | 9391 | Defines variable-width soft tab stops. The value is a comma-separated |
| 9392 | list of widths in columns. Each width defines the number of columns |
| 9393 | before the next soft tab stop. The last value repeats indefinitely. |
Bram Moolenaar | 04958cb | 2018-06-23 19:23:02 +0200 | [diff] [blame] | 9394 | |
| 9395 | For example, when editing assembly language files where statements |
Bram Moolenaar | 6dc819b | 2018-07-03 16:42:19 +0200 | [diff] [blame] | 9396 | start in the 9th column and comments in the 41st, it may be useful |
Bram Moolenaar | 04958cb | 2018-06-23 19:23:02 +0200 | [diff] [blame] | 9397 | to use the following: > |
| 9398 | :set varsofttabstop=8,32,8 |
Damien Lejay | 91af4c4 | 2025-06-12 21:56:19 +0200 | [diff] [blame] | 9399 | < This sets soft tab stops at column 8, then at column 40 (8 + 32), and |
| 9400 | every 8 columns thereafter. |
Bram Moolenaar | 04958cb | 2018-06-23 19:23:02 +0200 | [diff] [blame] | 9401 | |
Damien Lejay | 91af4c4 | 2025-06-12 21:56:19 +0200 | [diff] [blame] | 9402 | Note: this setting overrides 'softtabstop'. |
| 9403 | See section |30.5| of the user manual for detailed explanations on how |
| 9404 | Vim works with tabs and spaces. |
Bram Moolenaar | 04958cb | 2018-06-23 19:23:02 +0200 | [diff] [blame] | 9405 | |
| 9406 | *'vartabstop'* *'vts'* |
| 9407 | 'vartabstop' 'vts' string (default "") |
| 9408 | local to buffer |
| 9409 | {only available when compiled with the |+vartabs| |
| 9410 | feature} |
Damien Lejay | 91af4c4 | 2025-06-12 21:56:19 +0200 | [diff] [blame] | 9411 | Defines variable-width tab stops. The value is a comma-separated list |
| 9412 | of widths in columns. Each width defines the number of columns |
| 9413 | before the next tab stop; the last value repeats indefinitely. |
Bram Moolenaar | 04958cb | 2018-06-23 19:23:02 +0200 | [diff] [blame] | 9414 | |
Damien Lejay | 91af4c4 | 2025-06-12 21:56:19 +0200 | [diff] [blame] | 9415 | For example: > |
| 9416 | :set vartabstop=4,8 |
| 9417 | < This places the first tab stop 4 columns from the start of the line |
| 9418 | and each subsequent tab stop 8 columns apart. |
| 9419 | |
| 9420 | Note: this setting overrides 'tabstop'. |
| 9421 | On UNIX, it is recommended to keep the default tabstop value of 8. |
| 9422 | Consider setting 'varsofttabstop' instead. |
| 9423 | See section |30.5| of the user manual for detailed explanations on how |
| 9424 | Vim works with tabs and spaces. |
Bram Moolenaar | 04958cb | 2018-06-23 19:23:02 +0200 | [diff] [blame] | 9425 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9426 | *'verbose'* *'vbs'* |
| 9427 | 'verbose' 'vbs' number (default 0) |
| 9428 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9429 | When bigger than zero, Vim will give messages about what it is doing. |
| 9430 | Currently, these messages are given: |
| 9431 | >= 1 When the viminfo file is read or written. |
| 9432 | >= 2 When a file is ":source"'ed. |
Bram Moolenaar | 647a530 | 2020-05-03 17:01:24 +0200 | [diff] [blame] | 9433 | >= 4 Shell commands. |
Bram Moolenaar | 87b5ca5 | 2006-03-04 21:55:31 +0000 | [diff] [blame] | 9434 | >= 5 Every searched tags file and include file. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9435 | >= 8 Files for which a group of autocommands is executed. |
| 9436 | >= 9 Every executed autocommand. |
Bram Moolenaar | 647a530 | 2020-05-03 17:01:24 +0200 | [diff] [blame] | 9437 | >= 11 Finding items in a path |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9438 | >= 12 Every executed function. |
| 9439 | >= 13 When an exception is thrown, caught, finished, or discarded. |
| 9440 | >= 14 Anything pending in a ":finally" clause. |
Bram Moolenaar | 823654b | 2020-05-29 23:03:09 +0200 | [diff] [blame] | 9441 | >= 15 Every executed Ex command from a script (truncated at 200 |
| 9442 | characters). |
Bram Moolenaar | e7b1ea0 | 2020-08-07 19:54:59 +0200 | [diff] [blame] | 9443 | >= 16 Every executed Ex command. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9444 | |
| 9445 | This option can also be set with the "-V" argument. See |-V|. |
| 9446 | This option is also set by the |:verbose| command. |
| 9447 | |
Bram Moolenaar | 5c06f8b | 2005-05-31 22:14:58 +0000 | [diff] [blame] | 9448 | When the 'verbosefile' option is set then the verbose messages are not |
| 9449 | displayed. |
| 9450 | |
| 9451 | *'verbosefile'* *'vfile'* |
| 9452 | 'verbosefile' 'vfile' string (default empty) |
| 9453 | global |
Bram Moolenaar | 5c06f8b | 2005-05-31 22:14:58 +0000 | [diff] [blame] | 9454 | When not empty all messages are written in a file with this name. |
| 9455 | When the file exists messages are appended. |
| 9456 | Writing to the file ends when Vim exits or when 'verbosefile' is made |
Bram Moolenaar | 80794b1 | 2010-06-13 05:20:42 +0200 | [diff] [blame] | 9457 | empty. Writes are buffered, thus may not show up for some time. |
Bram Moolenaar | 5c06f8b | 2005-05-31 22:14:58 +0000 | [diff] [blame] | 9458 | Setting 'verbosefile' to a new value is like making it empty first. |
| 9459 | The difference with |:redir| is that verbose messages are not |
| 9460 | displayed when 'verbosefile' is set. |
dkearns | 8ebdbc9 | 2023-10-29 06:26:19 +1100 | [diff] [blame] | 9461 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 9462 | security reasons. |
Bram Moolenaar | 5c06f8b | 2005-05-31 22:14:58 +0000 | [diff] [blame] | 9463 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9464 | *'viewdir'* *'vdir'* |
h_east | 5985879 | 2023-10-25 22:47:05 +0900 | [diff] [blame] | 9465 | 'viewdir' 'vdir' string (default for Amiga: "home:vimfiles/view", |
Bram Moolenaar | 801961d | 2023-06-23 16:15:13 +0100 | [diff] [blame] | 9466 | for Win32: "$HOME/vimfiles/view", |
Christian Brabandt | c3e6e39 | 2024-05-04 09:48:15 +0200 | [diff] [blame] | 9467 | for Unix: "$HOME/.vim/view" or |
| 9468 | "$XDG_CONFIG_HOME/vim/view" |
Bram Moolenaar | 801961d | 2023-06-23 16:15:13 +0100 | [diff] [blame] | 9469 | for VMS: "sys$login:vimfiles/view") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9470 | global |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 9471 | {not available when compiled without the |+mksession| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9472 | feature} |
| 9473 | Name of the directory where to store files for |:mkview|. |
Christian Brabandt | c3e6e39 | 2024-05-04 09:48:15 +0200 | [diff] [blame] | 9474 | For $XDG_CONFIG_HOME see |xdg-base-dir|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9475 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 9476 | security reasons. |
| 9477 | |
| 9478 | *'viewoptions'* *'vop'* |
Bram Moolenaar | 13e9041 | 2017-11-11 18:16:48 +0100 | [diff] [blame] | 9479 | 'viewoptions' 'vop' string (default: "folds,options,cursor,curdir") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9480 | global |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 9481 | {not available when compiled without the |+mksession| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9482 | feature} |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 9483 | Changes the effect of the |:mkview| command. It is a comma-separated |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 9484 | list of words. Each word enables saving and restoring something: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9485 | word save and restore ~ |
| 9486 | cursor cursor position in file and in window |
| 9487 | folds manually created folds, opened/closed folds and local |
| 9488 | fold options |
| 9489 | options options and mappings local to a window or buffer (not |
| 9490 | global values for local options) |
Bram Moolenaar | 6e93246 | 2014-09-09 18:48:09 +0200 | [diff] [blame] | 9491 | localoptions same as "options" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9492 | slash backslashes in file names replaced with forward |
| 9493 | slashes |
| 9494 | unix with Unix end-of-line format (single <NL>), even when |
Bram Moolenaar | 6f345a1 | 2019-12-17 21:27:18 +0100 | [diff] [blame] | 9495 | on MS-Windows |
Bram Moolenaar | 13e9041 | 2017-11-11 18:16:48 +0100 | [diff] [blame] | 9496 | curdir the window-local directory, if set with `:lcd` |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9497 | |
Bram Moolenaar | 6f345a1 | 2019-12-17 21:27:18 +0100 | [diff] [blame] | 9498 | "slash" and "unix" are useful on MS-Windows when sharing view files |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9499 | with Unix. The Unix version of Vim cannot source dos format scripts, |
Bram Moolenaar | 6f345a1 | 2019-12-17 21:27:18 +0100 | [diff] [blame] | 9500 | but the MS-Windows version of Vim can source unix format scripts. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9501 | |
| 9502 | *'viminfo'* *'vi'* *E526* *E527* *E528* |
Bram Moolenaar | 6f345a1 | 2019-12-17 21:27:18 +0100 | [diff] [blame] | 9503 | 'viminfo' 'vi' string (Vi default: "", Vim default for |
| 9504 | MS-Windows: '100,<50,s10,h,rA:,rB:, |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 9505 | for Amiga: '100,<50,s10,h,rdf0:,rdf1:,rdf2: |
| 9506 | for others: '100,<50,s10,h) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9507 | global |
Bram Moolenaar | db84e45 | 2010-08-15 13:50:43 +0200 | [diff] [blame] | 9508 | {not available when compiled without the |+viminfo| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9509 | feature} |
| 9510 | When non-empty, the viminfo file is read upon startup and written |
Bram Moolenaar | c4da113 | 2017-07-15 19:39:43 +0200 | [diff] [blame] | 9511 | when exiting Vim (see |viminfo-file|). Except when 'viminfofile' is |
| 9512 | "NONE". |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 9513 | The string should be a comma-separated list of parameters, each |
Bram Moolenaar | c4da113 | 2017-07-15 19:39:43 +0200 | [diff] [blame] | 9514 | consisting of a single character identifying the particular parameter, |
| 9515 | followed by a number or string which specifies the value of that |
| 9516 | parameter. If a particular character is left out, then the default |
| 9517 | value is used for that parameter. The following is a list of the |
| 9518 | identifying characters and the effect of their value. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9519 | CHAR VALUE ~ |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9520 | *viminfo-!* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9521 | ! When included, save and restore global variables that start |
| 9522 | with an uppercase letter, and don't contain a lowercase |
| 9523 | letter. Thus "KEEPTHIS and "K_L_M" are stored, but "KeepThis" |
Bram Moolenaar | 680eeca | 2010-10-20 17:44:42 +0200 | [diff] [blame] | 9524 | and "_K_L_M" are not. Nested List and Dict items may not be |
Bram Moolenaar | 166af9b | 2010-11-16 20:34:40 +0100 | [diff] [blame] | 9525 | read back correctly, you end up with an empty item. |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9526 | *viminfo-quote* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9527 | " Maximum number of lines saved for each register. Old name of |
| 9528 | the '<' item, with the disadvantage that you need to put a |
| 9529 | backslash before the ", otherwise it will be recognized as the |
| 9530 | start of a comment! |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9531 | *viminfo-%* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9532 | % When included, save and restore the buffer list. If Vim is |
| 9533 | started with a file name argument, the buffer list is not |
| 9534 | restored. If Vim is started without a file name argument, the |
Bram Moolenaar | d042dc8 | 2015-11-24 19:18:36 +0100 | [diff] [blame] | 9535 | buffer list is restored from the viminfo file. Quickfix |
| 9536 | ('buftype'), unlisted ('buflisted'), unnamed and buffers on |
| 9537 | removable media (|viminfo-r|) are not saved. |
Bram Moolenaar | 15d0a8c | 2004-09-06 17:44:46 +0000 | [diff] [blame] | 9538 | When followed by a number, the number specifies the maximum |
| 9539 | number of buffers that are stored. Without a number all |
| 9540 | buffers are stored. |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9541 | *viminfo-'* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9542 | ' Maximum number of previously edited files for which the marks |
| 9543 | are remembered. This parameter must always be included when |
| 9544 | 'viminfo' is non-empty. |
| 9545 | Including this item also means that the |jumplist| and the |
| 9546 | |changelist| are stored in the viminfo file. |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9547 | *viminfo-/* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9548 | / Maximum number of items in the search pattern history to be |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 9549 | saved. If non-zero, then the previous search and substitute |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9550 | patterns are also saved. When not included, the value of |
| 9551 | 'history' is used. |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9552 | *viminfo-:* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9553 | : Maximum number of items in the command-line history to be |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 9554 | saved. When not included, the value of 'history' is used. |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9555 | *viminfo-<* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9556 | < Maximum number of lines saved for each register. If zero then |
| 9557 | registers are not saved. When not included, all lines are |
| 9558 | saved. '"' is the old name for this item. |
| 9559 | Also see the 's' item below: limit specified in Kbyte. |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9560 | *viminfo-@* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9561 | @ Maximum number of items in the input-line history to be |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 9562 | saved. When not included, the value of 'history' is used. |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9563 | *viminfo-c* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9564 | c When included, convert the text in the viminfo file from the |
| 9565 | 'encoding' used when writing the file to the current |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 9566 | 'encoding'. See |viminfo-encoding|. |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9567 | *viminfo-f* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9568 | f Whether file marks need to be stored. If zero, file marks ('0 |
| 9569 | to '9, 'A to 'Z) are not stored. When not present or when |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 9570 | non-zero, they are all stored. '0 is used for the current |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9571 | cursor position (when exiting or when doing ":wviminfo"). |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9572 | *viminfo-h* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9573 | h Disable the effect of 'hlsearch' when loading the viminfo |
| 9574 | file. When not included, it depends on whether ":nohlsearch" |
| 9575 | has been used since the last search command. |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9576 | *viminfo-n* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9577 | n Name of the viminfo file. The name must immediately follow |
Bram Moolenaar | c4da113 | 2017-07-15 19:39:43 +0200 | [diff] [blame] | 9578 | the 'n'. Must be at the end of the option! If the |
| 9579 | 'viminfofile' option is set, that file name overrides the one |
| 9580 | given here with 'viminfo'. Environment variables are |
Bram Moolenaar | 063b9d1 | 2016-07-09 20:21:48 +0200 | [diff] [blame] | 9581 | expanded when opening the file, not when setting the option. |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9582 | *viminfo-r* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9583 | r Removable media. The argument is a string (up to the next |
| 9584 | ','). This parameter can be given several times. Each |
| 9585 | specifies the start of a path for which no marks will be |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 9586 | stored. This is to avoid removable media. For MS-Windows you |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9587 | could use "ra:,rb:", for Amiga "rdf0:,rdf1:,rdf2:". You can |
| 9588 | also use it for temp files, e.g., for Unix: "r/tmp". Case is |
| 9589 | ignored. Maximum length of each 'r' argument is 50 |
| 9590 | characters. |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 9591 | *viminfo-s* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9592 | s Maximum size of an item in Kbyte. If zero then registers are |
| 9593 | not saved. Currently only applies to registers. The default |
| 9594 | "s10" will exclude registers with more than 10 Kbyte of text. |
| 9595 | Also see the '<' item above: line count limit. |
| 9596 | |
| 9597 | Example: > |
| 9598 | :set viminfo='50,<1000,s100,:0,n~/vim/viminfo |
| 9599 | < |
| 9600 | '50 Marks will be remembered for the last 50 files you |
| 9601 | edited. |
| 9602 | <1000 Contents of registers (up to 1000 lines each) will be |
| 9603 | remembered. |
| 9604 | s100 Registers with more than 100 Kbyte text are skipped. |
| 9605 | :0 Command-line history will not be saved. |
| 9606 | n~/vim/viminfo The name of the file to use is "~/vim/viminfo". |
| 9607 | no / Since '/' is not specified, the default will be used, |
| 9608 | that is, save all of the search history, and also the |
| 9609 | previous search and substitute patterns. |
| 9610 | no % The buffer list will not be saved nor read back. |
| 9611 | no h 'hlsearch' highlighting will be restored. |
| 9612 | |
| 9613 | When setting 'viminfo' from an empty value you can use |:rviminfo| to |
| 9614 | load the contents of the file, this is not done automatically. |
| 9615 | |
| 9616 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 9617 | security reasons. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 9618 | NOTE: This option is set to the Vim default value when 'compatible' |
| 9619 | is reset. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9620 | |
Bram Moolenaar | c4da113 | 2017-07-15 19:39:43 +0200 | [diff] [blame] | 9621 | *'viminfofile'* *'vif'* |
| 9622 | 'viminfofile' 'vif' string (default: "") |
| 9623 | global |
Bram Moolenaar | c4da113 | 2017-07-15 19:39:43 +0200 | [diff] [blame] | 9624 | {not available when compiled without the |+viminfo| |
| 9625 | feature} |
| 9626 | When non-empty, overrides the file name used for viminfo. |
| 9627 | When equal to "NONE" no viminfo file will be read or written. |
| 9628 | This option can be set with the |-i| command line flag. The |--clean| |
| 9629 | command line flag sets it to "NONE". |
Bram Moolenaar | 110289e | 2019-05-23 15:38:06 +0200 | [diff] [blame] | 9630 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 9631 | security reasons. |
Bram Moolenaar | c4da113 | 2017-07-15 19:39:43 +0200 | [diff] [blame] | 9632 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9633 | *'virtualedit'* *'ve'* |
| 9634 | 'virtualedit' 've' string (default "") |
Gary Johnson | 51ad850 | 2021-08-03 18:33:08 +0200 | [diff] [blame] | 9635 | global or local to window |global-local| |
Bram Moolenaar | cbaff5e | 2022-04-08 17:45:08 +0100 | [diff] [blame] | 9636 | A comma-separated list of these words: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9637 | block Allow virtual editing in Visual block mode. |
| 9638 | insert Allow virtual editing in Insert mode. |
| 9639 | all Allow virtual editing in all modes. |
Bram Moolenaar | efd2bf1 | 2006-03-16 21:41:35 +0000 | [diff] [blame] | 9640 | onemore Allow the cursor to move just past the end of the line |
Gary Johnson | 53ba05b | 2021-07-26 22:19:10 +0200 | [diff] [blame] | 9641 | none When used as the local value, do not allow virtual |
| 9642 | editing even when the global value is set. When used |
| 9643 | as the global value, "none" is the same as "". |
| 9644 | NONE Alternative spelling of "none". |
Bram Moolenaar | 97b2ad3 | 2006-03-18 21:40:56 +0000 | [diff] [blame] | 9645 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9646 | Virtual editing means that the cursor can be positioned where there is |
Bram Moolenaar | ebcbd02 | 2007-05-12 14:28:25 +0000 | [diff] [blame] | 9647 | no actual character. This can be halfway into a tab or beyond the end |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9648 | of the line. Useful for selecting a rectangle in Visual mode and |
| 9649 | editing a table. |
Bram Moolenaar | efd2bf1 | 2006-03-16 21:41:35 +0000 | [diff] [blame] | 9650 | "onemore" is not the same, it will only allow moving the cursor just |
| 9651 | after the last character of the line. This makes some commands more |
| 9652 | consistent. Previously the cursor was always past the end of the line |
| 9653 | if the line was empty. But it is far from Vi compatible. It may also |
Bram Moolenaar | 97b2ad3 | 2006-03-18 21:40:56 +0000 | [diff] [blame] | 9654 | break some plugins or Vim scripts. For example because |l| can move |
| 9655 | the cursor after the last character. Use with care! |
Bram Moolenaar | 9ba7e17 | 2013-07-17 22:37:26 +0200 | [diff] [blame] | 9656 | Using the `$` command will move to the last character in the line, not |
Bram Moolenaar | 97b2ad3 | 2006-03-18 21:40:56 +0000 | [diff] [blame] | 9657 | past it. This may actually move the cursor to the left! |
Bram Moolenaar | 9ba7e17 | 2013-07-17 22:37:26 +0200 | [diff] [blame] | 9658 | The `g$` command will move to the end of the screen line. |
Bram Moolenaar | efd2bf1 | 2006-03-16 21:41:35 +0000 | [diff] [blame] | 9659 | It doesn't make sense to combine "all" with "onemore", but you will |
| 9660 | not get a warning for it. |
Bram Moolenaar | 53f7fcc | 2021-07-28 20:10:16 +0200 | [diff] [blame] | 9661 | When combined with other words, "none" is ignored. |
Bram Moolenaar | 036986f | 2017-03-16 17:41:02 +0100 | [diff] [blame] | 9662 | NOTE: This option is set to "" when 'compatible' is set. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9663 | |
| 9664 | *'visualbell'* *'vb'* *'novisualbell'* *'novb'* *beep* |
| 9665 | 'visualbell' 'vb' boolean (default off) |
| 9666 | global |
Bram Moolenaar | 74675a6 | 2017-07-15 13:53:23 +0200 | [diff] [blame] | 9667 | Use a visual bell instead of beeping. The terminal code to display the |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9668 | visual bell is given with 't_vb'. When no beep or flash is wanted, |
Bram Moolenaar | 74675a6 | 2017-07-15 13:53:23 +0200 | [diff] [blame] | 9669 | use: > |
| 9670 | :set vb t_vb= |
| 9671 | < If you want a short flash, you can use this on many terminals: > |
| 9672 | :set vb t_vb=[?5h$<100>[?5l |
| 9673 | < Here $<100> specifies the time, you can use a smaller or bigger value |
| 9674 | to get a shorter or longer flash. |
| 9675 | |
| 9676 | Note: Vim will limit the bell to once per half a second. This avoids |
| 9677 | having to wait for the flashing to finish when there are lots of |
| 9678 | bells, e.g. on key repeat. This also happens without 'visualbell' |
| 9679 | set. |
| 9680 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9681 | In the GUI, 't_vb' defaults to "<Esc>|f", which inverts the display |
| 9682 | for 20 msec. If you want to use a different time, use "<Esc>|40f", |
| 9683 | where 40 is the time in msec. |
Bram Moolenaar | 74675a6 | 2017-07-15 13:53:23 +0200 | [diff] [blame] | 9684 | |
| 9685 | Note: When the GUI starts, 't_vb' is reset to its default value. You |
| 9686 | might want to set it again in your |gvimrc|. |
| 9687 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9688 | Does not work on the Amiga, you always get a screen flash. |
| 9689 | Also see 'errorbells'. |
| 9690 | |
| 9691 | *'warn'* *'nowarn'* |
| 9692 | 'warn' boolean (default on) |
| 9693 | global |
| 9694 | Give a warning message when a shell command is used while the buffer |
| 9695 | has been changed. |
| 9696 | |
| 9697 | *'weirdinvert'* *'wiv'* *'noweirdinvert'* *'nowiv'* |
| 9698 | 'weirdinvert' 'wiv' boolean (default off) |
| 9699 | global |
Bram Moolenaar | 1d2ba7f | 2006-02-14 22:29:30 +0000 | [diff] [blame] | 9700 | This option has the same effect as the 't_xs' terminal option. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9701 | It is provided for backwards compatibility with version 4.x. |
| 9702 | Setting 'weirdinvert' has the effect of making 't_xs' non-empty, and |
| 9703 | vice versa. Has no effect when the GUI is running. |
| 9704 | |
| 9705 | *'whichwrap'* *'ww'* |
| 9706 | 'whichwrap' 'ww' string (Vim default: "b,s", Vi default: "") |
| 9707 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9708 | Allow specified keys that move the cursor left/right to move to the |
| 9709 | previous/next line when the cursor is on the first/last character in |
| 9710 | the line. Concatenate characters to allow this for these keys: |
| 9711 | char key mode ~ |
| 9712 | b <BS> Normal and Visual |
| 9713 | s <Space> Normal and Visual |
Bram Moolenaar | 87b5ca5 | 2006-03-04 21:55:31 +0000 | [diff] [blame] | 9714 | h "h" Normal and Visual (not recommended) |
| 9715 | l "l" Normal and Visual (not recommended) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9716 | < <Left> Normal and Visual |
| 9717 | > <Right> Normal and Visual |
| 9718 | ~ "~" Normal |
| 9719 | [ <Left> Insert and Replace |
| 9720 | ] <Right> Insert and Replace |
| 9721 | For example: > |
| 9722 | :set ww=<,>,[,] |
| 9723 | < allows wrap only when cursor keys are used. |
| 9724 | When the movement keys are used in combination with a delete or change |
| 9725 | operator, the <EOL> also counts for a character. This makes "3h" |
| 9726 | different from "3dh" when the cursor crosses the end of a line. This |
| 9727 | is also true for "x" and "X", because they do the same as "dl" and |
| 9728 | "dh". If you use this, you may also want to use the mapping |
| 9729 | ":map <BS> X" to make backspace delete the character in front of the |
| 9730 | cursor. |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 9731 | When 'l' is included and it is used after an operator at the end of a |
Bram Moolenaar | 589edb3 | 2019-09-20 14:38:13 +0200 | [diff] [blame] | 9732 | line (not an empty line) then it will not move to the next line. This |
| 9733 | makes "dl", "cl", "yl" etc. work normally. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9734 | NOTE: This option is set to the Vi default value when 'compatible' is |
| 9735 | set and to the Vim default value when 'compatible' is reset. |
| 9736 | |
| 9737 | *'wildchar'* *'wc'* |
| 9738 | 'wildchar' 'wc' number (Vim default: <Tab>, Vi default: CTRL-E) |
| 9739 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9740 | Character you have to type to start wildcard expansion in the |
| 9741 | command-line, as specified with 'wildmode'. |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 9742 | More info here: |cmdline-completion|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9743 | The character is not recognized when used inside a macro. See |
| 9744 | 'wildcharm' for that. |
Bram Moolenaar | 34cc7d8 | 2021-09-21 20:09:51 +0200 | [diff] [blame] | 9745 | Some keys will not work, such as CTRL-C, <CR> and Enter. |
Yee Cheng Chin | 8f4fb00 | 2023-10-17 10:06:56 +0200 | [diff] [blame] | 9746 | <Esc> can be used, but hitting it twice in a row will still exit |
| 9747 | command-line as a failsafe measure. |
Milly | a9c6f90 | 2024-10-06 16:47:02 +0200 | [diff] [blame] | 9748 | Although 'wc' is a number option, it can be specified as a number, a |
| 9749 | single character, a |key-notation| (e.g. <Up>, <C-F>) or a letter |
| 9750 | preceded with a caret (e.g. `^F` is CTRL-F): > |
| 9751 | :set wc=27 |
| 9752 | :set wc=X |
| 9753 | :set wc=^I |
Bram Moolenaar | 34cc7d8 | 2021-09-21 20:09:51 +0200 | [diff] [blame] | 9754 | :set wc=<Tab> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9755 | < NOTE: This option is set to the Vi default value when 'compatible' is |
| 9756 | set and to the Vim default value when 'compatible' is reset. |
| 9757 | |
| 9758 | *'wildcharm'* *'wcm'* |
| 9759 | 'wildcharm' 'wcm' number (default: none (0)) |
| 9760 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9761 | 'wildcharm' works exactly like 'wildchar', except that it is |
Bram Moolenaar | 582fd85 | 2005-03-28 20:58:01 +0000 | [diff] [blame] | 9762 | recognized when used inside a macro. You can find "spare" command-line |
| 9763 | keys suitable for this option by looking at |ex-edit-index|. Normally |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9764 | you'll never actually type 'wildcharm', just use it in mappings that |
| 9765 | automatically invoke completion mode, e.g.: > |
| 9766 | :set wcm=<C-Z> |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 9767 | :cnoremap ss so $vim/sessions/*.vim<C-Z> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9768 | < Then after typing :ss you can use CTRL-P & CTRL-N. |
| 9769 | |
| 9770 | *'wildignore'* *'wig'* |
| 9771 | 'wildignore' 'wig' string (default "") |
| 9772 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9773 | A list of file patterns. A file that matches with one of these |
Bram Moolenaar | 30b6581 | 2012-07-12 22:01:11 +0200 | [diff] [blame] | 9774 | patterns is ignored when expanding |wildcards|, completing file or |
| 9775 | directory names, and influences the result of |expand()|, |glob()| and |
| 9776 | |globpath()| unless a flag is passed to disable this. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9777 | The pattern is used like with |:autocmd|, see |autocmd-patterns|. |
| 9778 | Also see 'suffixes'. |
| 9779 | Example: > |
| 9780 | :set wildignore=*.o,*.obj |
| 9781 | < The use of |:set+=| and |:set-=| is preferred when adding or removing |
| 9782 | a pattern from the list. This avoids problems when a future version |
| 9783 | uses another default. |
| 9784 | |
h_east | 596a9f2 | 2023-11-21 21:24:23 +0900 | [diff] [blame] | 9785 | *'wildignorecase'* *'wic'* *'nowildignorecase'* *'nowic'* |
Bram Moolenaar | 94950a9 | 2010-12-02 16:01:29 +0100 | [diff] [blame] | 9786 | 'wildignorecase' 'wic' boolean (default off) |
| 9787 | global |
Bram Moolenaar | 94950a9 | 2010-12-02 16:01:29 +0100 | [diff] [blame] | 9788 | When set case is ignored when completing file names and directories. |
Bram Moolenaar | 71afbfe | 2013-03-19 16:49:16 +0100 | [diff] [blame] | 9789 | Has no effect when 'fileignorecase' is set. |
Bram Moolenaar | 94950a9 | 2010-12-02 16:01:29 +0100 | [diff] [blame] | 9790 | Does not apply when the shell is used to expand wildcards, which |
| 9791 | happens when there are special characters. |
| 9792 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9793 | *'wildmenu'* *'wmnu'* *'nowildmenu'* *'nowmnu'* |
Luca Saccarola | 437bc13 | 2024-11-14 21:21:17 +0100 | [diff] [blame] | 9794 | 'wildmenu' 'wmnu' boolean (default on) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9795 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9796 | When 'wildmenu' is on, command-line completion operates in an enhanced |
| 9797 | mode. On pressing 'wildchar' (usually <Tab>) to invoke completion, |
Bram Moolenaar | 5416232 | 2022-08-26 16:58:51 +0100 | [diff] [blame] | 9798 | the possible matches are shown. |
| 9799 | When 'wildoptions' contains "pum", then the completion matches are |
| 9800 | shown in a popup menu. Otherwise they are displayed just above the |
| 9801 | command line, with the first match highlighted (overwriting the status |
| 9802 | line, if there is one). |
Yegappan Lakshmanan | 3908ef5 | 2022-02-08 12:08:07 +0000 | [diff] [blame] | 9803 | Keys that show the previous/next match, such as <Tab> or |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9804 | CTRL-P/CTRL-N, cause the highlight to move to the appropriate match. |
| 9805 | When 'wildmode' is used, "wildmenu" mode is used where "full" is |
| 9806 | specified. "longest" and "list" do not start "wildmenu" mode. |
Bram Moolenaar | 26402cb | 2013-02-20 21:26:00 +0100 | [diff] [blame] | 9807 | You can check the current mode with |wildmenumode()|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9808 | If there are more matches than can fit in the line, a ">" is shown on |
| 9809 | the right and/or a "<" is shown on the left. The status line scrolls |
| 9810 | as needed. |
| 9811 | The "wildmenu" mode is abandoned when a key is hit that is not used |
| 9812 | for selecting a completion. |
Yee Cheng Chin | 2bbd0d3 | 2023-10-14 02:23:45 -0700 | [diff] [blame] | 9813 | While the "wildmenu" is active, the following keys have special |
| 9814 | meanings: |
| 9815 | CTRL-P - go to the previous entry |
| 9816 | CTRL-N - go to the next entry |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9817 | <CR> - in menu completion, when the cursor is just after a |
| 9818 | dot: move into a submenu. |
Yee Cheng Chin | 209ec90 | 2023-10-17 10:56:25 +0200 | [diff] [blame] | 9819 | CTRL-E - end completion, go back to what was there before |
| 9820 | selecting a match. |
| 9821 | CTRL-Y - accept the currently selected match and stop |
| 9822 | completion. |
Yee Cheng Chin | 2bbd0d3 | 2023-10-14 02:23:45 -0700 | [diff] [blame] | 9823 | |
| 9824 | When not using the popup menu for command line completion, the |
| 9825 | following keys have special meanings: |
| 9826 | <Left> <Right> - select previous/next match (like CTRL-P/CTRL-N) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9827 | <Up> - in filename/menu name completion: move up into |
| 9828 | parent directory or parent menu. |
Yee Cheng Chin | 2bbd0d3 | 2023-10-14 02:23:45 -0700 | [diff] [blame] | 9829 | <Down> - in filename/menu name completion: move into a |
| 9830 | subdirectory or submenu. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9831 | |
Yegappan Lakshmanan | 3908ef5 | 2022-02-08 12:08:07 +0000 | [diff] [blame] | 9832 | When using the popup menu for command line completion, the following |
| 9833 | keys have special meanings: |
Yee Cheng Chin | 2bbd0d3 | 2023-10-14 02:23:45 -0700 | [diff] [blame] | 9834 | <Up> <Down> - select previous/next match (like CTRL-P/CTRL-N) |
zeertzjq | 3c81f47 | 2023-10-15 16:02:08 +0800 | [diff] [blame] | 9835 | <PageUp> - select a match several entries back |
| 9836 | <PageDown> - select a match several entries further |
Yegappan Lakshmanan | 3908ef5 | 2022-02-08 12:08:07 +0000 | [diff] [blame] | 9837 | <Left> - in filename/menu name completion: move up into |
| 9838 | parent directory or parent menu. |
| 9839 | <Right> - in filename/menu name completion: move into a |
| 9840 | subdirectory or submenu. |
Yegappan Lakshmanan | 3908ef5 | 2022-02-08 12:08:07 +0000 | [diff] [blame] | 9841 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9842 | This makes the menus accessible from the console |console-menus|. |
| 9843 | |
| 9844 | If you prefer the <Left> and <Right> keys to move the cursor instead |
| 9845 | of selecting a different match, use this: > |
| 9846 | :cnoremap <Left> <Space><BS><Left> |
| 9847 | :cnoremap <Right> <Space><BS><Right> |
| 9848 | < |
| 9849 | The "WildMenu" highlighting is used for displaying the current match |
| 9850 | |hl-WildMenu|. |
| 9851 | |
| 9852 | *'wildmode'* *'wim'* |
| 9853 | 'wildmode' 'wim' string (Vim default: "full") |
| 9854 | global |
Girish Palya | eded336 | 2025-04-12 18:03:32 +0200 | [diff] [blame] | 9855 | Completion mode used for the character specified with 'wildchar'. |
| 9856 | This option is a comma-separated list of up to four parts, |
| 9857 | corresponding to the first, second, third, and fourth presses of |
| 9858 | 'wildchar'. Each part is a colon-separated list of completion |
| 9859 | behaviors, which are applied simultaneously during that phase. |
Bram Moolenaar | 130cbfc | 2021-04-07 21:07:20 +0200 | [diff] [blame] | 9860 | |
Girish Palya | eded336 | 2025-04-12 18:03:32 +0200 | [diff] [blame] | 9861 | The possible behavior values are: |
| 9862 | "" Only complete (insert) the first match. No further |
| 9863 | matches are cycled or listed. |
| 9864 | "full" Complete the next full match. Cycles through all |
| 9865 | matches, returning to the original input after the |
| 9866 | last match. If 'wildmenu' is enabled, it will be |
| 9867 | shown. |
| 9868 | "longest" Complete to the longest common substring. If this |
| 9869 | doesn't extend the input, the next 'wildmode' part is |
| 9870 | used. |
| 9871 | "list" If multiple matches are found, list all of them. |
| 9872 | "lastused" When completing buffer names, sort them by most |
| 9873 | recently used (excluding the current buffer). Only |
| 9874 | applies to buffer name completion. |
| 9875 | "noselect" If 'wildmenu' is enabled, show the menu but do not |
| 9876 | preselect the first item. |
Christian Brabandt | f4b1a60 | 2025-04-13 18:06:49 +0200 | [diff] [blame] | 9877 | If only one match exists, it is completed fully, unless "noselect" is |
Girish Palya | eded336 | 2025-04-12 18:03:32 +0200 | [diff] [blame] | 9878 | specified. |
Bram Moolenaar | 130cbfc | 2021-04-07 21:07:20 +0200 | [diff] [blame] | 9879 | |
Girish Palya | eded336 | 2025-04-12 18:03:32 +0200 | [diff] [blame] | 9880 | Some useful combinations of colon-separated values: |
| 9881 | "longest:full" Start with the longest common string and show |
| 9882 | 'wildmenu' (if enabled). Does not cycle |
| 9883 | through full matches. |
| 9884 | "list:full" List all matches and complete first match. |
| 9885 | "list:longest" List all matches and complete till the longest |
| 9886 | common prefix. |
| 9887 | "list:lastused" List all matches. When completing buffers, |
| 9888 | sort them by most recently used (excluding the |
| 9889 | current buffer). |
| 9890 | "noselect:lastused" Do not preselect the first item in 'wildmenu' |
| 9891 | if it is active. When completing buffers, |
| 9892 | sort them by most recently used (excluding the |
| 9893 | current buffer). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9894 | |
| 9895 | Examples: > |
| 9896 | :set wildmode=full |
Girish Palya | eded336 | 2025-04-12 18:03:32 +0200 | [diff] [blame] | 9897 | < Complete full match on every press (default behavior) > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9898 | :set wildmode=longest,full |
Girish Palya | eded336 | 2025-04-12 18:03:32 +0200 | [diff] [blame] | 9899 | < First press: longest common substring |
| 9900 | Second press: cycle through full matches > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9901 | :set wildmode=list:full |
Girish Palya | eded336 | 2025-04-12 18:03:32 +0200 | [diff] [blame] | 9902 | < First press: list all matches and complete the first one > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9903 | :set wildmode=list,full |
Girish Palya | eded336 | 2025-04-12 18:03:32 +0200 | [diff] [blame] | 9904 | < First press: list matches only |
| 9905 | Second press: complete full matches > |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9906 | :set wildmode=longest,list |
Girish Palya | eded336 | 2025-04-12 18:03:32 +0200 | [diff] [blame] | 9907 | < First press: longest common substring |
| 9908 | Second press: list all matches > |
Girish Palya | 2bacc3e | 2025-03-02 22:55:57 +0100 | [diff] [blame] | 9909 | :set wildmode=noselect:full |
Hirohito Higashi | fa8b7db | 2025-04-30 19:12:37 +0200 | [diff] [blame] | 9910 | < First press: show 'wildmenu' without completing or selecting |
| 9911 | Second press: cycle full matches > |
Girish Palya | 2bacc3e | 2025-03-02 22:55:57 +0100 | [diff] [blame] | 9912 | :set wildmode=noselect:lastused,full |
Christian Brabandt | f4b1a60 | 2025-04-13 18:06:49 +0200 | [diff] [blame] | 9913 | < Same as above, but buffer matches are sorted by time last used |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 9914 | More info here: |cmdline-completion|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9915 | |
Bram Moolenaar | b5bf5b8 | 2004-12-24 14:35:23 +0000 | [diff] [blame] | 9916 | *'wildoptions'* *'wop'* |
| 9917 | 'wildoptions' 'wop' string (default "") |
| 9918 | global |
Yegappan Lakshmanan | 3908ef5 | 2022-02-08 12:08:07 +0000 | [diff] [blame] | 9919 | A list of words that change how |cmdline-completion| is done. |
Ilya Grigoriev | 053aee0 | 2025-06-11 21:07:35 +0200 | [diff] [blame] | 9920 | |
Yegappan Lakshmanan | 3908ef5 | 2022-02-08 12:08:07 +0000 | [diff] [blame] | 9921 | The following values are supported: |
Bram Moolenaar | 1588bc8 | 2022-03-08 21:35:07 +0000 | [diff] [blame] | 9922 | fuzzy Use |fuzzy-matching| to find completion matches. When |
Yegappan Lakshmanan | 38b85cb | 2022-02-24 13:28:41 +0000 | [diff] [blame] | 9923 | this value is specified, wildcard expansion will not |
| 9924 | be used for completion. The matches will be sorted by |
| 9925 | the "best match" rather than alphabetically sorted. |
| 9926 | This will find more matches than the wildcard |
| 9927 | expansion. Currently fuzzy matching based completion |
| 9928 | is not supported for file and directory names and |
| 9929 | instead wildcard expansion is used. |
Bram Moolenaar | 8a3b805 | 2022-06-26 12:21:15 +0100 | [diff] [blame] | 9930 | pum Display the completion matches using the popup menu |
Yegappan Lakshmanan | 3908ef5 | 2022-02-08 12:08:07 +0000 | [diff] [blame] | 9931 | in the same style as the |ins-completion-menu|. |
Bram Moolenaar | b5bf5b8 | 2004-12-24 14:35:23 +0000 | [diff] [blame] | 9932 | tagfile When using CTRL-D to list matching tags, the kind of |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 9933 | tag and the file of the tag is listed. Only one match |
Bram Moolenaar | b5bf5b8 | 2004-12-24 14:35:23 +0000 | [diff] [blame] | 9934 | is displayed per line. Often used tag kinds are: |
| 9935 | d #define |
| 9936 | f function |
Bram Moolenaar | b5bf5b8 | 2004-12-24 14:35:23 +0000 | [diff] [blame] | 9937 | |
Ilya Grigoriev | 053aee0 | 2025-06-11 21:07:35 +0200 | [diff] [blame] | 9938 | This option does not apply to |ins-completion|. See 'completeopt' for |
| 9939 | that. |
| 9940 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9941 | *'winaltkeys'* *'wak'* |
| 9942 | 'winaltkeys' 'wak' string (default "menu") |
| 9943 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9944 | {only used in Win32, Motif, GTK and Photon GUI} |
| 9945 | Some GUI versions allow the access to menu entries by using the ALT |
| 9946 | key in combination with a character that appears underlined in the |
| 9947 | menu. This conflicts with the use of the ALT key for mappings and |
| 9948 | entering special characters. This option tells what to do: |
| 9949 | no Don't use ALT keys for menus. ALT key combinations can be |
| 9950 | mapped, but there is no automatic handling. This can then be |
| 9951 | done with the |:simalt| command. |
| 9952 | yes ALT key handling is done by the windowing system. ALT key |
| 9953 | combinations cannot be mapped. |
| 9954 | menu Using ALT in combination with a character that is a menu |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 9955 | shortcut key, will be handled by the windowing system. Other |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9956 | keys can be mapped. |
| 9957 | If the menu is disabled by excluding 'm' from 'guioptions', the ALT |
| 9958 | key is never used for the menu. |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 9959 | This option is not used for <F10>; on Win32 and with GTK <F10> will |
| 9960 | select the menu, unless it has been mapped. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9961 | |
Bram Moolenaar | 4d784b2 | 2019-05-25 19:51:39 +0200 | [diff] [blame] | 9962 | *'wincolor'* *'wcr'* |
| 9963 | 'wincolor' 'wcr' string (default empty) |
| 9964 | local to window |
| 9965 | Highlight group name to use for this window instead of the Normal |
| 9966 | color |hl-Normal|. |
| 9967 | |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 9968 | *'window'* *'wi'* |
| 9969 | 'window' 'wi' number (default screen height - 1) |
| 9970 | global |
Bram Moolenaar | dad4473 | 2021-03-31 20:07:33 +0200 | [diff] [blame] | 9971 | Window height used for |CTRL-F| and |CTRL-B| when there is only one |
| 9972 | window and the value is smaller than 'lines' minus one. The screen |
| 9973 | will scroll 'window' minus two lines, with a minimum of one. |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 9974 | When 'window' is equal to 'lines' minus one CTRL-F and CTRL-B scroll |
| 9975 | in a much smarter way, taking care of wrapping lines. |
Luuk van Baal | 5a2e3ec | 2024-03-28 10:07:29 +0100 | [diff] [blame] | 9976 | When resizing the Vim window, and the value is smaller than 1 or more |
| 9977 | than or equal to 'lines' it will be set to 'lines' minus 1. |
Bram Moolenaar | dad4473 | 2021-03-31 20:07:33 +0200 | [diff] [blame] | 9978 | Note: Do not confuse this with the height of the Vim window, use |
| 9979 | 'lines' for that. |
Bram Moolenaar | 4399ef4 | 2005-02-12 14:29:27 +0000 | [diff] [blame] | 9980 | |
Doug Kearns | 002548b | 2025-06-05 21:18:09 +0200 | [diff] [blame] | 9981 | *'winfixbuf'* *'wfb'* |
Colin Kennedy | 2157035 | 2024-03-03 16:16:47 +0100 | [diff] [blame] | 9982 | 'winfixbuf' 'wfb' boolean (default off) |
| 9983 | local to window |
zeertzjq | 0049a49 | 2024-03-11 23:13:16 +0800 | [diff] [blame] | 9984 | If enabled, the window and the buffer it is displaying are paired. |
Colin Kennedy | 2157035 | 2024-03-03 16:16:47 +0100 | [diff] [blame] | 9985 | For example, attempting to change the buffer with |:edit| will fail. |
| 9986 | Other commands which change a window's buffer such as |:cnext| will |
zeertzjq | 0049a49 | 2024-03-11 23:13:16 +0800 | [diff] [blame] | 9987 | also skip any window with 'winfixbuf' enabled. However if an Ex |
| 9988 | command has a "!" modifier, it can force switching buffers. |
Colin Kennedy | 2157035 | 2024-03-03 16:16:47 +0100 | [diff] [blame] | 9989 | |
laburnumT | 3f7855a | 2023-12-05 18:37:03 +0100 | [diff] [blame] | 9990 | *'winfixheight'* *'wfh'* *'nowinfixheight'* *'nowfh'* |
| 9991 | 'winfixheight' 'wfh' boolean (default off) |
| 9992 | local to window |local-noglobal| |
| 9993 | Keep the window height when windows are opened or closed and |
| 9994 | 'equalalways' is set. Also for |CTRL-W_=|. Set by default for the |
| 9995 | |preview-window| and |quickfix-window|. |
| 9996 | The height may be changed anyway when running out of room. |
| 9997 | |
| 9998 | *'winfixwidth'* *'wfw'* *'nowinfixwidth'* *'nowfw'* |
| 9999 | 'winfixwidth' 'wfw' boolean (default off) |
| 10000 | local to window |local-noglobal| |
| 10001 | Keep the window width when windows are opened or closed and |
| 10002 | 'equalalways' is set. Also for |CTRL-W_=|. |
| 10003 | The width may be changed anyway when running out of room. |
| 10004 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10005 | *'winheight'* *'wh'* *E591* |
| 10006 | 'winheight' 'wh' number (default 1) |
| 10007 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10008 | Minimal number of lines for the current window. This is not a hard |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 10009 | minimum, Vim will use fewer lines if there is not enough room. If the |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 10010 | focus goes to a window that is smaller, its size is increased, at the |
| 10011 | cost of the height of other windows. |
| 10012 | Set 'winheight' to a small number for normal editing. |
| 10013 | Set it to 999 to make the current window fill most of the screen. |
| 10014 | Other windows will be only 'winminheight' high. This has the drawback |
| 10015 | that ":all" will create only two windows. To avoid "vim -o 1 2 3 4" |
| 10016 | to create only two windows, set the option after startup is done, |
| 10017 | using the |VimEnter| event: > |
| 10018 | au VimEnter * set winheight=999 |
| 10019 | < Minimum value is 1. |
| 10020 | The height is not adjusted after one of the commands that change the |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10021 | height of the current window. |
| 10022 | 'winheight' applies to the current window. Use 'winminheight' to set |
| 10023 | the minimal height for other windows. |
| 10024 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10025 | *'winminheight'* *'wmh'* |
| 10026 | 'winminheight' 'wmh' number (default 1) |
| 10027 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10028 | The minimal height of a window, when it's not the current window. |
| 10029 | This is a hard minimum, windows will never become smaller. |
| 10030 | When set to zero, windows may be "squashed" to zero lines (i.e. just a |
| 10031 | status bar) if necessary. They will return to at least one line when |
| 10032 | they become active (since the cursor has to have somewhere to go.) |
| 10033 | Use 'winheight' to set the minimal height of the current window. |
| 10034 | This option is only checked when making a window smaller. Don't use a |
| 10035 | large number, it will cause errors when opening more than a few |
| 10036 | windows. A value of 0 to 3 is reasonable. |
| 10037 | |
| 10038 | *'winminwidth'* *'wmw'* |
| 10039 | 'winminwidth' 'wmw' number (default 1) |
| 10040 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10041 | The minimal width of a window, when it's not the current window. |
| 10042 | This is a hard minimum, windows will never become smaller. |
| 10043 | When set to zero, windows may be "squashed" to zero columns (i.e. just |
| 10044 | a vertical separator) if necessary. They will return to at least one |
| 10045 | line when they become active (since the cursor has to have somewhere |
| 10046 | to go.) |
| 10047 | Use 'winwidth' to set the minimal width of the current window. |
| 10048 | This option is only checked when making a window smaller. Don't use a |
| 10049 | large number, it will cause errors when opening more than a few |
| 10050 | windows. A value of 0 to 12 is reasonable. |
| 10051 | |
Bram Moolenaar | 9e13aa7 | 2017-08-16 23:14:08 +0200 | [diff] [blame] | 10052 | *'winptydll'* |
| 10053 | 'winptydll' string (default "winpty32.dll" or "winpty64.dll") |
| 10054 | global |
Bram Moolenaar | 9e13aa7 | 2017-08-16 23:14:08 +0200 | [diff] [blame] | 10055 | {only available when compiled with the |terminal| |
| 10056 | feature on MS-Windows} |
| 10057 | Specifies the name of the winpty shared library, used for the |
Bram Moolenaar | e7b1ea0 | 2020-08-07 19:54:59 +0200 | [diff] [blame] | 10058 | |:terminal| command. The default depends on whether Vim was built as a |
Bram Moolenaar | c572da5 | 2017-08-27 16:52:01 +0200 | [diff] [blame] | 10059 | 32-bit or 64-bit executable. If not found, "winpty.dll" is tried as |
Bram Moolenaar | 9e13aa7 | 2017-08-16 23:14:08 +0200 | [diff] [blame] | 10060 | a fallback. |
| 10061 | Environment variables are expanded |:set_env|. |
| 10062 | This option cannot be set from a |modeline| or in the |sandbox|, for |
| 10063 | security reasons. |
| 10064 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10065 | *'winwidth'* *'wiw'* *E592* |
| 10066 | 'winwidth' 'wiw' number (default 20) |
| 10067 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10068 | Minimal number of columns for the current window. This is not a hard |
| 10069 | minimum, Vim will use fewer columns if there is not enough room. If |
| 10070 | the current window is smaller, its size is increased, at the cost of |
| 10071 | the width of other windows. Set it to 999 to make the current window |
| 10072 | always fill the screen. Set it to a small number for normal editing. |
| 10073 | The width is not adjusted after one of the commands to change the |
| 10074 | width of the current window. |
| 10075 | 'winwidth' applies to the current window. Use 'winminwidth' to set |
| 10076 | the minimal width for other windows. |
| 10077 | |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 10078 | *'wlseat'* *'wse'* |
| 10079 | 'wlseat' 'wse' string (default "") |
| 10080 | global |
| 10081 | {only when the |+wayland| feature is included} |
| 10082 | Specifies the Wayland seat to use for Wayland functionality, |
Hirohito Higashi | 73b9650 | 2025-06-28 18:18:21 +0200 | [diff] [blame] | 10083 | specifically the clipboard. If the seat does not exist, then the |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 10084 | option will still be set to the new value, with the Wayland clipboard |
Hirohito Higashi | 73b9650 | 2025-06-28 18:18:21 +0200 | [diff] [blame] | 10085 | being unavailable as a result. If an empty value is passed then Vim |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 10086 | will attempt to use the value of $XDG_SEAT if it exists, if not then |
Hirohito Higashi | 73b9650 | 2025-06-28 18:18:21 +0200 | [diff] [blame] | 10087 | it resorts to using the first seat found available. Updating this |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 10088 | option will also update |v:clipmethod|. |
| 10089 | |
Hirohito Higashi | 73b9650 | 2025-06-28 18:18:21 +0200 | [diff] [blame] | 10090 | *'wlsteal'* *'wst'* *'nowlsteal'* *'nowst'* |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 10091 | 'wlsteal' 'wst' boolean (default off) |
| 10092 | global |
| 10093 | {only when the |+wayland_clipboard| feature is included} |
| 10094 | When enabled, then allow Vim to steal focus by creating a temporary |
Hirohito Higashi | 73b9650 | 2025-06-28 18:18:21 +0200 | [diff] [blame] | 10095 | surface, in order to access the clipboard. For more information see |
Foxe Chen | b90c239 | 2025-06-27 21:10:35 +0200 | [diff] [blame] | 10096 | |wayland-focus-steal|. |
| 10097 | |
| 10098 | *'wltimeoutlen'* *'wtm'* |
| 10099 | 'wltimeoutlen' 'wtm' number (default 500) |
| 10100 | global |
| 10101 | {only when the |+wayland| feature is included} |
| 10102 | The timeout in milliseconds before Vim gives up on waiting for the |
| 10103 | Wayland compositor. While Vim waits on the compositor, it is |
| 10104 | unresponsive to input and does not update the screen. Therefore |
| 10105 | setting this to a lower value may make Vim feel more responsive in |
| 10106 | some cases. On the other hand, it may also mean you receive errors |
| 10107 | when the compositor takes more time to respond than usual. |
| 10108 | |
| 10109 | Additionally, this option is also used as the maximum timeout when |
| 10110 | waiting for a surface to gain focus, see |wayland-focus-steal|. |
| 10111 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10112 | *'wrap'* *'nowrap'* |
| 10113 | 'wrap' boolean (default on) |
| 10114 | local to window |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10115 | This option changes how text is displayed. It doesn't change the text |
| 10116 | in the buffer, see 'textwidth' for that. |
| 10117 | When on, lines longer than the width of the window will wrap and |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 10118 | displaying continues on the next line. When off lines will not wrap |
| 10119 | and only part of long lines will be displayed. When the cursor is |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10120 | moved to a part that is not shown, the screen will scroll |
| 10121 | horizontally. |
| 10122 | The line will be broken in the middle of a word if necessary. See |
| 10123 | 'linebreak' to get the break at a word boundary. |
| 10124 | To make scrolling horizontally a bit more useful, try this: > |
| 10125 | :set sidescroll=5 |
| 10126 | :set listchars+=precedes:<,extends:> |
| 10127 | < See 'sidescroll', 'listchars' and |wrap-off|. |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 10128 | This option can't be set from a |modeline| when the 'diff' option is |
| 10129 | on. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10130 | |
| 10131 | *'wrapmargin'* *'wm'* |
| 10132 | 'wrapmargin' 'wm' number (default 0) |
| 10133 | local to buffer |
| 10134 | Number of characters from the right window border where wrapping |
| 10135 | starts. When typing text beyond this limit, an <EOL> will be inserted |
| 10136 | and inserting continues on the next line. |
| 10137 | Options that add a margin, such as 'number' and 'foldcolumn', cause |
| 10138 | the text width to be further reduced. This is Vi compatible. |
| 10139 | When 'textwidth' is non-zero, this option is not used. |
Bram Moolenaar | ca63501 | 2015-09-25 20:34:21 +0200 | [diff] [blame] | 10140 | This option is set to 0 when 'paste' is set and restored when 'paste' |
| 10141 | is reset. |
Bram Moolenaar | a6c27c4 | 2019-05-09 19:16:22 +0200 | [diff] [blame] | 10142 | See also 'formatoptions' and |ins-textwidth|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10143 | |
| 10144 | *'wrapscan'* *'ws'* *'nowrapscan'* *'nows'* |
| 10145 | 'wrapscan' 'ws' boolean (default on) *E384* *E385* |
| 10146 | global |
Bram Moolenaar | ac6e65f | 2005-08-29 22:25:38 +0000 | [diff] [blame] | 10147 | Searches wrap around the end of the file. Also applies to |]s| and |
| 10148 | |[s|, searching for spelling mistakes. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10149 | |
| 10150 | *'write'* *'nowrite'* |
| 10151 | 'write' boolean (default on) |
| 10152 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10153 | Allows writing files. When not set, writing a file is not allowed. |
| 10154 | Can be used for a view-only mode, where modifications to the text are |
Bram Moolenaar | f4b8e57 | 2004-06-24 15:53:16 +0000 | [diff] [blame] | 10155 | still allowed. Can be reset with the |-m| or |-M| command line |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10156 | argument. Filtering text is still possible, even though this requires |
| 10157 | writing a temporary file. |
| 10158 | |
| 10159 | *'writeany'* *'wa'* *'nowriteany'* *'nowa'* |
| 10160 | 'writeany' 'wa' boolean (default off) |
| 10161 | global |
| 10162 | Allows writing to any file with no need for "!" override. |
| 10163 | |
| 10164 | *'writebackup'* *'wb'* *'nowritebackup'* *'nowb'* |
| 10165 | 'writebackup' 'wb' boolean (default on with |+writebackup| feature, off |
| 10166 | otherwise) |
| 10167 | global |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10168 | Make a backup before overwriting a file. The backup is removed after |
| 10169 | the file was successfully written, unless the 'backup' option is |
Bram Moolenaar | 1aeaf8c | 2012-05-18 13:46:39 +0200 | [diff] [blame] | 10170 | also on. |
| 10171 | WARNING: Switching this option off means that when Vim fails to write |
| 10172 | your buffer correctly and then, for whatever reason, Vim exits, you |
| 10173 | lose both the original file and what you were writing. Only reset |
| 10174 | this option if your file system is almost full and it makes the write |
| 10175 | fail (and make sure not to exit Vim until the write was successful). |
| 10176 | See |backup-table| for another explanation. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10177 | When the 'backupskip' pattern matches, a backup is not made anyway. |
Bram Moolenaar | 0c0734d | 2019-11-26 21:44:46 +0100 | [diff] [blame] | 10178 | Depending on 'backupcopy' the backup is a new file or the original |
| 10179 | file renamed (and a new file is written). |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10180 | NOTE: This option is set to the default value when 'compatible' is |
| 10181 | set. |
| 10182 | |
| 10183 | *'writedelay'* *'wd'* |
| 10184 | 'writedelay' 'wd' number (default 0) |
| 10185 | global |
Bram Moolenaar | 802a0d9 | 2016-06-26 16:17:58 +0200 | [diff] [blame] | 10186 | The number of milliseconds to wait for each character sent to the |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10187 | screen. When non-zero, characters are sent to the terminal one by |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 10188 | one. For debugging purposes. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10189 | |
Bram Moolenaar | 6f79e61 | 2021-12-21 09:12:23 +0000 | [diff] [blame] | 10190 | *'xtermcodes'* *'noxtermcodes'* |
| 10191 | 'xtermcodes' boolean (default on) |
| 10192 | global |
| 10193 | When detecting xterm patchlevel 141 or higher with the termresponse |
Bram Moolenaar | fa3b723 | 2021-12-24 13:18:38 +0000 | [diff] [blame] | 10194 | mechanism and this option is set, Vim will request the actual terminal |
Bram Moolenaar | 6f79e61 | 2021-12-21 09:12:23 +0000 | [diff] [blame] | 10195 | key codes and number of colors from the terminal. This takes care of |
| 10196 | various configuration options of the terminal that cannot be obtained |
| 10197 | from the termlib/terminfo entry, see |xterm-codes|. |
| 10198 | A side effect may be that t_Co changes and Vim will redraw the |
| 10199 | display. |
| 10200 | |
| 10201 | |
Bram Moolenaar | 91f84f6 | 2018-07-29 15:07:52 +0200 | [diff] [blame] | 10202 | vim:tw=78:ts=8:noet:ft=help:norl: |