1
- *eval.txt* For Vim version 9.1. Last change: 2025 Aug 20
1
+ *eval.txt* For Vim version 9.1. Last change: 2025 Aug 29
2
2
3
3
4
4
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -972,8 +972,8 @@ is not available it returns -1 or the default value you specify: >
972
972
973
973
Blob iteration ~
974
974
975
- The | :for | loop executes commands for each byte of a Blob. The loop variable is
976
- set to each byte in the Blob. Example: >
975
+ The | :for | loop executes commands for each byte of a Blob. The loop variable
976
+ is set to each byte in the Blob. Example: >
977
977
:for byte in 0z112233
978
978
: call Doit(byte)
979
979
:endfor
@@ -1547,9 +1547,9 @@ String. A negative index always results in an empty string (reason: backward
1547
1547
compatibility). Use [-1:] to get the last byte or character.
1548
1548
In Vim9 script a negative index is used like with a list: count from the end.
1549
1549
1550
- If expr10 is a | List | then it results the item at index expr1. See | list-index |
1551
- for possible index values. If the index is out of range this results in an
1552
- error. Example: >
1550
+ If expr10 is a | List | then it results the item at index expr1. See
1551
+ | list-index | for possible index values. If the index is out of range this
1552
+ results in an error. Example: >
1553
1553
:let item = mylist[-1] " get last item
1554
1554
1555
1555
Generally, if a | List | index is equal to or higher than the length of the
@@ -2227,8 +2227,8 @@ v:beval_winid The |window-ID| of the window, over which the mouse pointer
2227
2227
*v:char* *char-variable*
2228
2228
v:char Argument for evaluating 'formatexpr' and used for the typed
2229
2229
character when using <expr> in an abbreviation | :map-<expr> | .
2230
- It is also used by the | InsertCharPre | , | InsertEnter | and
2231
- | KeyInputPre | events.
2230
+ It is also used by the | InsertCharPre | , | InsertEnter | ,
2231
+ | KeyInputPre | , | CmdlineLeave | and | CmdlineLeavePre | events.
2232
2232
2233
2233
*v:charconvert_from* *charconvert_from-variable*
2234
2234
v:charconvert_from
@@ -2245,8 +2245,10 @@ v:clipmethod The current method of accessing the clipboard that is being
2245
2245
used. Can either have the value of:
2246
2246
wayland The Wayland protocol is being used.
2247
2247
x11 X11 selections are being used.
2248
- none The above methods are unavailable or
2249
- cannot be used.
2248
+ gui GUI specific method is being used
2249
+ other Some other method is being used
2250
+ none Clipboard functionality is disabled or
2251
+ unavailable.
2250
2252
See 'clipmethod' for more details.
2251
2253
2252
2254
*v:cmdarg* *cmdarg-variable*
@@ -2315,9 +2317,9 @@ v:colornames A dictionary that maps color names to hex color strings. These
2315
2317
It is possible to remove entries from this dictionary but
2316
2318
doing so is NOT recommended, because it is disruptive to
2317
2319
other scripts. It is also unlikely to achieve the desired
2318
- result because the | :colorscheme | and | :highlight | commands will
2319
- both automatically load all `colors/lists/ default.vim ` color
2320
- scripts.
2320
+ result because the | :colorscheme | and | :highlight | commands
2321
+ will both automatically load all `colors/lists/ default.vim `
2322
+ color scripts.
2321
2323
2322
2324
You can make changes to that file, but make sure to add new
2323
2325
keys instead of updating existing ones, otherwise Vim will skip
@@ -2718,9 +2720,10 @@ v:python3_version
2718
2720
should exactly match the Python library up to the minor
2719
2721
version (e.g. 3.10.2 and 3.10.3 are compatible as the minor
2720
2722
version is "10", whereas 3.9.4 and 3.10.3 are not compatible).
2721
- When | python-stable-abi | is used, this will be the minimum Python
2722
- version that you can use instead. (e.g. if v:python3_version
2723
- indicates 3.9, you can use 3.9, 3.10, or anything above).
2723
+ When | python-stable-abi | is used, this will be the minimum
2724
+ Python version that you can use instead. (e.g. if
2725
+ v:python3_version indicates 3.9, you can use 3.9, 3.10, or
2726
+ anything above).
2724
2727
2725
2728
This number is encoded as a hex number following Python ABI
2726
2729
versioning conventions. Do the following to have a
@@ -2858,16 +2861,16 @@ v:t_enumvalue Value of |enumvalue| type. Read-only. See: |type()|
2858
2861
*v:t_tuple* *t_tuple-variable*
2859
2862
v:t_tuple Value of | Tuple | type. Read-only. See: | type() |
2860
2863
2861
- *v:termresponse* *termresponse-variable*
2864
+ *v:termresponse* *termresponse-variable*
2862
2865
v:termresponse The escape sequence returned by the terminal for the | t_RV |
2863
2866
termcap entry. It is set when Vim receives an escape sequence
2864
2867
that starts with ESC [ or CSI, then '>' or '?' and ends in a
2865
2868
'c', with only digits and ';' in between.
2866
- When this option is set, the TermResponse autocommand event is
2867
- fired, so that you can react to the response from the
2869
+ When this variable is set, the TermResponse autocommand event
2870
+ is fired, so that you can react to the response from the
2868
2871
terminal. The TermResponseAll event is also fired, with
2869
- <amatch> set to "version". You can use | terminalprops() | to see
2870
- what Vim figured out about the terminal.
2872
+ <amatch> set to "version". You can use | terminalprops() | to
2873
+ see what Vim figured out about the terminal.
2871
2874
The response from a new xterm is: "<Esc> [> Pp ; Pv ; Pc c". Pp
2872
2875
is the terminal type: 0 for vt100 and 1 for vt220. Pv is the
2873
2876
patch level (since this was introduced in patch 95, it's
@@ -2876,41 +2879,54 @@ v:termresponse The escape sequence returned by the terminal for the |t_RV|
2876
2879
codes. This only works with xterm | xterm-codes | .
2877
2880
{only when compiled with | +termresponse | feature}
2878
2881
2879
- *v:termblinkresp*
2882
+ *v:termblinkresp* *termblinkresp-variable *
2880
2883
v:termblinkresp The escape sequence returned by the terminal for the | t_RC |
2881
2884
termcap entry. This is used to find out whether the terminal
2882
2885
cursor is blinking. This is used by | term_getcursor() | . When
2883
- this option is set, the TermResponseAll autocommand event is
2886
+ this variable is set, the TermResponseAll autocommand event is
2884
2887
fired, with <amatch> set to "cursorblink".
2885
2888
2886
- *v:termstyleresp*
2889
+ *v:termstyleresp* *termstyleresp-variable *
2887
2890
v:termstyleresp The escape sequence returned by the terminal for the | t_RS |
2888
2891
termcap entry. This is used to find out what the shape of the
2889
2892
cursor is. This is used by | term_getcursor() | . When this
2890
- option is set, the TermResponseAll autocommand event is fired,
2891
- with <amatch> set to "cursorshape".
2893
+ variable is set, the TermResponseAll autocommand event is
2894
+ fired, with <amatch> set to "cursorshape".
2892
2895
2893
- *v:termrbgresp*
2896
+ *v:termrbgresp* *termrbgresp-variable *
2894
2897
v:termrbgresp The escape sequence returned by the terminal for the | t_RB |
2895
2898
termcap entry. This is used to find out what the terminal
2896
- background color is; see 'background' . When this option is
2897
- set, the TermResponseAll autocommand event is fired, with
2898
- <amatch> set to "background".
2899
+ background color is; see 'background' . This is set by the
2900
+ $VIMRUNTIME/plugin/colorresp.vim plugin normally included with
2901
+ Vim, but can be set manually if you know what you are doing.
2902
+ Note that changing this will not do anything.
2899
2903
2900
- *v:termrfgresp*
2904
+ *v:termrfgresp* *termrfgresp-variable *
2901
2905
v:termrfgresp The escape sequence returned by the terminal for the | t_RF |
2902
2906
termcap entry. This is used to find out what the terminal
2903
- foreground color is. When this option is set, the
2904
- TermResponseAll autocommand event is fired, with <amatch> set
2905
- to "foreground".
2907
+ foreground color is. Behaves the same as | v:termrbgresp |
2906
2908
2907
- *v:termu7resp*
2909
+ *v:termu7resp* *termu7resp-variable *
2908
2910
v:termu7resp The escape sequence returned by the terminal for the | t_u7 |
2909
2911
termcap entry. This is used to find out what the terminal
2910
2912
does with ambiguous width characters, see 'ambiwidth' . When
2911
- this option is set, the TermResponseAll autocommand event is
2913
+ this variable is set, the TermResponseAll autocommand event is
2912
2914
fired, with <amatch> set to "ambiguouswidth".
2913
2915
2916
+ *v:termda1* *termda1-variable*
2917
+ v:termda1 The escape sequence returned by a primary device attributes
2918
+ (DA1) query from the terminal. When this variable is set, the
2919
+ TermResponseAll autocommand event is fired, with <amatch> set
2920
+ to "da1". Can be used to detect OSC 52 support in a terminal.
2921
+
2922
+ *v:termosc* *termosc-variable*
2923
+ v:termosc The escape sequence of the most recent OSC response received
2924
+ from the terminal. When this variable is set, the
2925
+ | TermResponseAll | autocommand event is fired, with <amatch>
2926
+ set to "osc". Also used to set the | v:termrbgresp | and
2927
+ | v:termrfgresp | via the $VIMRUNTIME/plugin/colorresp.vim
2928
+ plugin
2929
+
2914
2930
*v:testing* *testing-variable*
2915
2931
v:testing Must be set before using `test_garbagecollect_now ()` .
2916
2932
Also, when set certain error messages won't be shown for 2
@@ -2978,7 +2994,7 @@ v:vim_did_enter Zero until most of startup is done. It is set to one just
2978
2994
*v:warningmsg* *warningmsg-variable*
2979
2995
v:warningmsg Last given warning message. It's allowed to set this variable.
2980
2996
2981
- *v:wayland_display*
2997
+ *v:wayland_display* *wayland_display-variable *
2982
2998
v:wayland_display
2983
2999
The name of the Wayland display that Vim is connected to.
2984
3000
Equivalent to the $WAYLAND_DISPLAY environment variable.
@@ -3340,7 +3356,8 @@ text...
3340
3356
One or more items from a | List | can be removed: >
3341
3357
:unlet list[3] " remove fourth item
3342
3358
:unlet list[3:] " remove fourth item to last
3343
- < One item from a | Dictionary | can be removed at a time: >
3359
+ < One item from a | Dictionary | can be removed at a time:
3360
+ >
3344
3361
:unlet dict['two']
3345
3362
:unlet dict.two
3346
3363
< This is especially useful to clean up used global
@@ -3471,7 +3488,7 @@ text...
3471
3488
- In | Vim9 | script an error is given.
3472
3489
- In legacy script this is silently ignored.
3473
3490
3474
- :if {expr1} *:if* *:end* *:endif* *:en* *E171* *E579* *E580*
3491
+ :if {expr1} *:if* *:end* *:endif* *:en* *E171* *E579* *E580*
3475
3492
:en[dif] Execute the commands until the next matching `:else `
3476
3493
or `:endif ` if {expr1} evaluates to non-zero.
3477
3494
Although the short forms work, it is recommended to
@@ -3809,8 +3826,9 @@ text...
3809
3826
message in the | message-history | . When used in a
3810
3827
script or function the line number will be added.
3811
3828
Spaces are placed between the arguments as with the
3812
- `:echomsg ` command. When used inside a try conditional,
3813
- the message is raised as an error exception instead
3829
+ `:echomsg ` command. When used inside a try
3830
+ conditional, the message is raised as an error
3831
+ exception instead
3814
3832
(see | try-echoerr | ).
3815
3833
Example: >
3816
3834
:echoerr "This script just failed!"
@@ -5156,8 +5174,8 @@ to execute the given executable. For security reasons users may not want to
5156
5174
have Vim execute random executables or may have forbidden to do so for
5157
5175
specific filetypes by setting the "<filetype> _exec" variable (| plugin_exec | ).
5158
5176
5159
- It returns | true | or | false | to indicate whether the plugin should run the given
5160
- executable. It takes the following arguments:
5177
+ It returns | true | or | false | to indicate whether the plugin should run the
5178
+ given executable. It takes the following arguments:
5161
5179
5162
5180
argument type ~
5163
5181
0 commit comments