Skip to content

Commit c80c220

Browse files
committed
builtin.txt: Update Vim 8.2.4854
1 parent c585344 commit c80c220

File tree

1 file changed

+89
-26
lines changed

1 file changed

+89
-26
lines changed

en/builtin.txt

Lines changed: 89 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim version 8.2. Last change: 2022 Mar 08
1+
*builtin.txt* For Vim version 8.2. Last change: 2022 Apr 25
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -161,7 +161,8 @@ exists_compiled({expr}) Number |TRUE| if {expr} exists at compile time
161161
exp({expr}) Float exponential of {expr}
162162
expand({expr} [, {nosuf} [, {list}]])
163163
any expand special keywords in {expr}
164-
expandcmd({expr}) String expand {expr} like with `:edit`
164+
expandcmd({string} [, {options}])
165+
String expand {string} like with `:edit`
165166
extend({expr1}, {expr2} [, {expr3}])
166167
List/Dict insert items of {expr2} into {expr1}
167168
extendnew({expr1}, {expr2} [, {expr3}])
@@ -294,6 +295,7 @@ inputsecret({prompt} [, {text}]) String like input() but hiding the text
294295
insert({object}, {item} [, {idx}]) List insert {item} in {object} [before {idx}]
295296
interrupt() none interrupt script execution
296297
invert({expr}) Number bitwise invert
298+
isabsolutepath({path}) Number |TRUE| if {path} is an absolute path
297299
isdirectory({directory}) Number |TRUE| if {directory} is a directory
298300
isinf({expr}) Number determine if {expr} is infinity value
299301
(positive or negative)
@@ -336,6 +338,7 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]])
336338
rhs of mapping {name} in mode {mode}
337339
mapcheck({name} [, {mode} [, {abbr}]])
338340
String check for mappings matching {name}
341+
maplist([{abbr}]) List list of all mappings, a dict for each
339342
mapnew({expr1}, {expr2}) List/Dict/Blob/String
340343
like |map()| but creates a new List or
341344
Dictionary
@@ -1562,14 +1565,15 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
15621565
or another valid interrupt key, confirm() returns 0.
15631566

15641567
An example: >
1565-
:let choice = confirm("What do you want?", "&Apples\n&Oranges\n&Bananas", 2)
1566-
:if choice == 0
1567-
: echo "make up your mind!"
1568-
:elseif choice == 3
1569-
: echo "tasteful"
1570-
:else
1571-
: echo "I prefer bananas myself."
1572-
:endif
1568+
let choice = confirm("What do you want?",
1569+
\ "&Apples\n&Oranges\n&Bananas", 2)
1570+
if choice == 0
1571+
echo "make up your mind!"
1572+
elseif choice == 3
1573+
echo "tasteful"
1574+
else
1575+
echo "I prefer bananas myself."
1576+
endif
15731577
< In a GUI dialog, buttons are used. The layout of the buttons
15741578
depends on the 'v' flag in 'guioptions'. If it is included,
15751579
the buttons are always put vertically. Otherwise, confirm()
@@ -1752,7 +1756,10 @@ deepcopy({expr} [, {noref}]) *deepcopy()* *E698*
17521756
17531757
delete({fname} [, {flags}]) *delete()*
17541758
Without {flags} or with {flags} empty: Deletes the file by the
1755-
name {fname}. This also works when {fname} is a symbolic link.
1759+
name {fname}.
1760+
1761+
This also works when {fname} is a symbolic link. The symbolic
1762+
link itself is deleted, not what it points to.
17561763

17571764
When {flags} is "d": Deletes the directory by the name
17581765
{fname}. This fails when directory {fname} is not empty.
@@ -1762,8 +1769,6 @@ delete({fname} [, {flags}]) *delete()*
17621769
Note: on MS-Windows it is not possible to delete a directory
17631770
that is being used.
17641771

1765-
A symbolic link itself is deleted, not what it points to.
1766-
17671772
The result is a Number, which is 0/false if the delete
17681773
operation was successful and -1/true when the deletion failed
17691774
or partly failed.
@@ -2043,7 +2048,7 @@ execute({command} [, {silent}]) *execute()*
20432048
It is not possible to use `:redir` anywhere in {command}.
20442049

