Reason ~
'filetype' explicitly set by autocommands
'syntax' explicitly set by autocommands
'bufhidden' denote |special-buffers|
'buftype' denote |special-buffers|
'readonly' will be detected automatically
'modified' will be detected automatically
*:setl* *:setlocal*
:setl[ocal][!] ... Like ":set" but set only the value local to the
current buffer or window. Not all options have a
local value. If the option does not have a local
value the global value is set.
With the "all" argument: display local values for all
local options.
Without argument: Display local values for all local
options which are different from the default.
When displaying a specific local option, show the
local value. For a global/local boolean option, when
the global value is being used, "--" is displayed
before the option name.
For a global option the global value is
shown (but that might change in the future).
:se[t] {option}< Set the effective value of {option} to its global
value.
For |global-local| options, the local value is removed,
so that the global value will be used.
For all other options, the global value is copied to
the local value.
:setl[ocal] {option}< Set the effective value of {option} to its global
value by copying the global value to the local value.
Note that the behaviour for |global-local| options is slightly different
between string and number-based options.
*:setg* *:setglobal*
:setg[lobal][!] ... Like ":set" but set only the global value for a local
option without changing the local value.
When displaying an option, the global value is shown.
With the "all" argument: display global values for all
local options.
Without argument: display global values for all local
options which are different from the default.
For buffer-local and window-local options:
Command global value local value condition ~
:set option=value set set
:setlocal option=value - set
:setglobal option=value set -
:set option? - display local value is set
:set option? display - local value is not set
:setlocal option? - display
:setglobal option? display -
Global options with a local value *global-local*
Options are global when you mostly use one value for all buffers and windows.
For some global options it's useful to sometimes have a different local value.
You can set the local value with ":setlocal". That buffer or window will then
use the local value, while other buffers and windows continue using the global
value.
For example, you have two windows, both on C source code. They use the global
'makeprg' option. If you do this in one of the two windows: >
:set makeprg=gmake
then the other window will switch to the same value. There is no need to set
the 'makeprg' option in the other C source window too.
However, if you start editing a Perl file in a new window, you want to use
another 'makeprg' for it, without changing the value used for the C source
files. You use this command: >
:setlocal makeprg=perlmake
You can switch back to using the global value by making the local value empty: >
:setlocal makeprg=
This only works for a string option. For a number or boolean option you need
to use the "<" flag, like this: >
:setlocal autoread<
Note that for non-boolean and non-number options using "<" copies the global
value to the local value, it doesn't switch back to using the global value
(that matters when the global value changes later). You can also use: >
:set path<
This will make the local value of 'path' empty, so that the global value is
used. Thus it does the same as: >
:setlocal path=
Note: In the future more global options can be made |global-local|. Using
":setlocal" on a global option might work differently then.
*option-value-function*
Some options ('completefunc', 'findfunc', 'omnifunc', 'operatorfunc',
'quickfixtextfunc',