|
1 | | -*builtin.txt* For Vim version 9.1. Last change: 2025 Aug 12 |
| 1 | +*builtin.txt* For Vim version 9.1. Last change: 2025 Aug 20 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -344,7 +344,7 @@ isinf({expr}) Number determine if {expr} is infinity value |
344 | 344 | (positive or negative) |
345 | 345 | islocked({expr}) Number |TRUE| if {expr} is locked |
346 | 346 | isnan({expr}) Number |TRUE| if {expr} is NaN |
347 | | -items({dict}) List key-value pairs in {dict} |
| 347 | +items({expr}) List key-value pairs in {expr} |
348 | 348 | job_getchannel({job}) Channel get the channel handle for {job} |
349 | 349 | job_info([{job}]) Dict get information about {job} |
350 | 350 | job_setoptions({job}, {options}) none set options for {job} |
@@ -6310,20 +6310,25 @@ isnan({expr}) *isnan()* |
6310 | 6310 | Return type: |Number| |
6311 | 6311 |
|
6312 | 6312 |
|
6313 | | -items({dict}) *items()* |
6314 | | - Return a |List| with all the key-value pairs of {dict}. Each |
6315 | | - |List| item is a list with two items: the key of a {dict} |
6316 | | - entry and the value of this entry. The |List| is in arbitrary |
6317 | | - order. Also see |keys()| and |values()|. |
6318 | | - Example: > |
| 6313 | +items({expr}) *items()* |
| 6314 | + Return a |List| with all key/index and value pairs of {expr}. |
| 6315 | + Each |List| item is a list with two items: |
| 6316 | + - for a |Dict|: the key and the value |
| 6317 | + - for a |List|, |Tuple| or |String|: the index and the value |
| 6318 | + The returned |List| is in arbitrary order for a |Dict|, |
| 6319 | + otherwise it's in ascending order of the index. |
| 6320 | + |
| 6321 | + Also see |keys()| and |values()|. |
| 6322 | + |
| 6323 | + Examples: > |
| 6324 | + let mydict = #{a: 'red', b: 'blue'} |
6319 | 6325 | for [key, value] in items(mydict) |
6320 | | - echo key .. ': ' .. value |
| 6326 | + echo $"{key} = {value}" |
6321 | 6327 | endfor |
| 6328 | + echo items([1, 2, 3]) |
| 6329 | + echo items(('a', 'b', 'c')) |
| 6330 | + echo items("foobar") |
6322 | 6331 | < |
6323 | | - A |List|, a |Tuple| or a |String| argument is also supported. |
6324 | | - In these cases, items() returns a List with the index and the |
6325 | | - value at the index. |
6326 | | - |
6327 | 6332 | Can also be used as a |method|: > |
6328 | 6333 | mydict->items() |
6329 | 6334 | < |
@@ -13042,6 +13047,7 @@ scrollbind Compiled with 'scrollbind' support. (always true) |
13042 | 13047 | showcmd Compiled with 'showcmd' support. |
13043 | 13048 | signs Compiled with |:sign| support. |
13044 | 13049 | smartindent Compiled with 'smartindent' support. (always true) |
| 13050 | +socketserver Compiled with socket server functionality. (Unix only) |
13045 | 13051 | sodium Compiled with libsodium for better crypt support |
13046 | 13052 | sound Compiled with sound support, e.g. `sound_playevent()` |
13047 | 13053 | spell Compiled with spell checking support |spell|. |
|
0 commit comments