@@ -1943,10 +1943,29 @@ v:option_new New value of the option. Valid while executing an |OptionSet|
19431943 autocommand.
19441944 *v:option_old*
19451945v:option_old Old value of the option. Valid while executing an | OptionSet |
1946- autocommand.
1946+ autocommand. Depending on the command used for setting and the
1947+ kind of option this is either the local old value or the
1948+ global old value.
1949+ *v:option_oldlocal*
1950+ v:option_oldlocal
1951+ Old local value of the option. Valid while executing an
1952+ | OptionSet | autocommand.
1953+ *v:option_oldglobal*
1954+ v:option_oldglobal
1955+ Old global value of the option. Valid while executing an
1956+ | OptionSet | autocommand.
19471957 *v:option_type*
19481958v:option_type Scope of the set command. Valid while executing an
19491959 | OptionSet | autocommand. Can be either "global" or "local"
1960+ *v:option_command*
1961+ v:option_command
1962+ Command used to set the option. Valid while executing an
1963+ | OptionSet | autocommand.
1964+ value option was set via ~
1965+ "setlocal" | :setlocal | or ":let l:xxx"
1966+ "setglobal" | :setglobal | or ":let g:xxx"
1967+ "set" | :set | or | :let |
1968+ "modeline" | modeline |
19501969 *v:operator* *operator-variable*
19511970v:operator The last operator given in Normal mode. This is a single
19521971 character except for commands starting with <g> or <z> ,
@@ -2173,6 +2192,17 @@ v:version Version number of Vim: Major version number times 100 plus
21732192 version 5.0 and 5.1 may have a patch 123, but these are
21742193 completely different.
21752194
2195+ *v:versionlong* *versionlong-variable*
2196+ v:versionlong Like v:version, but also including the patchlevel. Version
2197+ 8.1 with patch 1234 has value 8011234. This can be used like
2198+ this: >
2199+ if v:versionlong >= 8011234
2200+ < However, if there are gaps in the list of patches included
2201+ this will not work well. This can happen if a recent patch
2202+ was included into an older version, e.g. for a security fix.
2203+ Use the has() function to make sure the patch is actually
2204+ included.
2205+
21762206 *v:vim_did_enter* *vim_did_enter-variable*
21772207v:vim_did_enter Zero until most of startup is done. It is set to one just
21782208 before | VimEnter | autocommands are triggered.
@@ -11592,7 +11622,33 @@ text...
1159211622 No error message is given for a non-existing
1159311623 variable, also without !.
1159411624 If the system does not support deleting an environment
11595- variable, it is made emtpy.
11625+ variable, it is made empty.
11626+
11627+ *:cons* *:const*
11628+ :cons[t] {var-name} = {expr1}
11629+ :cons[t] [{name1} , {name2} , ...] = {expr1}
11630+ :cons[t] [{name} , ..., ; {lastname} ] = {expr1}
11631+ :cons[t] {var-name} =<< [trim] {marker}
11632+ text...
11633+ text...
11634+ {marker}
11635+ Similar to | :let | , but additionally lock the variable
11636+ after setting the value. This is the same as locking
11637+ the variable with | :lockvar | just after | :let | , thus: >
11638+ :const x = 1
11639+ < is equivalent to: >
11640+ :let x = 1
11641+ :lockvar 1 x
11642+ < This is useful if you want to make sure the variable
11643+ is not modified.
11644+ *E995*
11645+ | :const | does not allow to for changing a variable. >
11646+ :let x = 1
11647+ :const x = 2 " Error!
11648+ < *E996*
11649+ Note that environment variables, option values and
11650+ register values cannot be used here, since they cannot
11651+ be locked.
1159611652
1159711653:lockv[ar][!] [depth] {name} ... *:lockvar* *:lockv*
1159811654 Lock the internal variable {name} . Locking means that
0 commit comments