20452050
To get a list of lines use |split()| on the result: >
2046-
split(execute('args'), "\n")
2051+
execute('args')->split("\n")
20472052
20482053
< To execute a command in another window than the current one
20492054
use `win_execute()`.
@@ -2234,6 +2239,8 @@ expand({string} [, {nosuf} [, {list}]]) *expand()*
22342239
a function
22352240
<SID> "<SNR>123_" where "123" is the
22362241
current script ID |<SID>|
2242+
<script> sourced script file, or script file
2243+
where the current function was defined
22372244
<stack> call stack
22382245
<cword> word under the cursor
22392246
<cWORD> WORD under the cursor
@@ -2267,6 +2274,9 @@ expand({string} [, {nosuf} [, {list}]]) *expand()*
22672274
is not defined, an empty string is used. Using "%:p" in a
22682275
buffer with no name, results in the current directory, with a
22692276
'/' added.
2277+
When 'verbose' is set then expanding '%', '#' and <> items
2278+
will result in an error message if the argument cannot be
2279+
expanded.
22702280

22712281
When {string} does not start with '%', '#' or '<', it is
22722282
expanded like a file name is expanded on the command line.
@@ -2292,16 +2302,28 @@ expand({string} [, {nosuf} [, {list}]]) *expand()*
22922302
Can also be used as a |method|: >
22932303
Getpattern()->expand()
22942304
2295-
expandcmd({string}) *expandcmd()*
2305+
expandcmd({string} [, {options}]) *expandcmd()*
22962306
Expand special items in String {string} like what is done for
22972307
an Ex command such as `:edit`. This expands special keywords,
22982308
like with |expand()|, and environment variables, anywhere in
22992309
{string}. "~user" and "~/path" are only expanded at the
23002310
start.
2301-
Returns the expanded string. Example: >
2302-
:echo expandcmd('make %<.o')
23032311

