aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/autocmd.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/autocmd.txt')
-rw-r--r--runtime/doc/autocmd.txt31
1 files changed, 26 insertions, 5 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 6343f6ef3d..ba89c207c2 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -877,12 +877,33 @@ MenuPopup Just before showing the popup menu (under the
*OptionSet*
OptionSet After setting an option (except during
|startup|). The |autocmd-pattern| is matched
- against the long option name.
- |v:option_old| indicates the old option value,
- |v:option_new| indicates the new value,
+ against the long option name. |<amatch>|
+ indicates what option has been set.
+
|v:option_type| indicates whether it's global
- or local scoped and |<amatch>| indicates which
- option was set.
+ or local scoped.
+ |v:option_command| indicates what type of
+ set/let command was used (follow the tag to
+ see the table).
+ |v:option_new| indicates the newly set value.
+ |v:option_oldlocal| has the old local value.
+ |v:option_oldglobal| has the old global value.
+ |v:option_old| indicates the old option value.
+
+ |v:option_oldlocal| is only set when |:set|
+ or |:setlocal| or a |modeline| was used to set
+ the option. Similarly |v:option_oldglobal| is
+ only set when |:set| or |:setglobal| was used.
+
+ Note that when setting a |global-local| string
+ option with |:set|, then |v:option_old| is the
+ old global value. However, for all other kinds
+ of options (local string options, global-local
+ number options, ...) it is the old local
+ value.
+
+ OptionSet is not triggered on startup and for
+ the 'key' option for obvious reasons.
Usage example: Check for the existence of the
directory in the 'backupdir' and 'undodir'