|
1 |
| -*autocmd.txt* For Vim version 8.1. Last change: 2019 Jun 02 |
| 1 | +*autocmd.txt* For Vim version 8.1. Last change: 2019 Jun 15 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar
|
@@ -873,15 +873,33 @@ MenuPopup Just before showing the popup menu (under the
|
873 | 873 | *OptionSet*
|
874 | 874 | OptionSet After setting an option. The pattern is
|
875 | 875 | matched against the long option name.
|
876 |
| - The |v:option_old| variable indicates the |
877 |
| - old option value, |v:option_new| variable |
878 |
| - indicates the newly set value, the |
879 |
| - |v:option_type| variable indicates whether |
880 |
| - it's global or local scoped and |<amatch>| |
881 |
| - indicates what option has been set. |
882 |
| - |
883 |
| - Is not triggered on startup and for the 'key' |
884 |
| - option for obvious reasons. |
| 876 | + |<amatch>| indicates what option has been set. |
| 877 | + |
| 878 | + |v:option_type| indicates whether it's global |
| 879 | + or local scoped |
| 880 | + |v:option_command| indicates what type of |
| 881 | + set/let command was used (follow the tag to |
| 882 | + see the table). |
| 883 | + |v:option_new| indicates the newly set value. |
| 884 | + |v:option_oldlocal| hass the old local value. |
| 885 | + |v:option_oldglobal| hass the old global |
| 886 | + value |
| 887 | + |v:option_old| indicates the old option value. |
| 888 | + |
| 889 | + |v:option_oldlocal| is only set when |:set| |
| 890 | + or |:setlocal| or a |modeline| was used to set |
| 891 | + the option. Similarly |v:option_oldglobal| is |
| 892 | + only set when |:set| or |:setglobal| was used. |
| 893 | + |
| 894 | + Note that when setting a |global-local| string |
| 895 | + option with |:set|, then |v:option_old| is the |
| 896 | + old global value. However, for all other kinds |
| 897 | + of options (local string options, global-local |
| 898 | + number options, ...) it is the old local |
| 899 | + value. |
| 900 | + |
| 901 | + OptionSet is not triggered on startup and for |
| 902 | + the 'key' option for obvious reasons. |
885 | 903 |
|
886 | 904 | Usage example: Check for the existence of the
|
887 | 905 | directory in the 'backupdir' and 'undodir'
|
|
0 commit comments