|
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 24 |
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/index-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}
|
@@ -747,6 +747,8 @@ undofile({name}) String undo file name for {name}
|
747 | 747 | undotree([{buf}]) List undo file tree for buffer {buf}
|
748 | 748 | uniq({list} [, {func} [, {dict}]])
|
749 | 749 | List remove adjacent duplicates from a list
|
| 750 | +uri_decode({string}) String URI-decode a string |
| 751 | +uri_encode({string}) String URI-encode a string |
750 | 752 | utf16idx({string}, {idx} [, {countcc} [, {charidx}]])
|
751 | 753 | Number UTF-16 index of byte {idx} in {string}
|
752 | 754 | values({dict}) List values in {dict}
|
@@ -6310,20 +6312,27 @@ isnan({expr}) *isnan()*
|
6310 | 6312 | Return type: |Number|
|
6311 | 6313 |
|
6312 | 6314 |
|
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: > |
| 6315 | +items({expr}) *items()* |
| 6316 | + Return a |List| with all key/index and value pairs of {expr}. |
| 6317 | + Each |List| item is a list with two items: |
| 6318 | + - for a |Dict|: the key and the value |
| 6319 | + - for a |List|, |Tuple|, |Blob| or |String|: the index and the |
| 6320 | + value |
| 6321 | + The returned |List| is in arbitrary order for a |Dict|, |
| 6322 | + otherwise it's in ascending order of the index. |
| 6323 | + |
| 6324 | + Also see |keys()| and |values()|. |
| 6325 | + |
| 6326 | + Examples: > |
| 6327 | + let mydict = #{a: 'red', b: 'blue'} |
6319 | 6328 | for [key, value] in items(mydict)
|
6320 |
| - echo key .. ': ' .. value |
| 6329 | + echo $"{key} = {value}" |
6321 | 6330 | endfor
|
| 6331 | + echo items([1, 2, 3]) |
| 6332 | + echo items(('a', 'b', 'c')) |
| 6333 | + echo items("foobar") |
| 6334 | + echo items(0z0102) |
6322 | 6335 | <
|
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 | 6336 | Can also be used as a |method|: >
|
6328 | 6337 | mydict->items()
|
6329 | 6338 | <
|
@@ -7617,7 +7626,7 @@ max({expr}) *max()*
|
7617 | 7626 | Can also be used as a |method|: >
|
7618 | 7627 | mylist->max()
|
7619 | 7628 | <
|
7620 |
| - Return type: |Number| |
| 7629 | + Return type: any, depending on {expr} |
7621 | 7630 |
|
7622 | 7631 |
|
7623 | 7632 | menu_info({name} [, {mode}]) *menu_info()*
|
@@ -7709,7 +7718,7 @@ min({expr}) *min()*
|
7709 | 7718 | Can also be used as a |method|: >
|
7710 | 7719 | mylist->min()
|
7711 | 7720 | <
|
7712 |
| - Return type: |Number| |
| 7721 | + Return type: any, depending on {expr} |
7713 | 7722 |
|
7714 | 7723 |
|
7715 | 7724 | mkdir({name} [, {flags} [, {prot}]]) *mkdir()* *E739*
|
@@ -12180,6 +12189,59 @@ uniq({list} [, {func} [, {dict}]]) *uniq()* *E882*
|
12180 | 12189 | Return type: list<{type}>
|
12181 | 12190 |
|
12182 | 12191 |
|
| 12192 | +uri_decode({string}) *uri_decode()* |
| 12193 | + Returns the URI-decoded form of {string}, reversing |
| 12194 | + percent-encoding (converting sequences like "%3D" back to |
| 12195 | + the corresponding character). |
| 12196 | + |
| 12197 | + The decoding follows standard percent-decoding rules: |
| 12198 | + - "%HH" is replaced with the character for the hex value |
| 12199 | + HH. |
| 12200 | + - If the decoded bytes form valid UTF-8, they are combined |
| 12201 | + into the corresponding character(s). Otherwise, the |
| 12202 | + bytes are kept as-is. |
| 12203 | + - Invalid or incomplete encodings (e.g. "%GZ", "%3", or a |
| 12204 | + trailing "%") are left unchanged. |
| 12205 | + |
| 12206 | + Returns an empty String if {string} is empty. |
| 12207 | + |
| 12208 | + Example: > |
| 12209 | + :echo uri_decode('c%3A%5Cmy%5Cdir%5Cfoo%20bar') |
| 12210 | + c:\my\dir\foo bar |
| 12211 | + :echo uri_decode('%CE%B1%CE%B2%CE%B3') |
| 12212 | + αβγ |
| 12213 | +< |
| 12214 | + Can also be used as a |method|: > |
| 12215 | + mystr->uri_decode() |
| 12216 | +< |
| 12217 | + Return type: |String| |
| 12218 | + |
| 12219 | +uri_encode({string}) *uri_encode()* |
| 12220 | + Returns the URI-encoded form of {string}. URI encoding |
| 12221 | + replaces unsafe or reserved characters with percent-encoded |
| 12222 | + sequences. |
| 12223 | + |
| 12224 | + The encoding follows standard percent-encoding rules: |
| 12225 | + - Alphanumeric characters [0-9A-Za-z] remain unchanged. |
| 12226 | + - The characters "-", "_", ".", and "~" also remain |
| 12227 | + unchanged. |
| 12228 | + - All other characters are replaced with "%HH", where HH |
| 12229 | + is the two-digit uppercase hexadecimal value. |
| 12230 | + - Existing percent-encoded sequences are not modified. |
| 12231 | + |
| 12232 | + Returns an empty String if {string} is empty. |
| 12233 | + |
| 12234 | + Example: > |
| 12235 | + :echo uri_encode('c:\my\dir\foo bar') |
| 12236 | + c%3A%5Cmy%5Cdir%5Cfoo%20bar |
| 12237 | + :echo uri_encode('key=value&name=αβγ') |
| 12238 | + key%3Dvalue%26name%3D%CE%B1%CE%B2%CE%B3 |
| 12239 | +< |
| 12240 | + Can also be used as a |method|: > |
| 12241 | + mystr->uri_encode() |
| 12242 | +< |
| 12243 | + Return type: |String| |
| 12244 | + |
12183 | 12245 | *utf16idx()*
|
12184 | 12246 | utf16idx({string}, {idx} [, {countcc} [, {charidx}]])
|
12185 | 12247 | Same as |charidx()| but returns the UTF-16 code unit index of
|
@@ -13042,6 +13104,7 @@ scrollbind Compiled with 'scrollbind' support. (always true)
|
13042 | 13104 | showcmd Compiled with 'showcmd' support.
|
13043 | 13105 | signs Compiled with |:sign| support.
|
13044 | 13106 | smartindent Compiled with 'smartindent' support. (always true)
|
| 13107 | +socketserver Compiled with socket server functionality. (Unix only) |
13045 | 13108 | sodium Compiled with libsodium for better crypt support
|
13046 | 13109 | sound Compiled with sound support, e.g. `sound_playevent()`
|
13047 | 13110 | spell Compiled with spell checking support |spell|.
|
|
0 commit comments