From 5674c9a7de503d5e798055a5e1115343ff885221 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sun, 9 Jun 2024 00:13:43 +0200 Subject: runtime(doc): add return type info for Vim function descriptions Signed-off-by: Christian Brabandt --- runtime/doc/builtin.txt | 1360 ++++++++++++++++++++++++++++++++++++++++++---- runtime/doc/channel.txt | 61 ++- runtime/doc/popup.txt | 47 +- runtime/doc/sign.txt | 33 +- runtime/doc/tags | 1 + runtime/doc/terminal.txt | 64 ++- runtime/doc/testing.txt | 71 ++- runtime/doc/textprop.txt | 36 +- 8 files changed, 1527 insertions(+), 146 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> + + 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 or list + + 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 or list + *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 + *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> or list + 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> + 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 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 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 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 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()* {expr1} must be a |List|, |String|, |Blob| or |Dictionary|. @@ -3129,12 +3399,17 @@ foreach({expr1}, {expr2}) *foreach()* Can also be used as a |method|: > mylist->foreach(expr2) < + Return type: |String|, |Blob| list<{type}> or dict<{type}> + depending on {expr1} + *foreground()* foreground() Move the Vim window to the foreground. Useful when sent from a client to a Vim server. |remote_send()| On Win32 systems this might not work, the OS does not always allow a window to bring itself to the foreground. Use |remote_foreground()| instead. + + Return type: |Number| {only in the Win32, Motif and GTK GUI versions and the Win32 console version} @@ -3159,8 +3434,10 @@ fullcommand({name} [, {vim9}]) *fullcommand()* Can also be used as a |method|: > GetName()->fullcommand() < - *funcref()* -funcref({name} [, {arglist}] [, {dict}]) + Return type: |String| + + +funcref({name} [, {arglist}] [, {dict}]) *funcref()* Just like |function()|, but the returned Funcref will lookup the function by reference, not by name. This matters when the function {name} is redefined later. @@ -3175,6 +3452,8 @@ funcref({name} [, {arglist}] [, {dict}]) Can also be used as a |method|: > GetFuncname()->funcref([arg]) < + Return type: func(...): any or |Number| on error + *function()* *partial* *E700* *E923* function({name} [, {arglist}] [, {dict}]) Return a |Funcref| variable that refers to function {name}. @@ -3257,6 +3536,9 @@ function({name} [, {arglist}] [, {dict}]) Can also be used as a |method|: > GetFuncname()->function([arg]) +< + Return type: func(...): any or |Number| on error + garbagecollect([{atexit}]) *garbagecollect()* Cleanup unused |Lists|, |Dictionaries|, |Channels| and |Jobs| @@ -3279,18 +3561,27 @@ garbagecollect([{atexit}]) *garbagecollect()* type a character. To force garbage collection immediately use |test_garbagecollect_now()|. + Return type: |String| + + get({list}, {idx} [, {default}]) *get()* Get item {idx} from |List| {list}. When this item is not available return {default}. Return zero when {default} is omitted. Preferably used as a |method|: > mylist->get(idx) +< + Return type: any, depending on {list} + get({blob}, {idx} [, {default}]) Get byte {idx} from |Blob| {blob}. When this byte is not available return {default}. Return -1 when {default} is omitted. Preferably used as a |method|: > myblob->get(idx) +< + Return type: |Number| + get({dict}, {key} [, {default}]) Get item with key {key} from |Dictionary| {dict}. When this item is not available return {default}. Return zero when @@ -3300,6 +3591,9 @@ get({dict}, {key} [, {default}]) 'default' when it does not exist. Preferably used as a |method|: > mydict->get(key) +< + Return type: any, depending on {list} + get({func}, {what}) Get item {what} from Funcref {func}. Possible values for {what} are: @@ -3311,6 +3605,8 @@ get({func}, {what}) Preferably used as a |method|: > myfunc->get(what) < + Return type: any, depending on {func} + *getbufinfo()* getbufinfo([{buf}]) getbufinfo([{dict}]) @@ -3386,6 +3682,8 @@ getbufinfo([{dict}]) Can also be used as a |method|: > GetBufnr()->getbufinfo() < + Return type: list> + *getbufline()* getbufline({buf}, {lnum} [, {end}]) @@ -3416,11 +3714,16 @@ getbufline({buf}, {lnum} [, {end}]) < Can also be used as a |method|: > GetBufnr()->getbufline(lnum) < + Return type: list + *getbufoneline()* getbufoneline({buf}, {lnum}) Just like `getbufline()` but only get one line and return it as a string. + Return type: |String| + + getbufvar({buf}, {varname} [, {def}]) *getbufvar()* The result is the value of option or local buffer variable {varname} in buffer {buf}. Note that the name without "b:" @@ -3445,11 +3748,16 @@ getbufvar({buf}, {varname} [, {def}]) *getbufvar()* < Can also be used as a |method|: > GetBufnr()->getbufvar(varname) < + Return type: any, depending on {varname} + + getcellwidths() *getcellwidths()* Returns a |List| of cell widths of character ranges overridden by |setcellwidths()|. The format is equal to the argument of |setcellwidths()|. If no character ranges have their cell widths overridden, an empty List is returned. +< + Return type: list getchangelist([{buf}]) *getchangelist()* @@ -3470,6 +3778,9 @@ getchangelist([{buf}]) *getchangelist()* Can also be used as a |method|: > GetBufnr()->getchangelist() +< + Return type: list + getchar([{expr}]) *getchar()* Get a single character from the user or input stream. @@ -3550,6 +3861,9 @@ getchar([{expr}]) *getchar()* : endwhile : return c :endfunction +< + Return type: |Number| or |String| + getcharmod() *getcharmod()* The result is a Number which is the state of the modifiers for @@ -3567,8 +3881,10 @@ getcharmod() *getcharmod()* character itself are obtained. Thus Shift-a results in "A" without a modifier. Returns 0 if no modifiers are used. - *getcharpos()* -getcharpos({expr}) + Return type: |Number| + + +getcharpos({expr}) *getcharpos()* Get the position for String {expr}. Same as |getpos()| but the column number in the returned List is a character index instead of a byte index. @@ -3583,6 +3899,9 @@ getcharpos({expr}) < Can also be used as a |method|: > GetMark()->getcharpos() +< + Return type: list + getcharsearch() *getcharsearch()* Return the current character search information as a {dict} @@ -3604,6 +3923,8 @@ getcharsearch() *getcharsearch()* :nnoremap , getcharsearch().forward ? ',' : ';' < Also see |setcharsearch()|. + Return type: dict + getcharstr([{expr}]) *getcharstr()* Get a single character from the user or input stream as a @@ -3617,6 +3938,9 @@ getcharstr([{expr}]) *getcharstr()* Otherwise this works like |getchar()|, except that a number result is converted to a string. + Return type: |String| + + getcmdcompltype() *getcmdcompltype()* Return the type of the current command-line completion. Only works when the command line is being edited, thus @@ -3626,6 +3950,9 @@ getcmdcompltype() *getcmdcompltype()* |setcmdline()|. Returns an empty string when completion is not defined. + Return type: |String| + + getcmdline() *getcmdline()* Return the current command-line. Only works when the command line is being edited, thus requires use of |c_CTRL-\_e| or @@ -3637,6 +3964,9 @@ getcmdline() *getcmdline()* Returns an empty string when entering a password or using |inputsecret()|. + Return type: |String| + + getcmdpos() *getcmdpos()* Return the position of the cursor in the command line as a byte count. The first column is 1. @@ -3646,6 +3976,9 @@ getcmdpos() *getcmdpos()* Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()| and |setcmdline()|. + Return type: |Number| + + getcmdscreenpos() *getcmdscreenpos()* Return the screen position of the cursor in the command line as a byte count. The first column is 1. @@ -3656,6 +3989,9 @@ getcmdscreenpos() *getcmdscreenpos()* Also see |getcmdpos()|, |setcmdpos()|, |getcmdline()| and |setcmdline()|. + Return type: |Number| + + getcmdtype() *getcmdtype()* Return the current command-line type. Possible return values are: @@ -3671,11 +4007,17 @@ getcmdtype() *getcmdtype()* Returns an empty string otherwise. Also see |getcmdpos()|, |setcmdpos()| and |getcmdline()|. + Return type: |String| + + getcmdwintype() *getcmdwintype()* Return the current |command-line-window| type. Possible return values are the same as |getcmdtype()|. Returns an empty string when not in the command-line window. + Return type: |String| + + getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* Return a list of command-line completion matches. The String {type} argument specifies what for. The following completion @@ -3750,6 +4092,8 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* Can also be used as a |method|: > GetPattern()->getcompletion('color') < + Return type: list + *getcurpos()* getcurpos([{winid}]) Get the position of the cursor. This is like getpos('.'), but @@ -3779,8 +4123,10 @@ getcurpos([{winid}]) Can also be used as a |method|: > GetWinid()->getcurpos() < - *getcursorcharpos()* -getcursorcharpos([{winid}]) + Return type: list + + +getcursorcharpos([{winid}]) *getcursorcharpos()* Same as |getcurpos()| but the column number in the returned List is a character index instead of a byte index. @@ -3791,9 +4137,11 @@ getcursorcharpos([{winid}]) < Can also be used as a |method|: > GetWinid()->getcursorcharpos() +< + Return type: list -< *getcwd()* -getcwd([{winnr} [, {tabnr}]]) + +getcwd([{winnr} [, {tabnr}]]) *getcwd()* The result is a String, which is the name of the current working directory. 'autochdir' is ignored. @@ -3828,6 +4176,8 @@ getcwd([{winnr} [, {tabnr}]]) < Can also be used as a |method|: > GetWinnr()->getcwd() +< + Return type: |String| getenv({name}) *getenv()* Return the value of environment variable {name}. The {name} @@ -3841,6 +4191,9 @@ getenv({name}) *getenv()* Can also be used as a |method|: > GetVarname()->getenv() +< + Return type: |String| or |Number| + getfontname([{name}]) *getfontname()* Without an argument returns the name of the normal font being @@ -3856,6 +4209,9 @@ getfontname([{name}]) *getfontname()* Note that the GTK GUI accepts any font name, thus checking for a valid name does not work. + Return type: |String| + + getfperm({fname}) *getfperm()* The result is a String, which is the read, write, and execute permissions of the given file {fname}. @@ -3874,8 +4230,11 @@ getfperm({fname}) *getfperm()* Can also be used as a |method|: > GetFilename()->getfperm() < + Return type: |String| + For setting permissions use |setfperm()|. + getfsize({fname}) *getfsize()* The result is a Number, which is the size in bytes of the given file {fname}. @@ -3886,6 +4245,9 @@ getfsize({fname}) *getfsize()* Can also be used as a |method|: > GetFilename()->getfsize() +< + Return type: |Number| + getftime({fname}) *getftime()* The result is a Number, which is the last modification time of @@ -3896,6 +4258,9 @@ getftime({fname}) *getftime()* Can also be used as a |method|: > GetFilename()->getftime() +< + Return type: |Number| + getftype({fname}) *getftype()* The result is a String, which is a description of the kind of @@ -3920,12 +4285,17 @@ getftype({fname}) *getftype()* Can also be used as a |method|: > GetFilename()->getftype() +< + Return type: |String| getimstatus() *getimstatus()* The result is a Number, which is |TRUE| when the IME status is active and |FALSE| otherwise. See 'imstatusfunc'. + Return type: |Number| + + getjumplist([{winnr} [, {tabnr}]]) *getjumplist()* Returns the |jumplist| for the specified window. @@ -3948,8 +4318,10 @@ getjumplist([{winnr} [, {tabnr}]]) *getjumplist()* Can also be used as a |method|: > GetWinnr()->getjumplist() +< + Return type: list -< *getline()* + *getline()* getline({lnum} [, {end}]) Without {end} the result is a String, which is line {lnum} from the current buffer. Example: > @@ -3974,8 +4346,10 @@ getline({lnum} [, {end}]) < Can also be used as a |method|: > ComputeLnum()->getline() +< + Return type: list or |String| depending on {end} -< To get lines from another buffer see |getbufline()| and + To get lines from another buffer see |getbufline()| and |getbufoneline()| getloclist({nr} [, {what}]) *getloclist()* @@ -4008,6 +4382,8 @@ getloclist({nr} [, {what}]) *getloclist()* Examples (See also |getqflist-examples|): > :echo getloclist(3, {'all': 0}) :echo getloclist(5, {'filewinid': 0}) +< + Return type: list> or list getmarklist([{buf}]) *getmarklist()* @@ -4031,6 +4407,9 @@ getmarklist([{buf}]) *getmarklist()* Can also be used as a |method|: > GetBufnr()->getmarklist() +< + Return type: list> or list + getmatches([{win}]) *getmatches()* Returns a |List| with all matches previously defined for the @@ -4057,6 +4436,9 @@ getmatches([{win}]) *getmatches()* 'pattern': 'FIXME', 'priority': 10, 'id': 2}] > :unlet m < + Return type: list> or list + + getmousepos() *getmousepos()* Returns a |Dictionary| with the last known position of the mouse. This can be used in a mapping for a mouse click or in @@ -4087,19 +4469,28 @@ getmousepos() *getmousepos()* When using |getchar()| the Vim variables |v:mouse_lnum|, |v:mouse_col| and |v:mouse_winid| also provide these values. + Return type: dict + + getmouseshape() *getmouseshape()* Returns the name of the currently showing mouse pointer. When the |+mouseshape| feature is not supported or the shape is unknown an empty string is returned. This function is mainly intended for testing. - *getpid()* -getpid() Return a Number which is the process ID of the Vim process. + Return type: |String| + + +getpid() *getpid()* + Return a Number which is the process ID of the Vim process. On Unix and MS-Windows this is a unique number, until Vim exits. - *getpos()* -getpos({expr}) Get the position for String {expr}. For possible values of + Return type: |Number| + + +getpos({expr}) *getpos()* + Get the position for String {expr}. For possible values of {expr} see |line()|. For getting the cursor position see |getcurpos()|. The result is a |List| with four numbers: @@ -4129,6 +4520,9 @@ getpos({expr}) Get the position for String {expr}. For possible values of Can also be used as a |method|: > GetMark()->getpos() +< + Return type: list + getqflist([{what}]) *getqflist()* Returns a |List| with all the current quickfix errors. Each @@ -4144,7 +4538,7 @@ getqflist([{what}]) *getqflist()* vcol |TRUE|: "col" is visual column |FALSE|: "col" is byte index nr error number - pattern search pattern used to locate the error + pattern search list text description of the error type type of the error, 'E', '1', etc. valid |TRUE|: recognized error message @@ -4233,6 +4627,9 @@ getqflist([{what}]) *getqflist()* :echo getqflist({'nr': 2, 'title': 1}) :echo getqflist({'lines' : ["F1:10:L10"]}) < + Return type: list> or list + + getreg([{regname} [, 1 [, {list}]]]) *getreg()* The result is a String, which is the contents of register {regname}. Example: > @@ -4260,6 +4657,9 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()* Can also be used as a |method|: > GetRegname()->getreg() +< + Return type: |String| + getreginfo([{regname}]) *getreginfo()* Returns detailed information about register {regname} as a @@ -4289,6 +4689,9 @@ getreginfo([{regname}]) *getreginfo()* Can also be used as a |method|: > GetRegname()->getreginfo() +< + Return type: dict + getregion({pos1}, {pos2} [, {opts}]) *getregion()* Returns the list of strings from {pos1} to {pos2} from a @@ -4342,6 +4745,7 @@ getregion({pos1}, {pos2} [, {opts}]) *getregion()* < Can also be used as a |method|: > getpos('.')->getregion(getpos("'a")) + < getregionpos({pos1}, {pos2} [, {opts}]) *getregionpos()* Same as |getregion()|, but returns a list of positions @@ -4378,7 +4782,10 @@ getregionpos({pos1}, {pos2} [, {opts}]) *getregionpos()* Can also be used as a |method|: > getpos('.')->getregionpos(getpos("'a")) < -getregtype([{regname}]) *getregtype()* + Return type: list + + +getregtype([{regname}]) *getregtype()* The result is a String, which is type of register {regname}. The value will be one of: "v" for |characterwise| text @@ -4393,6 +4800,8 @@ getregtype([{regname}]) *getregtype()* Can also be used as a |method|: > GetRegname()->getregtype() +< + Return type: |String| getscriptinfo([{opts}]) *getscriptinfo()* Returns a |List| with information about all the sourced Vim @@ -4435,6 +4844,9 @@ getscriptinfo([{opts}]) *getscriptinfo()* :echo getscriptinfo({'name': 'myscript'}) :echo getscriptinfo({'sid': 15})[0].variables < + Return type: list> + + gettabinfo([{tabnr}]) *gettabinfo()* If {tabnr} is not specified, then information about all the tab pages is returned as a |List|. Each List item is a @@ -4450,6 +4862,9 @@ gettabinfo([{tabnr}]) *gettabinfo()* Can also be used as a |method|: > GetTabnr()->gettabinfo() +< + Return type: list> + gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* Get the value of a tab-local variable {varname} in tab page @@ -4463,6 +4878,9 @@ gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* Can also be used as a |method|: > GetTabnr()->gettabvar(varname) +< + Return type: any, depending on {varname} + gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* Get the value of window-local variable {varname} in window @@ -4492,6 +4910,9 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* < Can also be used as a |method|: > GetTabnr()->gettabwinvar(winnr, varname) +< + Return type: any, depending on {varname} + gettagstack([{winnr}]) *gettagstack()* The result is a Dict, which is the tag stack of window {winnr}. @@ -4523,6 +4944,8 @@ gettagstack([{winnr}]) *gettagstack()* Can also be used as a |method|: > GetWinnr()->gettagstack() +< + Return type: dict gettext({text}) *gettext()* @@ -4536,6 +4959,8 @@ gettext({text}) *gettext()* xgettext does not understand escaping in single quoted strings. + Return type: |String| + getwininfo([{winid}]) *getwininfo()* Returns information about windows as a |List| with Dictionaries. @@ -4576,6 +5001,9 @@ getwininfo([{winid}]) *getwininfo()* Can also be used as a |method|: > GetWinnr()->getwininfo() +< + Return type: list> + getwinpos([{timeout}]) *getwinpos()* The result is a |List| with two numbers, the result of @@ -4600,22 +5028,31 @@ getwinpos([{timeout}]) *getwinpos()* Can also be used as a |method|: > GetTimeout()->getwinpos() < - *getwinposx()* -getwinposx() The result is a Number, which is the X coordinate in pixels of + Return type: list + + +getwinposx() *getwinposx()* + The result is a Number, which is the X coordinate in pixels of the left hand side of the GUI Vim window. Also works for an xterm (uses a timeout of 100 msec). The result will be -1 if the information is not available (e.g. on the Wayland backend). The value can be used with `:winpos`. - *getwinposy()* -getwinposy() The result is a Number, which is the Y coordinate in pixels of + Return type: |Number| + + +getwinposy() *getwinposy()* + The result is a Number, which is the Y coordinate in pixels of the top of the GUI Vim window. Also works for an xterm (uses a timeout of 100 msec). The result will be -1 if the information is not available (e.g. on the Wayland backend). The value can be used with `:winpos`. + Return type: |Number| + + getwinvar({winnr}, {varname} [, {def}]) *getwinvar()* Like |gettabwinvar()| for the current tabpage. Examples: > @@ -4625,6 +5062,9 @@ getwinvar({winnr}, {varname} [, {def}]) *getwinvar()* < Can also be used as a |method|: > GetWinnr()->getwinvar(varname) < + Return type: any, depending on {varname} + + glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* Expand the file wildcards in {expr}. See |wildcards| for the use of special characters. @@ -4663,6 +5103,10 @@ glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* Can also be used as a |method|: > GetExpr()->glob() +< + Return type: |String| or list or list depending + on {list} + glob2regpat({string}) *glob2regpat()* Convert a file pattern, as used by glob(), into a search @@ -4678,7 +5122,10 @@ glob2regpat({string}) *glob2regpat()* Can also be used as a |method|: > GetExpr()->glob2regpat() -< *globpath()* +< + Return type: |String| + + *globpath()* globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]]) Perform glob() for String {expr} on all directories in {path} and concatenate the results. Example: > @@ -4718,8 +5165,11 @@ globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]]) second argument: > GetExpr()->globpath(&rtp) < - *has()* -has({feature} [, {check}]) + Return type: |String| or list or list depending + on {list} + + +has({feature} [, {check}]) *has()* When {check} is omitted or is zero: The result is a Number, which is 1 if the feature {feature} is supported, zero otherwise. The {feature} argument is a string, case is @@ -4745,6 +5195,8 @@ has({feature} [, {check}]) < If the `endif` would be moved to the second line as "| endif" it would not be found. + Return type: |Number| + has_key({dict}, {key}) *has_key()* The result is a Number, which is TRUE if |Dictionary| {dict} @@ -4756,6 +5208,9 @@ has_key({dict}, {key}) *has_key()* Can also be used as a |method|: > mydict->has_key(key) +< + Return type: |Number| + haslocaldir([{winnr} [, {tabnr}]]) *haslocaldir()* The result is a Number: @@ -4793,6 +5248,9 @@ haslocaldir([{winnr} [, {tabnr}]]) *haslocaldir()* < Can also be used as a |method|: > GetWinnr()->haslocaldir() +< + Return type: |Number| + hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()* The result is a Number, which is TRUE if there is a mapping @@ -4827,6 +5285,9 @@ hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()* Can also be used as a |method|: > GetRHS()->hasmapto() +< + Return type: |Number| + histadd({history}, {item}) *histadd()* Add the String {item} to the history {history} which can be @@ -4852,6 +5313,9 @@ histadd({history}, {item}) *histadd()* Can also be used as a |method|, the base is passed as the second argument: > GetHistory()->histadd('search') +< + Return type: |Number| + histdel({history} [, {item}]) *histdel()* Clear {history}, i.e. delete all its entries. See |hist-names| @@ -4887,6 +5351,9 @@ histdel({history} [, {item}]) *histdel()* < Can also be used as a |method|: > GetHistory()->histdel() +< + Return type: |Number| + histget({history} [, {index}]) *histget()* The result is a String, the entry with Number {index} from @@ -4905,6 +5372,9 @@ histget({history} [, {index}]) *histget()* < Can also be used as a |method|: > GetHistory()->histget() +< + Return type: |String| + histnr({history}) *histnr()* The result is the Number of the current entry in {history}. @@ -4917,6 +5387,8 @@ histnr({history}) *histnr()* < Can also be used as a |method|: > GetHistory()->histnr() < + Return type: |Number| + hlexists({name}) *hlexists()* The result is a Number, which is TRUE if a highlight group called {name} exists. This is when the group has been @@ -4929,6 +5401,9 @@ hlexists({name}) *hlexists()* Can also be used as a |method|: > GetName()->hlexists() < + Return type: |Number| + + hlget([{name} [, {resolve}]]) *hlget()* Returns a List of all the highlight group attributes. If the optional {name} is specified, then returns a List with only @@ -4980,6 +5455,9 @@ hlget([{name} [, {resolve}]]) *hlget()* Can also be used as a |method|: > GetName()->hlget() < + Return type: list> + + hlset({list}) *hlset()* Creates or modifies the attributes of a List of highlight groups. Each item in {list} is a dictionary containing the @@ -5031,8 +5509,10 @@ hlset({list}) *hlset()* Can also be used as a |method|: > GetAttrList()->hlset() < - *hlID()* -hlID({name}) The result is a Number, which is the ID of the highlight group + Return type: |Number| + +hlID({name}) *hlID()* + The result is a Number, which is the ID of the highlight group with name {name}. When the highlight group doesn't exist, zero is returned. This can be used to retrieve information about the highlight @@ -5044,12 +5524,18 @@ hlID({name}) The result is a Number, which is the ID of the highlight group Can also be used as a |method|: > GetName()->hlID() +< + Return type: |Number| + hostname() *hostname()* The result is a String, which is the name of the machine on which Vim is currently running. Machine names greater than 256 characters long are truncated. + Return type: |String| + + iconv({string}, {from}, {to}) *iconv()* The result is a String, which is the text {string} converted from encoding {from} to encoding {to}. @@ -5072,8 +5558,11 @@ iconv({string}, {from}, {to}) *iconv()* Can also be used as a |method|: > GetText()->iconv('latin1', 'utf-8') < - *indent()* -indent({lnum}) The result is a Number, which is indent of line {lnum} in the + Return type: |String| + + +indent({lnum}) *indent()* + The result is a Number, which is indent of line {lnum} in the current buffer. The indent is counted in spaces, the value of 'tabstop' is relevant. {lnum} is used just like in |getline()|. @@ -5082,6 +5571,9 @@ indent({lnum}) The result is a Number, which is indent of line {lnum} in the Can also be used as a |method|: > GetLnum()->indent() +< + Return type: |Number| + index({object}, {expr} [, {start} [, {ic}]]) *index()* Find {expr} in {object} and return its index. See @@ -5110,6 +5602,9 @@ index({object}, {expr} [, {start} [, {ic}]]) *index()* < Can also be used as a |method|: > GetObject()->index(what) +< + Return type: |Number| + indexof({object}, {expr} [, {opts}]) *indexof()* Returns the index of an item in {object} where {expr} is @@ -5151,6 +5646,9 @@ indexof({object}, {expr} [, {opts}]) *indexof()* < Can also be used as a |method|: > mylist->indexof(expr) +< + Return type: |Number| + input({prompt} [, {text} [, {completion}]]) *input()* The result is a String, which is whatever the user typed on @@ -5199,6 +5697,9 @@ input({prompt} [, {text} [, {completion}]]) *input()* < Can also be used as a |method|: > GetPrompt()->input() +< + Return type: |String| + inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()* Like |input()|, but when the GUI is running and text dialogs @@ -5216,6 +5717,9 @@ inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()* Can also be used as a |method|: > GetPrompt()->inputdialog() +< + Return type: |String| + inputlist({textlist}) *inputlist()* {textlist} must be a |List| of strings. This |List| is @@ -5236,6 +5740,9 @@ inputlist({textlist}) *inputlist()* < Can also be used as a |method|: > GetChoices()->inputlist() +< + Return type: |Number| + inputrestore() *inputrestore()* Restore typeahead that was saved with a previous |inputsave()|. @@ -5243,6 +5750,9 @@ inputrestore() *inputrestore()* called. Calling it more often is harmless though. Returns TRUE when there is nothing to restore, FALSE otherwise. + Return type: |Number| + + inputsave() *inputsave()* Preserve typeahead (also from mappings) and clear it, so that a following prompt gets input from the user. Should be @@ -5251,6 +5761,9 @@ inputsave() *inputsave()* many inputrestore() calls. Returns TRUE when out of memory, FALSE otherwise. + Return type: |Number| + + inputsecret({prompt} [, {text}]) *inputsecret()* This function acts much like the |input()| function with but two exceptions: @@ -5264,6 +5777,9 @@ inputsecret({prompt} [, {text}]) *inputsecret()* Can also be used as a |method|: > GetPrompt()->inputsecret() +< + Return type: |String| + insert({object}, {item} [, {idx}]) *insert()* When {object} is a |List| or a |Blob| insert {item} at the start @@ -5285,6 +5801,9 @@ insert({object}, {item} [, {idx}]) *insert()* Can also be used as a |method|: > mylist->insert(item) < + Return type: |Number| + + *instanceof()* *E614* *E616* *E693* instanceof({object}, {class}) The result is a Number, which is |TRUE| when the {object} @@ -5297,6 +5816,8 @@ instanceof({object}, {class}) < Can also be used as a |method|: > myobj->instanceof(mytype) +< + Return type: |Number| interrupt() *interrupt()* Interrupt script execution. It works more or less like the @@ -5310,6 +5831,8 @@ interrupt() *interrupt()* : endif :endfunction :au BufWritePre * call s:check_typoname(expand('')) +< + Return type: void invert({expr}) *invert()* Bitwise invert. The argument is converted to a number. A @@ -5317,6 +5840,9 @@ invert({expr}) *invert()* :let bits = invert(bits) < Can also be used as a |method|: > :let bits = bits->invert() +< + Return type: |Number| + isabsolutepath({path}) *isabsolutepath()* The result is a Number, which is |TRUE| when {path} is an @@ -5334,6 +5860,8 @@ isabsolutepath({path}) *isabsolutepath()* < Can also be used as a |method|: > GetName()->isabsolutepath() +< + Return type: |Number| isdirectory({directory}) *isdirectory()* @@ -5344,6 +5872,9 @@ isdirectory({directory}) *isdirectory()* Can also be used as a |method|: > GetName()->isdirectory() +< + Return type: |Number| + isinf({expr}) *isinf()* Return 1 if {expr} is a positive infinity, or -1 a negative @@ -5355,6 +5886,9 @@ isinf({expr}) *isinf()* Can also be used as a |method|: > Compute()->isinf() +< + Return type: |Number| + islocked({expr}) *islocked()* *E786* The result is a Number, which is |TRUE| when {expr} is the @@ -5375,6 +5909,9 @@ islocked({expr}) *islocked()* *E786* Can also be used as a |method|: > GetName()->islocked() +< + Return type: |Number| + isnan({expr}) *isnan()* Return |TRUE| if {expr} is a float with value NaN. > @@ -5383,6 +5920,9 @@ isnan({expr}) *isnan()* Can also be used as a |method|: > Compute()->isnan() +< + Return type: |Number| + items({dict}) *items()* Return a |List| with all the key-value pairs of {dict}. Each @@ -5400,6 +5940,9 @@ items({dict}) *items()* Can also be used as a |method|: > mydict->items() +< + Return type: list> or list + job_ functions are documented here: |job-functions-details| @@ -5417,6 +5960,9 @@ join({list} [, {sep}]) *join()* Can also be used as a |method|: > mylist->join() +< + Return type: |String| + js_decode({string}) *js_decode()* This is similar to |json_decode()| with these differences: @@ -5427,6 +5973,9 @@ js_decode({string}) *js_decode()* Can also be used as a |method|: > ReadObject()->js_decode() +< + Return type: any, depending on {varname} + js_encode({expr}) *js_encode()* This is similar to |json_encode()| with these differences: @@ -5444,6 +5993,9 @@ js_encode({expr}) *js_encode()* Can also be used as a |method|: > GetObject()->js_encode() +< + Return type: |String| + json_decode({string}) *json_decode()* *E491* This parses a JSON formatted string and returns the equivalent @@ -5480,6 +6032,9 @@ json_decode({string}) *json_decode()* *E491* Can also be used as a |method|: > ReadObject()->json_decode() +< + Return type: any, depending on {varname} + json_encode({expr}) *json_encode()* Encode {expr} as JSON and return this as a string. @@ -5510,6 +6065,9 @@ json_encode({expr}) *json_encode()* Can also be used as a |method|: > GetObject()->json_encode() +< + Return type: |String| + keys({dict}) *keys()* Return a |List| with all the keys of {dict}. The |List| is in @@ -5517,6 +6075,9 @@ keys({dict}) *keys()* Can also be used as a |method|: > mydict->keys() +< + Return type: list + keytrans({string}) *keytrans()* Turn the internal byte representation of keys into a form that @@ -5527,9 +6088,12 @@ keytrans({string}) *keytrans()* Can also be used as a |method|: > "\"->keytrans() +< + Return type: |String| + -< *len()* *E701* -len({expr}) The result is a Number, whi