2304-
< Can also be used as a |method|: >
2312+
The following items are supported in the {options} Dict
2313+
argument:
2314+
errmsg If set to TRUE, error messages are displayed
2315+
if an error is encountered during expansion.
2316+
By default, error messages are not displayed.
2317+
2318+
Returns the expanded string. If an error is encountered
2319+
during expansion, the unmodified {string} is returned.
2320+
2321+
Example: >
2322+
:echo expandcmd('make %<.o')
2323+
make /path/runtime/doc/builtin.o
2324+
:echo expandcmd('make %<.o', {'errmsg': v:true})
2325+
<
2326+
Can also be used as a |method|: >
23052327
GetCommand()->expandcmd()
23062328
<
23072329
extend({expr1}, {expr2} [, {expr3}]) *extend()*
@@ -2397,7 +2419,8 @@ feedkeys({string} [, {mode}]) *feedkeys()*
23972419
all typeahead will be consumed by the last call.
23982420
'c' Remove any script context when executing, so that
23992421
legacy script syntax applies, "s:var" does not work,
2400-
etc.
2422+
etc. Note that if the keys being using set a script
2423+
context this still applies.
24012424
'!' When used with 'x' will not end Insert mode. Can be
24022425
used in a test when a timer is set to exit Insert mode
24032426
a little later. Useful for testing CursorHoldI.
@@ -2727,7 +2750,7 @@ foreground() Move the Vim window to the foreground. Useful when sent from
27272750
On Win32 systems this might not work, the OS does not always
27282751
allow a window to bring itself to the foreground. Use
27292752
|remote_foreground()| instead.
2730-
{only in the Win32, Athena, Motif and GTK GUI versions and the
2753+
{only in the Win32, Motif and GTK GUI versions and the
27312754
Win32 console version}
27322755

27332756
fullcommand({name}) *fullcommand()*
@@ -4650,6 +4673,24 @@ invert({expr}) *invert()*
46504673
< Can also be used as a |method|: >
46514674
:let bits = bits->invert()
46524675
4676+
isabsolutepath({directory}) *isabsolutepath()*
4677+
The result is a Number, which is |TRUE| when {path} is an
4678+
absolute path.
4679+
< On Unix, a path is considered absolute when it starts with '/'.
4680+
On MS-Windows, it is considered absolute when it starts with an
4681+
optional drive prefix and is followed by a '\' or '/'. UNC paths
4682+
are always absolute.
4683+
Example: >
4684+
echo isabsolutepath('/usr/share/') " 1
4685+
echo isabsolutepath('./foobar') " 0
4686+
echo isabsolutepath('C:\Windows') " 1
4687+
echo isabsolutepath('foobar') " 0
4688+
echo isabsolutepath('\\remote\file') " 1
4689+
4690+
Can also be used as a |method|: >
4691+
GetName()->isabsolutepath()
4692+
4693+
46534694
isdirectory({directory}) *isdirectory()*
46544695
The result is a Number, which is |TRUE| when a directory
46554696
with the name {directory} exists. If {directory} doesn't
@@ -4819,6 +4860,8 @@ json_encode({expr}) *json_encode()*
48194860
Note that NaN and Infinity are passed on as values. This is
48204861
missing in the JSON standard, but several implementations do
48214862
allow it. If not then you will get an error.
4863+
If a string contains an illegal character then the replacement
4864+
character 0xfffd is used.
48224865

48234866
Can also be used as a |method|: >
48244867
GetObject()->json_encode()
@@ -5213,7 +5256,8 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()*
52135256
When {dict} is omitted or zero: Return the rhs of mapping
52145257
{name} in mode {mode}. The returned String has special
52155258
characters translated like in the output of the ":map" command
5216-
listing.
5259+
listing. When {dict} is TRUE a dictionary is returned, see
5260+
below. To get a list of all mappings see |maplist()|.
52175261

52185262
When there is no mapping for {name}, an empty String is
52195263
returned. When the mapping for {name} is empty, then "<Nop>"
@@ -5240,7 +5284,7 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()*
52405284

52415285
When {dict} is there and it is |TRUE| return a dictionary
52425286
containing all the information of the mapping with the
5243-
following items:
5287+
following items: *mapping-dict*
52445288
"lhs" The {lhs} of the mapping as it would be typed
52455289
"lhsraw" The {lhs} of the mapping as raw bytes
52465290
"lhsrawalt" The {lhs} of the mapping as raw bytes, alternate
@@ -5314,6 +5358,18 @@ mapcheck({name} [, {mode} [, {abbr}]]) *mapcheck()*
53145358
GetKey()->mapcheck('n')
53155359
53165360
5361+
maplist([{abbr}]) *maplist()*
5362+
Returns a |List| of all mappings. Each List item is a |Dict|,
5363+
the same as what is returned by |maparg()|, see
5364+
|mapping-dict|. When {abbr} is there and it is |TRUE| use
5365+
abbreviations instead of mappings.
5366+
5367+
Example to show all mappings with 'MultiMatch' in rhs: >
5368+
vim9script
5369+
echo maplist()->filter(
5370+
(_, m) => match(m.rhs, 'MultiMatch') >= 0)
5371+
5372+
53175373
mapnew({expr1}, {expr2}) *mapnew()*
53185374
Like |map()| but instead of replacing items in {expr1} a new
53195375
List or Dictionary is created and returned. {expr1} remains
@@ -5561,14 +5617,16 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()*
55615617

55625618
If {list} is a list of dictionaries, then the optional {dict}
55635619
argument supports the following additional items:
5564-
key key of the item which is fuzzy matched against
5620+
key Key of the item which is fuzzy matched against
55655621
{str}. The value of this item should be a
55665622
string.
55675623
text_cb |Funcref| that will be called for every item
55685624
in {list} to get the text for fuzzy matching.
55695625
This should accept a dictionary item as the
55705626
argument and return the text for that item to
55715627
use for fuzzy matching.
5628+
limit Maximum number of matches in {list} to be
5629+
returned. Zero means no limit.
55725630

55735631
{str} is treated as a literal string and regular expression
55745632
matching is NOT supported. The maximum supported {str} length
@@ -5581,6 +5639,9 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()*
55815639
empty list is returned. If length of {str} is greater than
55825640
256, then returns an empty list.
55835641

5642+
When {limit} is given, matchfuzzy() will find up to this
5643+
number of matches in {list} and return them in sorted order.
5644+
55845645
Refer to |fuzzy-matching| for more information about fuzzy
55855646
matching strings.
55865647

@@ -6009,8 +6070,10 @@ printf({fmt}, {expr1} ...) *printf()*
60096070
When used as a |method| the base is passed as the second
60106071
argument: >
60116072
Compute()->printf("result: %d")
6073+
<
6074+
You can use `call()` to pass the items as a list.
60126075

6013-
< Often used items are:
6076+
Often used items are:
60146077
%s string
60156078
%6S string right-aligned in 6 display cells
60166079
%6s string right-aligned in 6 bytes
@@ -6679,7 +6742,7 @@ remote_foreground({server}) *remote_foreground()*
66796742
Can also be used as a |method|: >
66806743
ServerName()->remote_foreground()
66816744
6682-
< {only in the Win32, Athena, Motif and GTK GUI versions and the
6745+
< {only in the Win32, Motif and GTK GUI versions and the
66836746
Win32 console version}
66846747

66856748

@@ -10011,7 +10074,7 @@ footer Compiled with GUI footer support. |gui-footer|
1001110074
fork Compiled to use fork()/exec() instead of system().
1001210075
gettext Compiled with message translation |multi-lang|
1001310076
gui Compiled with GUI enabled.
10014-
gui_athena Compiled with Athena GUI.
10077+
gui_athena Compiled with Athena GUI (always false).
1001510078
gui_gnome Compiled with Gnome support (gui_gtk is also defined).
1001610079
gui_gtk Compiled with GTK+ GUI (any version).
1001710080
gui_gtk2 Compiled with GTK+ 2 GUI (gui_gtk is also defined).

0 commit comments

Comments
 (0)