summaryrefslogtreecommitdiffstats
path: root/runtime/doc
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2024-06-09 00:13:43 +0200
committerChristian Brabandt <cb@256bit.org>2024-06-09 00:19:16 +0200
commit5674c9a7de503d5e798055a5e1115343ff885221 (patch)
tree6c9ce53a98310927d9839bcc71d6b4116047b538 /runtime/doc
parent4032daaa11f090421a417af7dfe962960c1aa97f (diff)
runtime(doc): add return type info for Vim function descriptions
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/builtin.txt1358
-rw-r--r--runtime/doc/channel.txt61
-rw-r--r--runtime/doc/popup.txt47
-rw-r--r--runtime/doc/sign.txt33
-rw-r--r--runtime/doc/tags1
-rw-r--r--runtime/doc/terminal.txt64
-rw-r--r--runtime/doc/testing.txt71
-rw-r--r--runtime/doc/textprop.txt36
8 files changed, 1526 insertions, 145 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 782c42f74a..2ed94ea932 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1,4 +1,4 @@
-*builtin.txt* For Vim version 9.1. Last change: 2024 Jun 03
+*builtin.txt* For Vim version 9.1. Last change: 2024 Jun 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -769,6 +769,7 @@ xor({expr}, {expr}) Number bitwise XOR
Not all functions are here, some have been moved to a help file covering the
specific functionality.
+Return type specifies the type for |Vim9-script|, see |vim9-types|
abs({expr}) *abs()*
Return the absolute value of {expr}. When {expr} evaluates to
@@ -785,6 +786,8 @@ abs({expr}) *abs()*
Can also be used as a |method|: >
Compute()->abs()
+<
+ Return type: |Number| or |Float| depending on {expr}
acos({expr}) *acos()*
@@ -800,6 +803,8 @@ acos({expr}) *acos()*
Can also be used as a |method|: >
Compute()->acos()
+<
+ Return type: |Float|
add({object}, {expr}) *add()*
@@ -815,6 +820,9 @@ add({object}, {expr}) *add()*
Can also be used as a |method|: >
mylist->add(val1)->add(val2)
+<
+ Return type: list<{type}> (depending on the given |List|) or
+ |Blob|
and({expr}, {expr}) *and()*
@@ -825,6 +833,8 @@ and({expr}, {expr}) *and()*
:let flag = and(bits, 0x80)
< Can also be used as a |method|: >
:let flag = bits->and(0x80)
+<
+ Return type: |Number|
append({lnum}, {text}) *append()*
@@ -846,6 +856,8 @@ append({lnum}, {text}) *append()*
< Can also be used as a |method| after a List, the base is
passed as the second argument: >
mylist->append(lnum)
+<
+ Return type: |Number|
appendbufline({buf}, {lnum}, {text}) *appendbufline()*
@@ -873,6 +885,8 @@ appendbufline({buf}, {lnum}, {text}) *appendbufline()*
Can also be used as a |method| after a List, the base is
passed as the second argument: >
mylist->appendbufline(buf, lnum)
+<
+ Return type: |Number|
argc([{winid}]) *argc()*
@@ -885,10 +899,14 @@ argc([{winid}]) *argc()*
list is used: either the window number or the window ID.
Returns -1 if the {winid} argument is invalid.
+ Return type: |Number|
+
*argidx()*
argidx() The result is the current index in the argument list. 0 is
the first file. argc() - 1 is the last one. See |arglist|.
+ Return type: |Number|
+
*arglistid()*
arglistid([{winnr} [, {tabnr}]])
Return the argument list ID. This is a number which
@@ -902,6 +920,8 @@ arglistid([{winnr} [, {tabnr}]])
page.
{winnr} can be the window number or the |window-ID|.
+ Return type: |Number|
+
*argv()*
argv([{nr} [, {winid}]])
The result is the {nr}th file in the argument list. See
@@ -922,6 +942,9 @@ argv([{nr} [, {winid}]])
the argument list. Returns an empty List if the {winid}
argument is invalid.
+ Return type: |String|
+
+
asin({expr}) *asin()*
Return the arc sine of {expr} measured in radians, as a |Float|
in the range of [-pi/2, pi/2].
@@ -937,12 +960,12 @@ asin({expr}) *asin()*
Can also be used as a |method|: >
Compute()->asin()
-
+<
+ Return type: |Float|
assert_ functions are documented here: |assert-functions-details|
-
atan({expr}) *atan()*
Return the principal value of the arc tangent of {expr}, in
the range [-pi/2, +pi/2] radians, as a |Float|.
@@ -956,6 +979,8 @@ atan({expr}) *atan()*
Can also be used as a |method|: >
Compute()->atan()
+<
+ Return type: |Float|
atan2({expr1}, {expr2}) *atan2()*
@@ -972,6 +997,8 @@ atan2({expr1}, {expr2}) *atan2()*
Can also be used as a |method|: >
Compute()->atan2(1)
+<
+ Return type: |Float|
autocmd_add({acmds}) *autocmd_add()*
@@ -1019,6 +1046,9 @@ autocmd_add({acmds}) *autocmd_add()*
Can also be used as a |method|: >
GetAutocmdList()->autocmd_add()
<
+ Return type: |vim9-boolean|
+
+
autocmd_delete({acmds}) *autocmd_delete()*
Deletes a List of autocmds and autocmd groups.
@@ -1067,6 +1097,9 @@ autocmd_delete({acmds}) *autocmd_delete()*
<
Can also be used as a |method|: >
GetAutocmdList()->autocmd_delete()
+<
+ Return type: |vim9-boolean|
+
autocmd_get([{opts}]) *autocmd_get()*
Returns a |List| of autocmds. If {opts} is not supplied, then
@@ -1125,11 +1158,17 @@ autocmd_get([{opts}]) *autocmd_get()*
Can also be used as a |method|: >
Getopts()->autocmd_get()
<
+ Return type: list<dict<any>>
+
+
balloon_gettext() *balloon_gettext()*
Return the current text in the balloon. Only for the string,
not used for the List. Returns an empty string if balloon
is not present.
+ Return type: |String|
+
+
balloon_show({expr}) *balloon_show()*
Show {expr} inside the balloon. For the GUI {expr} is used as
a string. For a terminal {expr} can be a list, which contains
@@ -1161,6 +1200,9 @@ balloon_show({expr}) *balloon_show()*
{only available when compiled with the |+balloon_eval| or
|+balloon_eval_term| feature}
+ Return type: |Number|
+
+
balloon_split({msg}) *balloon_split()*
Split String {msg} into lines to be displayed in a balloon.
The splits are made for the current window size and optimize
@@ -1173,6 +1215,9 @@ balloon_split({msg}) *balloon_split()*
< {only available when compiled with the |+balloon_eval_term|
feature}
+ Return type: list<any> or list<string>
+
+
blob2list({blob}) *blob2list()*
Return a List containing the number value of each byte in Blob
{blob}. Examples: >
@@ -1184,6 +1229,8 @@ blob2list({blob}) *blob2list()*
Can also be used as a |method|: >
GetBlob()->blob2list()
<
+ Return type: list<any> or list<number>
+
*browse()*
browse({save}, {title}, {initdir}, {default})
Put up a file requester. This only works when "has("browse")"
@@ -1196,8 +1243,10 @@ browse({save}, {title}, {initdir}, {default})
An empty string is returned when the "Cancel" button is hit,
something went wrong, or browsing is not possible.
- *browsedir()*
-browsedir({title}, {initdir})
+ Return type: |String|
+
+
+browsedir({title}, {initdir}) *browsedir()*
Put up a directory requester. This only works when
"has("browse")" returns |TRUE| (only in some GUI versions).
On systems where a directory browser is not supported a file
@@ -1209,6 +1258,9 @@ browsedir({title}, {initdir})
When the "Cancel" button is hit, something went wrong, or
browsing is not possible, an empty string is returned.
+ Return type: |String|
+
+
bufadd({name}) *bufadd()*
Add a buffer to the buffer list with name {name} (must be a
String).
@@ -1224,6 +1276,9 @@ bufadd({name}) *bufadd()*
< Returns 0 on error.
Can also be used as a |method|: >
let bufnr = 'somename'->bufadd()
+<
+ Return type: |Number|
+
bufexists({buf}) *bufexists()*
The result is a Number, which is |TRUE| if a buffer called
@@ -1250,8 +1305,11 @@ bufexists({buf}) *bufexists()*
Can also be used as a |method|: >
let exists = 'somename'->bufexists()
<
+ Return type: |Number|
+
Obsolete name: buffer_exists(). *buffer_exists()*
+
buflisted({buf}) *buflisted()*
The result is a Number, which is |TRUE| if a buffer called
{buf} exists and is listed (has the 'buflisted' option set).
@@ -1259,6 +1317,9 @@ buflisted({buf}) *buflisted()*
Can also be used as a |method|: >
let listed = 'somename'->buflisted()
+<
+ Return type: |Number|
+
bufload({buf}) *bufload()*
Ensure the buffer {buf} is loaded. When the buffer name
@@ -1272,6 +1333,9 @@ bufload({buf}) *bufload()*
Can also be used as a |method|: >
eval 'somename'->bufload()
+<
+ Return type: |Number|
+
bufloaded({buf}) *bufloaded()*
The result is a Number, which is |TRUE| if a buffer called
@@ -1280,6 +1344,9 @@ bufloaded({buf}) *bufloaded()*
Can also be used as a |method|: >
let loaded = 'somename'->bufloaded()
+<
+ Return type: |Number|
+
bufname([{buf}]) *bufname()*
The result is the name of a buffer. Mostly as it is displayed
@@ -1313,11 +1380,13 @@ bufname([{buf}]) *bufname()*
bufname(3) name of buffer 3
bufname("%") name of current buffer
bufname("file2") name of buffer where "file2" matches.
-< *buffer_name()*
+<
+ Return type: |String|
+ *buffer_name()*
Obsolete name: buffer_name().
- *bufnr()*
-bufnr([{buf} [, {create}]])
+
+bufnr([{buf} [, {create}]]) *bufnr()*
The result is the number of a buffer, as it is displayed by
the `:ls` command. For the use of {buf}, see |bufname()|
above.
@@ -1339,10 +1408,13 @@ bufnr([{buf} [, {create}]])
Can also be used as a |method|: >
echo bufref->bufnr()
<
+ Return type: |Number|
+
Obsolete name: buffer_number(). *buffer_number()*
*last_buffer_nr()*
Obsolete name for bufnr("$"): last_buffer_nr().
+
bufwinid({buf}) *bufwinid()*
The result is a Number, which is the |window-ID| of the first
window associated with buffer {buf}. For the use of {buf},
@@ -1356,6 +1428,9 @@ bufwinid({buf}) *bufwinid()*
Can also be used as a |method|: >
FindBuffer()->bufwinid()
+<
+ Return type: |Number|
+
bufwinnr({buf}) *bufwinnr()*
Like |bufwinid()| but return the window number instead of the
@@ -1370,6 +1445,9 @@ bufwinnr({buf}) *bufwinnr()*
Can also be used as a |method|: >
FindBuffer()->bufwinnr()
+<
+ Return type: |Number|
+
byte2line({byte}) *byte2line()*
Return the line number that contains the character at byte
@@ -1383,10 +1461,13 @@ byte2line({byte}) *byte2line()*
Can also be used as a |method|: >
GetOffset()->byte2line()
+<
+ Return type: |Number|
-< {not available when compiled without the |+byte_offset|
+ {not available when compiled without the |+byte_offset|
feature}
+
byteidx({expr}, {nr} [, {utf16}]) *byteidx()*
Return byte index of the {nr}'th character in the String
{expr}. Use zero for the first character, it then returns
@@ -1424,6 +1505,9 @@ byteidx({expr}, {nr} [, {utf16}]) *byteidx()*
<
Can also be used as a |method|: >
GetName()->byteidx(idx)
+<
+ Return type: |Number|
+
byteidxcomp({expr}, {nr} [, {utf16}]) *byteidxcomp()*
Like byteidx(), except that a composing character is counted
@@ -1440,6 +1524,9 @@ byteidxcomp({expr}, {nr} [, {utf16}]) *byteidxcomp()*
Can also be used as a |method|: >
GetName()->byteidxcomp(idx)
+<
+ Return type: |Number|
+
call({func}, {arglist} [, {dict}]) *call()* *E699*
Call function {func} with the items in |List| {arglist} as
@@ -1452,6 +1539,9 @@ call({func}, {arglist} [, {dict}]) *call()* *E699*
Can also be used as a |method|: >
GetFunc()->call([arg, arg], dict)
+<
+ Return type: any, depending on {func}
+
ceil({expr}) *ceil()*
Return the smallest integral value greater than or equal to
@@ -1469,6 +1559,8 @@ ceil({expr}) *ceil()*
Can also be used as a |method|: >
Compute()->ceil()
+<
+ Return type: |Float|
ch_ functions are documented here: |channel-functions-details|
@@ -1483,6 +1575,9 @@ changenr() *changenr()*
one less than the number of the undone change.
Returns 0 if the undo list is empty.
+ Return type: |Number|
+
+
char2nr({string} [, {utf8}]) *char2nr()*
Return Number value of the first char in {string}.
Examples: >
@@ -1504,6 +1599,9 @@ char2nr({string} [, {utf8}]) *char2nr()*
Can also be used as a |method|: >
GetChar()->char2nr()
+<
+ Return type: |Number|
+
charclass({string}) *charclass()*
Return the character class of the first character in {string}.
@@ -1516,6 +1614,8 @@ charclass({string}) *charclass()*
The class is used in patterns and word motions.
Returns 0 if {string} is not a |String|.
+ Return type: |Number|
+
charcol({expr} [, {winid}]) *charcol()*
Same as |col()| but returns the character index of the column
@@ -1529,6 +1629,8 @@ charcol({expr} [, {winid}]) *charcol()*
< Can also be used as a |method|: >
GetPos()->col()
<
+ Return type: |Number|
+
*charidx()*
charidx({string}, {idx} [, {countcc} [, {utf16}]])
Return the character index of the byte at {idx} in {string}.
@@ -1565,6 +1667,9 @@ charidx({string}, {idx} [, {countcc} [, {utf16}]])
<
Can also be used as a |method|: >
GetName()->charidx(idx)
+<
+ Return type: |Number|
+
chdir({dir}) *chdir()*
Change the current working directory to {dir}. The scope of
@@ -1591,6 +1696,9 @@ chdir({dir}) *chdir()*
< Can also be used as a |method|: >
GetDir()->chdir()
<
+ Return type: |String|
+
+
cindent({lnum}) *cindent()*
Get the amount of indent for line {lnum} according the C
indenting rules, as with 'cindent'.
@@ -1601,6 +1709,9 @@ cindent({lnum}) *cindent()*
Can also be used as a |method|: >
GetLnum()->cindent()
+<
+ Return type: |Number|
+
clearmatches([{win}]) *clearmatches()*
Clears all matches previously defined for the current window
@@ -1611,6 +1722,9 @@ clearmatches([{win}]) *clearmatches()*
Can also be used as a |method|: >
GetWin()->clearmatches()
<
+ Return type: |Number|
+
+
col({expr} [, {winid}]) *col()*
The result is a Number, which is the byte index of the column
position given with {expr}. The accepted positions are:
@@ -1652,6 +1766,8 @@ col({expr} [, {winid}]) *col()*
< Can also be used as a |method|: >
GetPos()->col()
<
+ Return type: |Number|
+
complete({startcol}, {matches}) *complete()* *E785*
Set the matches for Insert mode completion.
@@ -1686,6 +1802,9 @@ complete({startcol}, {matches}) *complete()* *E785*
Can also be used as a |method|, the base is passed as the
second argument: >
GetMatches()->complete(col('.'))
+<
+ Return type: |Number|
+
complete_add({expr}) *complete_add()*
Add {expr} to the list of matches. Only to be used by the
@@ -1698,6 +1817,9 @@ complete_add({expr}) *complete_add()*
Can also be used as a |method|: >
GetMoreMatches()->complete_add()
+<
+ Return type: |Number|
+
complete_check() *complete_check()*
Check for a key typed while looking for completion matches.
@@ -1707,6 +1829,8 @@ complete_check() *complete_check()*
Only to be used by the function specified with the
'completefunc' option.
+ Return type: |Number|
+
complete_info([{what}]) *complete_info()*
Returns a |Dictionary| with information about Insert mode
@@ -1769,6 +1893,8 @@ complete_info([{what}]) *complete_info()*
< Can also be used as a |method|: >
GetItems()->complete_info()
<
+ Return type: dict<any>
+
*confirm()*
confirm({msg} [, {choices} [, {default} [, {type}]]])
confirm() offers the user a dialog, from which a choice can be
@@ -1828,8 +1954,11 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
Can also be used as a |method|in: >
BuildMessage()->confirm("&Yes\n&No")
<
- *copy()*
-copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't
+ Return type: |Number|
+
+
+copy({expr}) *copy()*
+ Make a copy of {expr}. For Numbers and Strings this isn't
different from using {expr} directly.
When {expr} is a |List| a shallow copy is created. This means
that the original |List| can be changed without changing the
@@ -1839,6 +1968,9 @@ copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't
Also see |deepcopy()|.
Can also be used as a |method|: >
mylist->copy()
+<
+ Return type: any, depending on {expr}
+
cos({expr}) *cos()*
Return the cosine of {expr}, measured in radians, as a |Float|.
@@ -1852,6 +1984,8 @@ cos({expr}) *cos()*
Can also be used as a |method|: >
Compute()->cos()
+<
+ Return type: |Float|
cosh({expr}) *cosh()*
@@ -1867,6 +2001,8 @@ cosh({expr}) *cosh()*
Can also be used as a |method|: >
Compute()->cosh()
+<
+ Return type: |Float|
count({comp}, {expr} [, {ic} [, {start}]]) *count()* *E706*
@@ -1885,6 +2021,8 @@ count({comp}, {expr} [, {ic} [, {start}]]) *count()* *E706*
Can also be used as a |method|: >
mylist->count(val)
<
+ Return type: |Number|
+
*cscope_connection()*
cscope_connection([{num} , {dbpath} [, {prepend}]])
Checks for the existence of a |cscope| connection. If no
@@ -1926,6 +2064,9 @@ cscope_connection([{num} , {dbpath} [, {prepend}]])
cscope_connection(4, "out", "local") 0
cscope_connection(4, "cscope.out", "/usr/local") 1
<
+ Return type: |Number|
+
+
cursor({lnum}, {col} [, {off}]) *cursor()*
cursor({list})
Positions the cursor at the column (byte count) {col} in the
@@ -1961,6 +2102,9 @@ cursor({list})
Can also be used as a |method|: >
GetCursorPos()->cursor()
+<
+ Return type: |Number|
+
debugbreak({pid}) *debugbreak()*
Specifically used to interrupt a program being debugged. It
@@ -1973,6 +2117,9 @@ debugbreak({pid}) *debugbreak()*
Can also be used as a |method|: >
GetPid()->debugbreak()
+<
+ Return type: |Number|
+
deepcopy({expr} [, {noref}]) *deepcopy()* *E698*
Make a copy of {expr}. For Numbers and Strings this isn't
@@ -1998,6 +2145,9 @@ deepcopy({expr} [, {noref}]) *deepcopy()* *E698*
Can also be used as a |method|: >
GetObject()->deepcopy()
+<
+ Return type: any, depending on {expr}
+
delete({fname} [, {flags}]) *delete()*
Without {flags} or with {flags} empty: Deletes the file by the
@@ -2024,6 +2174,9 @@ delete({fname} [, {flags}]) *delete()*
Can also be used as a |method|: >
GetName()->delete()
+<
+ Return type: |Number|
+
deletebufline({buf}, {first} [, {last}]) *deletebufline()*
Delete lines {first} to {last} (inclusive) from buffer {buf}.
@@ -2042,6 +2195,8 @@ deletebufline({buf}, {first} [, {last}]) *deletebufline()*
Can also be used as a |method|: >
GetBuffer()->deletebufline(1)
<
+ Return type: |Number|
+
*did_filetype()*
did_filetype() Returns |TRUE| when autocommands are being executed and the
FileType event has been triggered at least once. Can be used
@@ -2054,6 +2209,9 @@ did_filetype() Returns |TRUE| when autocommands are being executed and the
editing another buffer to set 'filetype' and load a syntax
file.
+ Return type: |Number|
+
+
diff({fromlist}, {tolist} [, {options}]) *diff()*
Returns a String or a List containing the diff between the
strings in {fromlist} and {tolist}. Uses the Vim internal
@@ -2120,6 +2278,10 @@ diff({fromlist}, {tolist} [, {options}]) *diff()*
Can also be used as a |method|: >
GetFromList->diff(to_list)
<
+ Return type: |String| or list<dict<number>> or list<any>
+ depending on {options}
+
+
diff_filler({lnum}) *diff_filler()*
Returns the number of filler lines above line {lnum}.
These are the lines that were inserted at this point in
@@ -2131,6 +2293,9 @@ diff_filler({lnum}) *diff_filler()*
Can also be used as a |method|: >
GetLnum()->diff_filler()
+<
+ Return type: |Number|
+
diff_hlID({lnum}, {col}) *diff_hlID()*
Returns the highlight ID for diff mode at line {lnum} column
@@ -2146,6 +2311,8 @@ diff_hlID({lnum}, {col}) *diff_hlID()*
Can also be used as a |method|: >
GetLnum()->diff_hlID(col)
<
+ Return type: |Number|
+
digraph_get({chars}) *digraph_get()* *E1214*
Return the digraph of {chars}. This should be a string with
@@ -2170,6 +2337,8 @@ digraph_get({chars}) *digraph_get()* *E1214*
Can also be used as a |method|: >
GetChars()->digraph_get()
<
+ Return type: |String|
+
This function works only when compiled with the |+digraphs|
feature. If this feature is disabled, this function will
display an error message.
@@ -2196,6 +2365,8 @@ digraph_getlist([{listall}]) *digraph_getlist()*
Can also be used as a |method|: >
GetNumber()->digraph_getlist()
<
+ Return type: list<list<string>>
+
This function works only when compiled with the |+digraphs|
feature. If this feature is disabled, this function will
display an error message.
@@ -2209,7 +2380,7 @@ digraph_set({chars}, {digraph}) *digraph_set()*
function is similar to |:digraphs| command, but useful to add
digraphs start with a white space.
- The function result is v:true if |digraph| is registered. If
+ The function returns v:true if |digraph| is registered. If
this fails an error message is given and v:false is returned.
If you want to define multiple digraphs at once, you can use
@@ -2221,6 +2392,8 @@ digraph_set({chars}, {digraph}) *digraph_set()*
Can be used as a |method|: >
GetString()->digraph_set('あ')
<
+ Return type: |vim9-boolean|
+
This function works only when compiled with the |+digraphs|
feature. If this feature is disabled, this function will
display an error message.
@@ -2244,6 +2417,8 @@ digraph_setlist({digraphlist}) *digraph_setlist()*
Can be used as a |method|: >
GetList()->digraph_setlist()
<
+ Return type: |vim9-boolean|
+
This function works only when compiled with the |+digraphs|
feature. If this feature is disabled, this function will
display an error message.
@@ -2258,6 +2433,8 @@ echoraw({string}) *echoraw()*
call echoraw(&t_TI)
< Use with care, you can mess up the terminal this way.
+ Return type: |Number|
+
empty({expr}) *empty()*
Return the Number 1 if {expr} is empty, zero otherwise.
@@ -2277,6 +2454,9 @@ empty({expr}) *empty()*
Can also be used as a |method|: >
mylist->empty()
+<
+ Return type: |Number|
+
environ() *environ()*
Return all of environment variables as dictionary. You can
@@ -2285,6 +2465,8 @@ environ() *environ()*
< Note that the variable name may be CamelCase; to ignore case
use this: >
:echo index(keys(environ()), 'HOME', 0, 1) != -1
+<
+ Return type: dict<string>
err_teapot([{expr}]) *err_teapot()*
@@ -2294,6 +2476,8 @@ err_teapot([{expr}]) *err_teapot()*
indicating that coffee is temporarily not available.
If {expr} is present it must be a String.
+ Return type: |Number|
+
escape({string}, {chars}) *escape()*
Escape the characters in {chars} that occur in {string} with a
@@ -2306,6 +2490,8 @@ escape({string}, {chars}) *escape()*
Can also be used as a |method|: >
GetText()->escape(' \')
<
+ Return type: |String|
+
*eval()*
eval({string}) Evaluate {string} and return the result. Especially useful to
turn the result of |string()| back into the original value.
@@ -2316,6 +2502,9 @@ eval({string}) Evaluate {string} and return the result. Especially useful to
Can also be used as a |method|: >
argv->join()->eval()
+<
+ Return type: any, depending on {string}
+
eventhandler() *eventhandler()*
Returns 1 when inside an event handler. That is that Vim got
@@ -2323,6 +2512,9 @@ eventhandler() *eventhandler()*
e.g., when dropping a file on Vim. This means interactive
commands cannot be used. Otherwise zero is returned.
+ Return type: |Number|
+
+
executable({expr}) *executable()*
This function checks if an executable with the name {expr}
exists. {expr} must be the name of the program without any
@@ -2351,6 +2543,9 @@ executable({expr}) *executable()*
Can also be used as a |method|: >
GetCommand()->executable()
+<
+ Return type: |Number|
+
execute({command} [, {silent}]) *execute()*
Execute an Ex command or commands and return the output as a
@@ -2384,6 +2579,9 @@ execute({command} [, {silent}]) *execute()*
Can also be used as a |method|: >
GetCommand()->execute()
+<
+ Return type: |Number|
+
exepath({expr}) *exepath()*
If {expr} is an executable and is either an absolute path, a
@@ -2397,8 +2595,11 @@ exepath({expr}) *exepath()*
Can also be used as a |method|: >
GetCommand()->exepath()
<
- *exists()*
-exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
+ Return type: |String|
+
+
+exists({expr}) *exists()*
+ The result is a Number, which is |TRUE| if {expr} is defined,
zero otherwise.
Note: In a compiled |:def| function the evaluation is done at
@@ -2502,6 +2703,8 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
Can also be used as a |method|: >
Varname()->exists()
<
+ Return type: |String|
+
exists_compiled({expr}) *exists_compiled()*
Like `exists()` but evaluated at compile time. This is useful
@@ -2517,6 +2720,8 @@ exists_compiled({expr}) *exists_compiled()*
Can only be used in a |:def| function. *E1233*
This does not work to check for arguments or local variables.
+ Return type: |String|
+
exp({expr}) *exp()*
Return the exponential of {expr} as a |Float| in the range
@@ -2531,6 +2736,8 @@ exp({expr}) *exp()*
Can also be used as a |method|: >
Compute()->exp()
+<
+ Return type: |Float|
expand({string} [, {nosuf} [, {list}]]) *expand()*
@@ -2631,6 +2838,9 @@ expand({string} [, {nosuf} [, {list}]]) *expand()*
Can also be used as a |method|: >
Getpattern()->expand()
+<
+ Return type: |String| or list<string> depending on {list}
+
expandcmd({string} [, {options}]) *expandcmd()*
Expand special items in String {string} like what is done for
@@ -2656,6 +2866,8 @@ expandcmd({string} [, {options}]) *expandcmd()*
Can also be used as a |method|: >
GetCommand()->expandcmd()
<
+ Return type: |String| or list<string> depending on {list}
+
extend({expr1}, {expr2} [, {expr3}]) *extend()*
{expr1} and {expr2} must be both |Lists| or both
|Dictionaries|.
@@ -2694,6 +2906,9 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
Can also be used as a |method|: >
mylist->extend(otherlist)
+<
+ Return type: list<{type}> or dict<{type}> depending on {expr1}
+ and {expr2}, in case of error: |Number|
extendnew({expr1}, {expr2} [, {expr3}]) *extendnew()*
@@ -2701,6 +2916,9 @@ extendnew({expr1}, {expr2} [, {expr3}]) *extendnew()*
List or Dictionary is created and returned. {expr1} remains
unchanged.
+ Return type: list<{type}> or dict<{type}> depending on {expr1}
+ and {expr2}, in case of error: |Number|
+
feedkeys({string} [, {mode}]) *feedkeys()*
Characters in {string} are queued for processing as if they
@@ -2758,6 +2976,9 @@ feedkeys({string} [, {mode}]) *feedkeys()*
Can also be used as a |method|: >
GetInput()->feedkeys()
+<
+ Return type: |String| or list<string> depending on {list}
+
filecopy({from}, {to}) *filecopy()*
Copy the file pointed to by the name {from} to {to}. The
@@ -2770,6 +2991,9 @@ filecopy({from}, {to}) *filecopy()*
Can also be used as a |method|: >
GetOldName()->filecopy(newname)
+<
+ Return type: |Number|
+
filereadable({file}) *filereadable()*
The result is a Number, which is |TRUE| when a file with the
@@ -2786,7 +3010,10 @@ filereadable({file}) *filereadable()*
< Can also be used as a |method|: >
GetName()->filereadable()
-< *file_readable()*
+<
+ Return type: |Number|
+
+ *file_readable()*
Obsolete name: file_readable().
@@ -2798,6 +3025,8 @@ filewritable({file}) *filewritable()*
Can also be used as a |method|: >
GetName()->filewritable()
+<
+ Return type: |Number|
filter({expr1}, {expr2}) *filter()*
@@ -2860,6 +3089,10 @@ filter({expr1}, {expr2}) *filter()*
Can also be used as a |method|: >
mylist->filter(expr2)
+<
+ Return type: |String|, |Blob|, list<{type}> or dict<{type}>
+ depending on {expr1}
+
finddir({name} [, {path} [, {count}]]) *finddir()*
Find directory {name} in {path}. Supports both downwards and
@@ -2881,6 +3114,9 @@ finddir({name} [, {path} [, {count}]]) *finddir()*
Can also be used as a |method|: >
GetName()->finddir()
+<
+ Return type: |String|
+
findfile({name} [, {path} [, {count}]]) *findfile()*
Just like |finddir()|, but find a file instead of a directory.
@@ -2892,6 +3128,9 @@ findfile({name} [, {path} [, {count}]]) *findfile()*
Can also be used as a |method|: >
GetName()->findfile()
+<
+ Return type: |String|
+
flatten({list} [, {maxdepth}]) *flatten()*
Flatten {list} up to {maxdepth} levels. Without {maxdepth}
@@ -2917,9 +3156,14 @@ flatten({list} [, {maxdepth}]) *flatten()*
Can also be used as a |method|: >
mylist->flatten()
<
+ Return type: list<{type}>
+
+
flattennew({list} [, {maxdepth}]) *flattennew()*
Like |flatten()| but first make a copy of {list}.
+ Return type: list<{type}>
+
float2nr({expr}) *float2nr()*
Convert {expr} to a Number by omitting the part after the
@@ -2945,6 +3189,8 @@ float2nr({expr}) *float2nr()*
Can also be used as a |method|: >
Compute()->float2nr()
+<
+ Return type: |Number|
floor({expr}) *floor()*
@@ -2962,6 +3208,8 @@ floor({expr}) *floor()*
Can also be used as a |method|: >
Compute()->floor()
+<
+ Return type: |Float|
fmod({expr1}, {expr2}) *fmod()*
@@ -2982,6 +3230,8 @@ fmod({expr1}, {expr2}) *fmod()*
Can also be used as a |method|: >
Compute()->fmod(1.22)
+<
+ Return type: |Float|
fnameescape({string}) *fnameescape()*
@@ -3002,6 +3252,9 @@ fnameescape({string}) *fnameescape()*
<
Can also be used as a |method|: >
GetName()->fnameescape()
+<
+ Return type: |String|
+
fnamemodify({fname}, {mods}) *fnamemodify()*
Modify file name {fname} according to {mods}. {mods} is a
@@ -3022,6 +3275,9 @@ fnamemodify({fname}, {mods}) *fnamemodify()*
Can also be used as a |method|: >
GetName()->fnamemodify(':p:h')
+<
+ Return type: |String|
+
foldclosed({lnum}) *foldclosed()*
The result is a Number. If the line {lnum} is in a closed
@@ -3032,6 +3288,9 @@ foldclosed({lnum}) *foldclosed()*
Can also be used as a |method|: >
GetLnum()->foldclosed()
+<
+ Return type: |Number|
+
foldclosedend({lnum}) *foldclosedend()*
The result is a Number. If the line {lnum} is in a closed
@@ -3042,6 +3301,9 @@ foldclosedend({lnum}) *foldclosedend()*
Can also be used as a |method|: >
GetLnum()->foldclosedend()
+<
+ Return type: |Number|
+
foldlevel({lnum}) *foldlevel()*
The result is a Number, which is the foldlevel of line {lnum}
@@ -3058,6 +3320,8 @@ foldlevel({lnum}) *foldlevel()*
Can also be used as a |method|: >
GetLnum()->foldlevel()
<
+ Return type: |Number|
+
*foldtext()*
foldtext() Returns a String, to be displayed for a closed fold. This is
the default function used for the 'foldtext' option and should
@@ -3074,8 +3338,11 @@ foldtext() Returns a String, to be displayed for a closed fold. This is
will be filled with the fold char from the 'fillchars'
setting.
Returns an empty string when there is no fold.
+
+ Return type: |String|
{not available when compiled without the |+folding| feature}
+
foldtextresult({lnum}) *foldtextresult()*
Returns the text that is displayed for the closed fold at line
{lnum}. Evaluates 'foldtext' in the appropriate context.
@@ -3089,6 +3356,9 @@ foldtextresult({lnum}) *foldtextresult()*
Can also be used as a |method|: >
GetLnum()->foldtextresult()
+<
+ Return type: |String|
+
foreach({expr1}, {expr2}) *foreach()*