1
- *eval.txt* For Vim version 8.1. Last change: 2019 Jun 10
1
+ *eval.txt* For Vim version 8.1. Last change: 2019 Jun 17
2
2
3
3
4
4
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1943,10 +1943,29 @@ v:option_new New value of the option. Valid while executing an |OptionSet|
1943
1943
autocommand.
1944
1944
*v:option_old*
1945
1945
v: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.
1947
1957
*v:option_type*
1948
1958
v:option_type Scope of the set command. Valid while executing an
1949
1959
| 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 |
1950
1969
*v:operator* *operator-variable*
1951
1970
v:operator The last operator given in Normal mode. This is a single
1952
1971
character except for commands starting with <g> or <z> ,
@@ -2164,7 +2183,7 @@ v:val Value of the current item of a |List| or |Dictionary|. Only
2164
2183
2165
2184
*v:version* *version-variable*
2166
2185
v:version Version number of Vim: Major version number times 100 plus
2167
- minor version number. Version 5.0 is 500. Version 5.1 (5.01)
2186
+ minor version number. Version 5.0 is 500. Version 5.1
2168
2187
is 501. Read-only. "version" also works, for backwards
2169
2188
compatibility, unless | scriptversion | is 3 or higher.
2170
2189
Use | has() | to check if a certain patch was included, e.g.: >
@@ -2174,10 +2193,10 @@ v:version Version number of Vim: Major version number times 100 plus
2174
2193
completely different.
2175
2194
2176
2195
*v:versionlong* *versionlong-variable*
2177
- v:versionlong Like v:version, but also including the patchlevel. Version
2178
- 8.1 with patch 1234 has value 8011234. This can be used like
2179
- this: >
2180
- if v:versionlong >= 8011234
2196
+ v:versionlong Like v:version, but also including the patchlevel in the last
2197
+ four digits. Version 8.1 with patch 123 has value 8010123.
2198
+ This can be used like this: >
2199
+ if v:versionlong >= 8010123
2181
2200
< However, if there are gaps in the list of patches included
2182
2201
this will not work well. This can happen if a recent patch
2183
2202
was included into an older version, e.g. for a security fix.
@@ -8104,10 +8123,9 @@ setbufline({expr}, {lnum}, {text}) *setbufline()*
8104
8123
8105
8124
{lnum} is used like with | setline() | .
8106
8125
This works like | setline() | for the specified buffer.
8107
- On success 0 is returned, on failure 1 is returned.
8108
8126
8109
- If {expr} is not a valid buffer or {lnum} is not valid, an
8110
- error message is given .
8127
+ When {expr} is not a valid buffer or {lnum} is not valid then
8128
+ 1 is returned. On success 0 is returned .
8111
8129
8112
8130
setbufvar({expr} , {varname} , {val} ) *setbufvar()*
8113
8131
Set option or local variable {varname} in buffer {expr} to
@@ -8865,7 +8883,7 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
8865
8883
<
8866
8884
sound_clear() *sound_clear()*
8867
8885
Stop playing all sounds.
8868
- {only available when compiled with the +sound feature}
8886
+ {only available when compiled with the | +sound | feature}
8869
8887
8870
8888
*sound_playevent()*
8871
8889
sound_playevent({name} [, {callback} ])
@@ -8874,8 +8892,11 @@ sound_playevent({name} [, {callback}])
8874
8892
are used. On Ubuntu they may be found in
8875
8893
/usr/share/sounds/freedesktop/stereo. Example: >
8876
8894
call sound_playevent('bell')
8895
+ < On MS-Windows, {name} can be SystemAsterisk, SystemDefault,
8896
+ SystemExclamation, SystemExit, SystemHand, SystemQuestion,
8897
+ SystemStart, SystemWelcome, etc.
8877
8898
8878
- < When {callback} is specified it is invoked when the sound is
8899
+ When {callback} is specified it is invoked when the sound is
8879
8900
finished. The first argument is the sound ID, the second
8880
8901
argument is the status:
8881
8902
0 sound was played to the end
@@ -8887,7 +8908,9 @@ sound_playevent({name} [, {callback}])
8887
8908
endfunc
8888
8909
call sound_playevent('bell', 'Callback')
8889
8910
8890
- < Returns the sound ID, which can be passed to `sound_stop ()` .
8911
+ < MS-Windows: {callback} doesn't work for this function.
8912
+
8913
+ Returns the sound ID, which can be passed to `sound_stop ()` .
8891
8914
Returns zero if the sound could not be played.
8892
8915
{only available when compiled with the | +sound | feature}
8893
8916
@@ -8903,6 +8926,10 @@ sound_playfile({path} [, {callback}])
8903
8926
sound_stop({id} ) *sound_stop()*
8904
8927
Stop playing sound {id} . {id} must be previously returned by
8905
8928
`sound_playevent ()` or `sound_playfile ()` .
8929
+
8930
+ On MS-Windows, this does not work for event sound started by
8931
+ `sound_playevent ()` . To stop event sounds, use `sound_clear ()` .
8932
+
8906
8933
{only available when compiled with the | +sound | feature}
8907
8934
8908
8935
*soundfold()*
@@ -11573,7 +11600,6 @@ text...
11573
11600
# Number
11574
11601
* Funcref
11575
11602
11576
-
11577
11603
:unl[et][!] {name} ... *:unlet* *:unl* *E108* *E795*
11578
11604
Remove the internal variable {name} . Several variable
11579
11605
names can be given, they are all removed. The name
@@ -11600,10 +11626,9 @@ text...
11600
11626
If the system does not support deleting an environment
11601
11627
variable, it is made empty.
11602
11628
11603
- *:cons* *:const* *E996*
11629
+ *:cons* *:const*
11604
11630
:cons[t] {var-name} = {expr1}
11605
11631
:cons[t] [{name1} , {name2} , ...] = {expr1}
11606
- :cons[t] [{name1} , {name2} , ...] .= {expr1}
11607
11632
:cons[t] [{name} , ..., ; {lastname} ] = {expr1}
11608
11633
:cons[t] {var-name} =<< [trim] {marker}
11609
11634
text...
@@ -11619,10 +11644,14 @@ text...
11619
11644
< This is useful if you want to make sure the variable
11620
11645
is not modified.
11621
11646
*E995*
11622
- | :const | does not allow to for changing a variable. >
11647
+ | :const | does not allow to for changing a variable: >
11623
11648
:let x = 1
11624
11649
:const x = 2 " Error!
11625
- <
11650
+ < *E996*
11651
+ Note that environment variables, option values and
11652
+ register values cannot be used here, since they cannot
11653
+ be locked.
11654
+
11626
11655
:lockv[ar][!] [depth] {name} ... *:lockvar* *:lockv*
11627
11656
Lock the internal variable {name} . Locking means that
11628
11657
it can no longer be changed (until it is unlocked).
0 commit comments