diff options
Diffstat (limited to 'runtime/doc/builtin.txt')
-rw-r--r-- | runtime/doc/builtin.txt | 1562 |
1 files changed, 1384 insertions, 178 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 79f3cd7..a824531 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 Apr 07 +*builtin.txt* For Vim version 9.1. Last change: 2024 Jun 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -178,6 +178,8 @@ extendnew({expr1}, {expr2} [, {expr3}]) List/Dict like |extend()| but creates a new List or Dictionary feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer +filecopy({from}, {to}) Number |TRUE| if copying file {from} to {to} + worked filereadable({file}) Number |TRUE| if {file} is a readable file filewritable({file}) Number |TRUE| if {file} is a writable file filter({expr1}, {expr2}) List/Dict/Blob/String @@ -265,6 +267,8 @@ getreg([{regname} [, 1 [, {list}]]]) getreginfo([{regname}]) Dict information about a register getregion({pos1}, {pos2} [, {opts}]) List get the text from {pos1} to {pos2} +getregionpos({pos1}, {pos2} [, {opts}]) + List get a list of positions for a region getregtype([{regname}]) String type of a register getscriptinfo([{opts}]) List list of sourced scripts gettabinfo([{expr}]) List list of tab pages @@ -765,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 @@ -781,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()* @@ -796,6 +803,8 @@ acos({expr}) *acos()* Can also be used as a |method|: > Compute()->acos() +< + Return type: |Float| add({object}, {expr}) *add()* @@ -811,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()* @@ -821,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()* @@ -842,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()* @@ -869,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()* @@ -881,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 @@ -898,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 @@ -918,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]. @@ -933,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|. @@ -952,6 +979,8 @@ atan({expr}) *atan()* Can also be used as a |method|: > Compute()->atan() +< + Return type: |Float| atan2({expr1}, {expr2}) *atan2()* @@ -968,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()* @@ -1015,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. @@ -1063,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 @@ -1121,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 @@ -1157,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 @@ -1169,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: > @@ -1180,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")" @@ -1192,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 @@ -1205,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). @@ -1220,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 @@ -1246,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). @@ -1255,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 @@ -1268,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 @@ -1276,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 @@ -1309,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. @@ -1335,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}, @@ -1352,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 @@ -1366,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 @@ -1379,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 @@ -1420,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 @@ -1436,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 @@ -1448,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 @@ -1465,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| @@ -1479,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: > @@ -1500,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}. @@ -1512,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 @@ -1525,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}. @@ -1561,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 @@ -1587,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'. @@ -1597,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 @@ -1607,35 +1722,37 @@ 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: - . the cursor position - $ the end of the cursor line (the result is the - number of bytes in the cursor line plus one) - 'x position of mark x (if the mark is not set, 0 is - returned) - v In Visual mode: the start of the Visual area (the - cursor is the end). When not in Visual mode - returns the cursor position. Differs from |'<| in - that it's updated right away. + position given with {expr}. + For accepted positions see |getpos()|. + When {expr} is "$", it means the end of the cursor line, so + the result is the number of bytes in the cursor line plus one. Additionally {expr} can be [lnum, col]: a |List| with the line and column number. Most useful when the column is "$", to get the last column of a specific line. When "lnum" or "col" is out of range then col() returns zero. + With the optional {winid} argument the values are obtained for that window instead of the current window. + To get the line number use |line()|. To get both use |getpos()|. For the screen column position use |virtcol()|. For the character position use |charcol()|. + Note that only marks in the current file can be used. + Examples: > col(".") column of cursor col("$") length of cursor line plus one col("'t") column of mark t col("'" .. markname) column of mark markname -< The first column is 1. Returns 0 if {expr} is invalid or when +< + The first column is 1. Returns 0 if {expr} is invalid or when the window with ID {winid} is not found. For an uppercase mark the column may actually be in another buffer. @@ -1648,6 +1765,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. @@ -1682,6 +1801,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 @@ -1694,6 +1816,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. @@ -1703,6 +1828,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 @@ -1765,6 +1892,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 @@ -1824,8 +1953,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 @@ -1835,6 +1967,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|. @@ -1848,6 +1983,8 @@ cos({expr}) *cos()* Can also be used as a |method|: > Compute()->cos() +< + Return type: |Float| cosh({expr}) *cosh()* @@ -1863,6 +2000,8 @@ cosh({expr}) *cosh()* Can also be used as a |method|: > Compute()->cosh() +< + Return type: |Float| count({comp}, {expr} [, {ic} [, {start}]]) *count()* *E706* @@ -1881,6 +2020,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 @@ -1922,6 +2063,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 @@ -1957,6 +2101,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 @@ -1969,6 +2116,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 @@ -1994,6 +2144,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 @@ -2020,6 +2173,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}. @@ -2038,6 +2194,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 @@ -2050,6 +2208,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 @@ -2116,6 +2277,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 @@ -2127,6 +2292,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 @@ -2142,6 +2310,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 @@ -2166,6 +2336,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. @@ -2192,6 +2364,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. @@ -2205,7 +2379,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 @@ -2217,6 +2391,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. @@ -2240,6 +2416,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. @@ -2254,6 +2432,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. @@ -2273,6 +2453,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 @@ -2281,6 +2464,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()* @@ -2290,6 +2475,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 @@ -2302,6 +2489,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. @@ -2312,6 +2501,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 @@ -2319,6 +2511,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 @@ -2347,6 +2542,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 @@ -2380,6 +2578,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 @@ -2393,8 +2594,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 @@ -2498,6 +2702,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 @@ -2513,6 +2719,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 @@ -2527,6 +2735,8 @@ exp({expr}) *exp()* Can also be used as a |method|: > Compute()->exp() +< + Return type: |Float| expand({string} [, {nosuf} [, {list}]]) *expand()* @@ -2544,7 +2754,7 @@ expand({string} [, {nosuf} [, {list}]]) *expand()* not start with '%', '#' or '<', see below. For a |:terminal| window '%' expands to a '!' followed by - the command or shell that is run |terminal-bufname| + the command or shell that is run. |terminal-bufname| When {string} starts with '%', '#' or '<', the expansion is done like for the |cmdline-special| variables with their @@ -2627,6 +2837,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 @@ -2652,6 +2865,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|. @@ -2690,6 +2905,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()* @@ -2697,6 +2915,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 @@ -2754,6 +2975,24 @@ 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 + result is a Number, which is |TRUE| if the file was copied + successfully, and |FALSE| when it failed. + If a file with name {to} already exists, it will fail. + Note that it does not handle directories (yet). + + This function is not available in the |sandbox|. + + 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 @@ -2770,7 +3009,10 @@ filereadable({file}) *filereadable()* < Can also be used as a |method|: > GetName()->filereadable() -< *file_readable()* +< + Return type: |Number| + + *file_readable()* Obsolete name: file_readable(). @@ -2782,6 +3024,8 @@ filewritable({file}) *filewritable()* Can also be used as a |method|: > GetName()->filewritable() +< + Return type: |Number| filter({expr1}, {expr2}) *filter()* @@ -2844,6 +3088,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 @@ -2865,6 +3113,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. @@ -2876,6 +3127,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} @@ -2901,9 +3155,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 @@ -2929,6 +3188,8 @@ float2nr({expr}) *float2nr()* Can also be used as a |method|: > Compute()->float2nr() +< + Return type: |Number| floor({expr}) *floor()* @@ -2946,6 +3207,8 @@ floor({expr}) *floor()* Can also be used as a |method|: > Compute()->floor() +< + Return type: |Float| fmod({expr1}, {expr2}) *fmod()* @@ -2966,6 +3229,8 @@ fmod({expr1}, {expr2}) *fmod()* Can also be used as a |method|: > Compute()->fmod(1.22) +< + Return type: |Float| fnameescape({string}) *fnameescape()* @@ -2986,6 +3251,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 @@ -3006,6 +3274,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 @@ -3016,6 +3287,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 @@ -3026,6 +3300,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} @@ -3042,6 +3319,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 @@ -3058,8 +3337,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. @@ -3073,6 +3355,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|. @@ -3113,12 +3398,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} @@ -3143,8 +3433,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. @@ -3159,6 +3451,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}. @@ -3241,6 +3535,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| @@ -3263,18 +3560,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 @@ -3284,6 +3590,9 @@ get({dict}, {key} [, {default}]) 'default' when it does not exist. Preferably used as a |method|: > mydict->get(key) +< + Return type: any, depending on {dict} + get({func}, {what}) Get item {what} from Funcref {func}. Possible values for {what} are: @@ -3295,6 +3604,8 @@ get({func}, {what}) Preferably used as a |method|: > myfunc->get(what) < + Return type: any, depending on {func} + *getbufinfo()* getbufinfo([{buf}]) getbufinfo([{dict}]) @@ -3370,6 +3681,8 @@ getbufinfo([{dict}]) Can also be used as a |method|: > GetBufnr()->getbufinfo() < + Return type: list<dict<any>> + *getbufline()* getbufline({buf}, {lnum} [, {end}]) @@ -3400,11 +3713,16 @@ getbufline({buf}, {lnum} [, {end}]) < Can also be used as a |method|: > GetBufnr()->getbufline(lnum) < + Return type: list<string> + *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:" @@ -3429,12 +3747,17 @@ 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<any> + getchangelist([{buf}]) *getchangelist()* Returns the |changelist| for the buffer {buf}. For the use @@ -3454,6 +3777,9 @@ getchangelist([{buf}]) *getchangelist()* Can also be used as a |method|: > GetBufnr()->getchangelist() +< + Return type: list<any> + getchar([{expr}]) *getchar()* Get a single character from the user or input stream. @@ -3534,6 +3860,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 @@ -3551,8 +3880,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. @@ -3567,6 +3898,9 @@ getcharpos({expr}) < Can also be used as a |method|: > GetMark()->getcharpos() +< + Return type: list<number> + getcharsearch() *getcharsearch()* Return the current character search information as a {dict} @@ -3588,6 +3922,8 @@ getcharsearch() *getcharsearch()* :nnoremap <expr> , getcharsearch().forward ? ',' : ';' < Also see |setcharsearch()|. + Return type: dict<any> + getcharstr([{expr}]) *getcharstr()* Get a single character from the user or input stream as a @@ -3601,6 +3937,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 @@ -3610,6 +3949,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 @@ -3621,6 +3963,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. @@ -3630,6 +3975,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. @@ -3640,6 +3988,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: @@ -3655,11 +4006,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 @@ -3734,6 +4091,8 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* Can also be used as a |method|: > GetPattern()->getcompletion('color') < + Return type: list<string> + *getcurpos()* getcurpos([{winid}]) Get the position of the cursor. This is like getpos('.'), but @@ -3763,8 +4122,10 @@ getcurpos([{winid}]) Can also be used as a |method|: > GetWinid()->getcurpos() < - *getcursorcharpos()* -getcursorcharpos([{winid}]) + Return type: list<number> + + +getcursorcharpos([{winid}]) *getcursorcharpos()* Same as |getcurpos()| but the column number in the returned List is a character index instead of a byte index. @@ -3775,9 +4136,11 @@ getcursorcharpos([{winid}]) < Can also be used as a |method|: > GetWinid()->getcursorcharpos() +< + Return type: list<number> + -< *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. @@ -3812,6 +4175,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} @@ -3825,6 +4190,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 @@ -3840,6 +4208,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}. @@ -3858,8 +4229,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}. @@ -3870,6 +4244,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 @@ -3880,6 +4257,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 @@ -3904,12 +4284,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. @@ -3932,8 +4317,10 @@ getjumplist([{winnr} [, {tabnr}]]) *getjumplist()* Can also be used as a |method|: > GetWinnr()->getjumplist() +< + Return type: list<any> -< *getline()* + *getline()* getline({lnum} [, {end}]) Without {end} the result is a String, which is line {lnum} from the current buffer. Example: > @@ -3958,8 +4345,10 @@ getline({lnum} [, {end}]) < Can also be used as a |method|: > ComputeLnum()->getline() +< + Return type: list<string> 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()* @@ -3992,6 +4381,8 @@ getloclist({nr} [, {what}]) *getloclist()* Examples (See also |getqflist-examples|): > :echo getloclist(3, {'all': 0}) :echo getloclist(5, {'filewinid': 0}) +< + Return type: list<dict<any>> or list<any> getmarklist([{buf}]) *getmarklist()* @@ -4015,6 +4406,9 @@ getmarklist([{buf}]) *getmarklist()* Can also be used as a |method|: > GetBufnr()->getmarklist() +< + Return type: list<dict<any>> or list<any> + getmatches([{win}]) *getmatches()* Returns a |List| with all matches previously defined for the @@ -4041,6 +4435,9 @@ getmatches([{win}]) *getmatches()* 'pattern': 'FIXME', 'priority': 10, 'id': 2}] > :unlet m < + Return type: list<dict<any>> or list<any> + + 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 @@ -4071,21 +4468,55 @@ 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<number> + + 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 - {expr} see |line()|. For getting the cursor position see - |getcurpos()|. + Return type: |Number| + + +getpos({expr}) *getpos()* + Get the position for String {expr}. + The accepted values for {expr} are: *E1209* + . The cursor position. + $ The last line in the current buffer. + 'x Position of mark x (if the mark is not set, 0 is + returned for all values). + w0 First line visible in current window (one if the + display isn't updated, e.g. in silent Ex mode). + w$ Last line visible in current window (this is one + less than "w0" if no lines are visible). + v When not in Visual mode, returns the cursor + position. In Visual mode, returns the other end + of the Visual area. A good way to think about + this is that in Visual mode "v" and "." complement + each other. While "." refers to the cursor + position, "v" refers to where |v_o| would move the + cursor. As a result, you can use "v" and "." + together to work on all of a selection in + characterwise Visual mode. If the cursor is at + the end of a characterwise Visual area, "v" refers + to the start of the same Visual area. And if the + cursor is at the start of a characterwise Visual + area, "v" refers to the end of the same Visual + area. "v" differs from |'<| and |'>| in that it's + updated right away. + Note that a mark in another file can be used. The line number + then applies to another buffer. + The result is a |List| with four numbers: [bufnum, lnum, col, off] "bufnum" is zero, unless a mark like '0 or 'A is used, then it @@ -4096,23 +4527,31 @@ getpos({expr}) Get the position for String {expr}. For possible values of it is the offset in screen columns from the start of the character. E.g., a position within a <Tab> or after the last character. - Note that for '< and '> Visual mode matters: when it is "V" - (visual line mode) the column of '< is zero and the column of - '> is a large number equal to |v:maxcol|. + + For getting the cursor position see |getcurpos()|. The column number in the returned List is the byte position within the line. To get the character position in the line, use |getcharpos()|. + + Note that for '< and '> Visual mode matters: when it is "V" + (visual line mode) the column of '< is zero and the column of + '> is a large number equal to |v:maxcol|. A very large column number equal to |v:maxcol| can be returned, in which case it means "after the end of the line". If {expr} is invalid, returns a list with all zeros. + This can be used to save and restore the position of a mark: > let save_a_mark = getpos("'a") ... call setpos("'a", save_a_mark) -< Also see |getcharpos()|, |getcurpos()| and |setpos()|. +< + Also see |getcharpos()|, |getcurpos()| and |setpos()|. Can also be used as a |method|: > GetMark()->getpos() +< + Return type: list<number> + getqflist([{what}]) *getqflist()* Returns a |List| with all the current quickfix errors. Each @@ -4217,6 +4656,9 @@ getqflist([{what}]) *getqflist()* :echo getqflist({'nr': 2, 'title': 1}) :echo getqflist({'lines' : ["F1:10:L10"]}) < + Return type: list<dict<any>> or list<any> + + getreg([{regname} [, 1 [, {list}]]]) *getreg()* The result is a String, which is the contents of register {regname}. Example: > @@ -4244,6 +4686,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 @@ -4273,6 +4718,9 @@ getreginfo([{regname}]) *getreginfo()* Can also be used as a |method|: > GetRegname()->getreginfo() +< + Return type: dict<any> + getregion({pos1}, {pos2} [, {opts}]) *getregion()* Returns the list of strings from {pos1} to {pos2} from a @@ -4286,14 +4734,14 @@ getregion({pos1}, {pos2} [, {opts}]) *getregion()* The optional argument {opts} is a Dict and supports the following items: - type Specify the region's selection type - (default: "v"): - "v" for |characterwise| mode - "V" for |linewise| mode - "<CTRL-V>" for |blockwise-visual| mode + type Specify the region's selection type. + See |getregtype()| for possible values, + except that the width can be omitted + and an empty string cannot be used. + (default: "v") exclusive If |TRUE|, use exclusive selection - for the end position + for the end position. (default: follow 'selection') You can get the last selection type by |visualmode()|. @@ -4326,7 +4774,46 @@ 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 + describing the buffer text segments bound by {pos1} and + {pos2}. + The segments are a pair of positions for every line: > + [[{start_pos}, {end_pos}], ...] +< + The position is a |List| with four numbers: + [bufnum, lnum, col, off] + "bufnum" is the buffer number. + "lnum" and "col" are the position in the buffer. The first + column is 1. + If the "off" number of a starting position is non-zero, it is + the offset in screen columns from the start of the character. + E.g., a position within a <Tab> or after the last character. + If the "off" number of an ending position is non-zero, it is + the offset of the character's first cell not included in the + selection, otherwise all its cells are included. + + Apart from the options supported by |getregion()|, {opts} also + supports the following: + + eol If |TRUE|, indicate positions beyond + the end of a line with "col" values + one more than the length of the line. + If |FALSE|, positions are limited + within their lines, and if a line is + empty or the selection is entirely + beyond the end of a line, a "col" + value of 0 is used for both positions. + (default: |FALSE|) + + Can also be used as a |method|: > + getpos('.')->getregionpos(getpos("'a")) < + Return type: list<string> + + getregtype([{regname}]) *getregtype()* The result is a String, which is type of register {regname}. The value will be one of: @@ -4342,6 +4829,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 @@ -4382,8 +4871,11 @@ getscriptinfo([{opts}]) *getscriptinfo()* Examples: > :echo getscriptinfo({'name': 'myscript'}) - :echo getscriptinfo({'sid': 15}).variables + :echo getscriptinfo({'sid': 15})[0].variables < + Return type: list<dict<any>> + + 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 @@ -4399,6 +4891,9 @@ gettabinfo([{tabnr}]) *gettabinfo()* Can also be used as a |method|: > GetTabnr()->gettabinfo() +< + Return type: list<dict<any>> + gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* Get the value of a tab-local variable {varname} in tab page @@ -4412,6 +4907,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 @@ -4441,6 +4939,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}. @@ -4472,6 +4973,8 @@ gettagstack([{winnr}]) *gettagstack()* Can also be used as a |method|: > GetWinnr()->gettagstack() +< + Return type: dict<any> gettext({text}) *gettext()* @@ -4485,6 +4988,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. @@ -4525,6 +5030,9 @@ getwininfo([{winid}]) *getwininfo()* Can also be used as a |method|: > GetWinnr()->getwininfo() +< + Return type: list<dict<any>> + getwinpos([{timeout}]) *getwinpos()* The result is a |List| with two numbers, the result of @@ -4549,22 +5057,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<number> + + +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: > @@ -4574,6 +5091,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. @@ -4612,6 +5132,10 @@ glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* Can also be used as a |method|: > GetExpr()->glob() +< + Return type: |String| or list<string> or list<any> depending + on {list} + glob2regpat({string}) *glob2regpat()* Convert a file pattern, as used by glob(), into a search @@ -4627,7 +5151,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: > @@ -4667,8 +5194,11 @@ globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]]) second argument: > GetExpr()->globpath(&rtp) < - *has()* -has({feature} [, {check}]) + Return type: |String| or list<string> or list<any> 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 @@ -4694,6 +5224,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} @@ -4705,6 +5237,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: @@ -4742,6 +5277,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 @@ -4776,6 +5314,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 @@ -4801,6 +5342,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| @@ -4836,6 +5380,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 @@ -4854,6 +5401,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}. @@ -4866,6 +5416,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 @@ -4878,6 +5430,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 @@ -4929,6 +5484,9 @@ hlget([{name} [, {resolve}]]) *hlget()* Can also be used as a |method|: > GetName()->hlget() < + Return type: list<dict<any>> + + hlset({list}) *hlset()* Creates or modifies the attributes of a List of highlight groups. Each item in {list} is a dictionary containing the @@ -4980,8 +5538,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 @@ -4993,12 +5553,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}. @@ -5021,8 +5587,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()|. @@ -5031,6 +5600,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 @@ -5059,6 +5631,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 @@ -5100,6 +5675,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 @@ -5148,6 +5726,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 @@ -5165,6 +5746,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 @@ -5185,6 +5769,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()|. @@ -5192,6 +5779,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 @@ -5200,6 +5790,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: @@ -5213,6 +5806,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 @@ -5234,6 +5830,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} @@ -5246,6 +5845,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 @@ -5259,6 +5860,8 @@ interrupt() *interrupt()* : endif :endfunction :au BufWritePre * call s:check_typoname(expand('<amatch>')) +< + Return type: void invert({expr}) *invert()* Bitwise invert. The argument is converted to a number. A @@ -5266,6 +5869,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 @@ -5283,6 +5889,8 @@ isabsolutepath({path}) *isabsolutepath()* < Can also be used as a |method|: > GetName()->isabsolutepath() +< + Return type: |Number| isdirectory({directory}) *isdirectory()* @@ -5293,6 +5901,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 @@ -5304,6 +5915,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 @@ -5324,6 +5938,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. > @@ -5332,6 +5949,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 @@ -5349,6 +5969,9 @@ items({dict}) *items()* Can also be used as a |method|: > mydict->items() +< + Return type: list<list<any>> or list<any> + job_ functions are documented here: |job-functions-details| @@ -5366,6 +5989,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: @@ -5376,6 +6002,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: @@ -5393,6 +6022,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 @@ -5429,6 +6061,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. @@ -5459,6 +6094,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 @@ -5466,6 +6104,9 @@ keys({dict}) *keys()* Can also be used as a |method|: > mydict->keys() +< + Return type: list<string> + keytrans({string}) *keytrans()* Turn the internal byte representation of keys into a form that @@ -5476,9 +6117,12 @@ keytrans({string}) *keytrans()* Can also be used as a |method|: > "\<C-Home>"->keytrans() +< + Return type: |String| + -< *len()* *E701* -len({expr}) The result is a Number, which is the length of the argument. +len({expr}) *len()* *E701* + The result is a Number, which is the length of the argument. When {expr} is a String or a Number the length in bytes is used, as with |strlen()|. When {expr} is a |List| the number of items in the |List| is @@ -5492,8 +6136,11 @@ len({expr}) The result is a Number, which is the length of the argument. Can also be used as a |method|: > mylist->len() +< + Return type: |Number| + -< *libcall()* *E364* *E368* + *libcall()* *E364* *E368* libcall({libname}, {funcname}, {argument}) Call function {funcname} in the run-time library {libname} with single argument {argument}. @@ -5558,30 +6205,22 @@ libcallnr({libname}, {funcname}, {argument}) third argument: > GetValue()->libcallnr("libc.so", "printf") < + Return type: |String| + line({expr} [, {winid}]) *line()* The result is a Number, which is the line number of the file position given with {expr}. The {expr} argument is a string. - The accepted positions are: *E1209* - . the cursor position - $ the last line in the current buffer - 'x position of mark x (if the mark is not set, 0 is - returned) - w0 first line visible in current window (one if the - display isn't updated, e.g. in silent Ex mode) - w$ last line visible in current window (this is one - less than "w0" if no lines are visible) - v In Visual mode: the start of the Visual area (the - cursor is the end). When not in Visual mode - returns the cursor position. Differs from |'<| in - that it's updated right away. - Note that a mark in another file can be used. The line number - then applies to another buffer. + See |getpos()| for accepted positions. + To get the column number use |col()|. To get both use |getpos()|. + With the optional {winid} argument the values are obtained for that window instead of the current window. + Returns 0 for invalid values of {expr} and {winid}. + Examples: > line(".") line number of the cursor line(".", winid) idem, in window "winid" @@ -5593,6 +6232,9 @@ line({expr} [, {winid}]) *line()* Can also be used as a |method|: > GetValue()->line() +< + Return type: |Number| + line2byte({lnum}) *line2byte()* Return the byte count from the start of the buffer for line @@ -5610,6 +6252,9 @@ line2byte({lnum}) *line2byte()* Can also be used as a |method|: > GetLnum()->line2byte() +< + Return type: |Number| + lispindent({lnum}) *lispindent()* Get the amount of indent for line {lnum} according the lisp @@ -5621,6 +6266,9 @@ lispindent({lnum}) *lispindent()* Can also be used as a |method|: > GetLnum()->lispindent() +< + Return type: |Number| + list2blob({list}) *list2blob()* Return a Blob concatenating all the number values in {list}. @@ -5634,10 +6282,13 @@ list2blob({list}) *list2blob()* Can also be used as a |method|: > GetList()->list2blob() +< + Return type: |Blob| + list2str({list} [, {utf8}]) *list2str()* - Convert each number in {list} to a character string can - concatenate them all. Examples: > + Convert each number in {list} to a character string and + concatenates them all. Examples: > list2str([32]) returns " " list2str([65, 66, 67]) returns "ABC" < The same can be done (slowly) with: > @@ -5653,6 +6304,9 @@ list2str({list} [, {utf8}]) *list2str()* Can also be used as a |method|: > GetList()->list2str() +< + Return type: |String| + listener_add({callback} [, {buf}]) *listener_add()* Add a callback function that will be invoked when changes have @@ -5729,6 +6383,9 @@ listener_add({callback} [, {buf}]) *listener_add()* Can also be used as a |method|, the base is passed as the second argument: > GetBuffer()->listener_add(callback) +< + Return type: |Number| + listener_flush([{buf}]) *listener_flush()* Invoke listener callbacks for buffer {buf}. If there are no @@ -5740,6 +6397,9 @@ listener_flush([{buf}]) *listener_flush()* Can also be used as a |method|: > GetBuffer()->listener_flush() +< + Return type: |Number| + listener_remove({id}) *listener_remove()* Remove a listener previously added with listener_add(). @@ -5748,11 +6408,16 @@ listener_remove({id}) *listener_remove()* Can also be used as a |method|: > GetListenerId()->listener_remove() +< + Return type: |Number| + localtime() *localtime()* Return the current time, measured as seconds since 1st Jan 1970. See also |strftime()|, |strptime()| and |getftime()|. + Return type: |Number| + log({expr}) *log()* Return the natural logarithm (base e) of {expr} as a |Float|. @@ -5767,6 +6432,8 @@ log({expr}) *log()* Can also be used as a |method|: > Compute()->log() +< + Return type: |Float| log10({expr}) *log10()* @@ -5781,6 +6448,9 @@ log10({expr}) *log10()* Can also be used as a |method|: > Compute()->log10() +< + Return type: |Float| + luaeval({expr} [, {expr}]) *luaeval()* Evaluate Lua expression {expr} and return its result converted @@ -5798,8 +6468,11 @@ luaeval({expr} [, {expr}]) *luaeval()* Can also be used as a |method|: > GetExpr()->luaeval() +< + Return type: any, depending on {expr} + + {only available when compiled with the |+lua| feature} -< {only available when compiled with the |+lua| feature} map({expr1}, {expr2}) *map()* {expr1} must be a |List|, |String|, |Blob| or |Dictionary|. @@ -5862,6 +6535,9 @@ map({expr1}, {expr2}) *map()* Can also be used as a |method|: > mylist->map(expr2) +< + Return type: |String|, |Blob|, list<{type}> or dict<{type}> + depending on {expr1} maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* @@ -5938,6 +6614,9 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* < Can also be used as a |method|: > GetKey()->maparg('n') +< + Return type: |String| or dict<any> depending on {dict} + mapcheck({name} [, {mode} [, {abbr}]]) *mapcheck()* Check if there is a mapping that matches with {name} in mode @@ -5974,6 +6653,8 @@ mapcheck({name} [, {mode} [, {abbr}]]) *mapcheck()* Can also be used as a |method|: > GetKey()->mapcheck('n') +< + Return type: |String| maplist([{abbr}]) *maplist()* @@ -6008,6 +6689,8 @@ maplist([{abbr}]) *maplist()* (_, m) => m.lhs == 'xyzzy')[0].mode_bits ounmap xyzzy echo printf("Operator-pending mode bit: 0x%x", op_bit) +< + Return type: list<dict<any>> mapnew({expr1}, {expr2}) *mapnew()* @@ -6016,6 +6699,9 @@ mapnew({expr1}, {expr2}) *mapnew()* unchanged. Items can still be changed by {expr2}, if you don't want that use |deepcopy()| first. + Return type: |String|, |Blob|, list<{type}> or dict<{type}> + depending on {expr1} + mapset({mode}, {abbr}, {dict}) *mapset()* mapset({dict}) @@ -6054,6 +6740,8 @@ mapset({dict}) for d in save_maps mapset(d) endfor +< + Return type: |Number| match({expr}, {pat} [, {start} [, {count}]]) *match()* @@ -6123,6 +6811,9 @@ match({expr}, {pat} [, {start} [, {count}]]) *match()* GetText()->match('word') GetList()->match('word') < + Return type: |Number| + + *matchadd()* *E290* *E798* *E799* *E801* *E957* matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]]) Defines a pattern to be highlighted in the current window (a @@ -6185,6 +6876,9 @@ matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]]) Can also be used as a |method|: > GetGroup()->matchadd('TODO') < + Return type: |Number| + + *matchaddpos()* matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]]) Same as |matchadd()|, but requires a list of positions {pos} @@ -6221,6 +6915,9 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]]) Can also be used as a |method|: > GetGroup()->matchaddpos([23, 11]) +< + Return type: |Number| + matcharg({nr}) *matcharg()* Selects the {nr} match item, as set with a |:match|, @@ -6237,6 +6934,8 @@ matcharg({nr}) *matcharg()* Can also be used as a |method|: > GetMatch()->matcharg() < + Return type: list<string> + *matchbufline()* matchbufline({buf}, {pat}, {lnum}, {end}, [, {dict}]) Returns the |List| of matches in lines from {lnum} to {end} in @@ -6284,6 +6983,9 @@ matchbufline({buf}, {pat}, {lnum}, {end}, [, {dict}]) Can also be used as a |method|: > GetBuffer()->matchbufline('mypat', 1, '$') +< + Return type: list<dict<any>> or list<any> + matchdelete({id} [, {win}) *matchdelete()* *E802* *E803* Deletes a match with ID {id} previously defined by |matchadd()| @@ -6295,6 +6997,9 @@ matchdelete({id} [, {win}) *matchdelete()* *E802* *E803* Can also be used as a |method|: > GetMatch()->matchdelete() +< + Return type: |Number| + matchend({expr}, {pat} [, {start} [, {count}]]) *matchend()* Same as |match()|, but return the index of first character @@ -6317,6 +7022,8 @@ matchend({expr}, {pat} [, {start} [, {count}]]) *matchend()* Can also be used as a |method|: > GetText()->matchend('word') +< + Return type: |Number| matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()* @@ -6382,6 +7089,9 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()* \ {'matchseq': 1}) < results in ['two one']. + Return type: list<string> or list<any> + + matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()* Same as |matchfuzzy()|, but returns the list of matched strings, the list of character positions where characters @@ -6403,6 +7113,9 @@ matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()* :echo [{'text': 'hello', 'id' : 10}]->matchfuzzypos('ll', {'key' : 'text'}) < results in [[{'id': 10, 'text': 'hello'}], [[2, 3]], [127]] + Return type: list<list<any>> + + matchlist({expr}, {pat} [, {start} [, {count}]]) *matchlist()* Same as |match()|, but return a |List|. The first item in the list is the matched string, same as what matchstr() would @@ -6418,6 +7131,8 @@ matchlist({expr}, {pat} [, {start} [, {count}]]) *matchlist()* Can also be used as a |method|: > GetText()->matchlist('word') < + Return type: list<string> or list<any> + *matchstrlist()* matchstrlist({list}, {pat} [, {dict}]) Returns the |List| of matches in {list} where {pat} matches. @@ -6454,6 +7169,9 @@ matchstrlist({list}, {pat} [, {dict}]) Can also be used as a |method|: > GetListOfStrings()->matchstrlist('mypat') +< + Return type: list<dict<any>> or list<any> + matchstr({expr}, {pat} [, {start} [, {count}]]) *matchstr()* Same as |match()|, but return the matched string. Example: > @@ -6470,6 +7188,9 @@ matchstr({expr}, {pat} [, {start} [, {count}]]) *matchstr()* Can also be used as a |method|: > GetText()->matchstr('word') +< + Return type: |String| + matchstrpos({expr}, {pat} [, {start} [, {count}]]) *matchstrpos()* Same as |matchstr()|, but return the matched string, the start @@ -6492,9 +7213,11 @@ matchstrpos({expr}, {pat} [, {start} [, {count}]]) *matchstrpos()* Can also be used as a |method|: > GetText()->matchstrpos('word') < + Return type: list<any> - *max()* -max({expr}) Return the maximum value of all items in {expr}. Example: > + +max({expr}) *max()* + Return the maximum value of all items in {expr}. Example: > echo max([apples, pears, oranges]) < {expr} can be a |List| or a |Dictionary|. For a Dictionary, @@ -6505,6 +7228,8 @@ max({expr}) Return the maximum value of all items in {expr}. Example: > Can also be used as a |method|: > mylist->max() +< + Return type: |Number| menu_info({name} [, {mode}]) *menu_info()* @@ -6579,10 +7304,11 @@ menu_info({name} [, {mode}]) *menu_info()* < Can also be used as a |method|: > GetMenuName()->menu_info('v') +< + Return type: dict<any> - -< *min()* -min({expr}) Return the minimum value of all items in {expr}. Example: > +min({expr}) *min()* + Return the minimum value of all items in {expr}. Example: > echo min([apples, pears, oranges]) < {expr} can be a |List| or a |Dictionary|. For a Dictionary, @@ -6593,25 +7319,24 @@ min({expr}) Return the minimum value of all items in {expr}. Example: > Can also be used as a |method|: > mylist->min() +< + Return type: |Number| -< *mkdir()* *E739* -mkdir({name} [, {flags} [, {prot}]]) + +mkdir({name} [, {flags} [, {prot}]]) *mkdir()* *E739* Create directory {name}. When {flags} is present it must be a string. An empty string has no effect. - If {flags} contains "p" then intermediate directories are - created as necessary. + {flags} can contain these character flags: + "p" intermediate directories will be created as necessary + "D" {name} will be deleted at the end of the current + function, but not recursively |:defer| + "R" {name} will be deleted recursively at the end of the + current function |:defer| - If {flags} contains "D" then {name} is deleted at the end of - the current function, as with: > - defer delete({name}, 'd') -< - If {flags} contains "R" then {name} is deleted recursively at - the end of the current function, as with: > - defer delete({name}, 'rf') -< Note that when {name} has more than one part and "p" is used + Note that when {name} has more than one part and "p" is used some directories may already exist. Only the first one that is created and what it contains is scheduled to be deleted. E.g. when using: > @@ -6647,8 +7372,11 @@ mkdir({name} [, {flags} [, {prot}]]) < Can also be used as a |method|: > GetName()->mkdir() < - *mode()* -mode([{expr}]) Return a string that indicates the current mode. + Return type: |Number| + + +mode([{expr}]) *mode()* + Return a string that indicates the current mode. If {expr} is supplied and it evaluates to a non-zero Number or a non-empty String (|non-zero-arg|), then the full mode is returned, otherwise only the first letter is returned. @@ -6704,6 +7432,9 @@ mode([{expr}]) Return a string that indicates the current mode. Can also be used as a |method|: > DoFull()->mode() +< + Return type: |String| + mzeval({expr}) *mzeval()* Evaluate MzScheme expression {expr} and return its result @@ -6726,8 +7457,11 @@ mzeval({expr}) *mzeval()* Can also be used as a |method|: > GetExpr()->mzeval() < + Return type: any, depending on {expr} + {only available when compiled with the |+mzscheme| feature} + nextnonblank({lnum}) *nextnonblank()* Return the line number of the first line at or below {lnum} that is not blank. Example: > @@ -6739,6 +7473,9 @@ nextnonblank({lnum}) *nextnonblank()* Can also be used as a |method|: > GetLnum()->nextnonblank() +< + Return type: |Number| + nr2char({expr} [, {utf8}]) *nr2char()* Return a string with a single character, which has the number @@ -6760,6 +7497,9 @@ nr2char({expr} [, {utf8}]) *nr2char()* Can also be used as a |method|: > GetNumber()->nr2char() +< + Return type: |String| + or({expr}, {expr}) *or()* Bitwise OR on the two arguments. The arguments are converted @@ -6775,6 +7515,8 @@ or({expr}, {expr}) *or()* to separate commands. In many places it would not be clear if "|" is an operator or a command separator. + Return type: |Number| + pathshorten({path} [, {len}]) *pathshorten()* Shorten directory names in the path {path} and return the @@ -6792,6 +7534,9 @@ pathshorten({path} [, {len}]) *pathshorten()* Can also be used as a |method|: > GetDirectories()->pathshorten() +< + Return type: |String| + perleval({expr}) *perleval()* Evaluate Perl expression {expr} in scalar context and return @@ -6808,8 +7553,10 @@ perleval({expr}) *perleval()* Can also be used as a |method|: > GetExpr()->perleval() +< + Return type: any, depending on {expr} -< {only available when compiled with the |+perl| feature} + {only available when compiled with the |+perl| feature} popup_ functions are documented here: |popup-functions| @@ -6829,6 +7576,9 @@ pow({x}, {y}) *pow()* Can also be used as a |method|: > Compute()->pow(3) +< + Return type: |Number| + prevnonblank({lnum}) *prevnonblank()* Return the line number of the first line at or above {lnum} @@ -6841,6 +7591,9 @@ prevnonblank({lnum}) *prevnonblank()* Can also be used as a |method|: > GetLnum()->prevnonblank() +< + Return type: |Number| + printf({fmt}, {expr1} ...) *printf()* Return a String with {fmt}, where "%" items are replaced by @@ -7167,6 +7920,8 @@ printf({fmt}, {expr1} ...) *printf()* into this, copying the exact format string and parameters that were used. + Return type: |String| + prompt_getprompt({buf}) *prompt_getprompt()* Returns the effective prompt text for buffer {buf}. {buf} can @@ -7177,8 +7932,10 @@ prompt_getprompt({buf}) *prompt_getprompt()* Can also be used as a |method|: > GetBuffer()->prompt_getprompt() +< + Return type: |String| -< {only available when compiled with the |+channel| feature} + {only available when compiled with the |+channel| feature} prompt_setcallback({buf}, {expr}) *prompt_setcallback()* @@ -7229,8 +7986,10 @@ prompt_setinterrupt({buf}, {expr}) *prompt_setinterrupt()* Can also be used as a |method|: > GetBuffer()->prompt_setinterrupt(callback) +< + Return type: |Number| -< {only available when compiled with the |+channel| feature} + {only available when compiled with the |+channel| feature} prompt_setprompt({buf}, {text}) *prompt_setprompt()* Set prompt for buffer {buf} to {text}. You most likely want @@ -7241,8 +8000,10 @@ prompt_setprompt({buf}, {text}) *prompt_setprompt()* < Can also be used as a |method|: > GetBuffer()->prompt_setprompt('command: ') +< + Return type: |Number| -< {only available when compiled with the |+channel| feature} + {only available when compiled with the |+channel| feature} prop_ functions are documented here: |text-prop-functions| @@ -7260,12 +8021,18 @@ pum_getpos() *pum_getpos()* The values are the same as in |v:event| during |CompleteChanged|. + Return type: dict<any> + + pumvisible() *pumvisible()* Returns non-zero when the popup menu is visible, zero otherwise. See |ins-completion-menu|. This can be used to avoid some things that would remove the popup menu. + Return type: |Number| + + py3eval({expr}) *py3eval()* Evaluate Python expression {expr} and return its result converted to Vim data structures. @@ -7280,8 +8047,10 @@ py3eval({expr}) *py3eval()* Can also be used as a |method|: > GetExpr()->py3eval() +< + Return type: any, depending on {expr} -< {only available when compiled with the |+python3| feature} + {only available when compiled with the |+python3| feature} *E858* *E859* pyeval({expr}) *pyeval()* @@ -7297,8 +8066,10 @@ pyeval({expr}) *pyeval()* Can also be used as a |method|: > GetExpr()->pyeval() +< + Return type: any, depending on {expr} -< {only available when compiled with the |+python| feature} + {only available when compiled with the |+python| feature} pyxeval({expr}) *pyxeval()* Evaluate Python expression {expr} and return its result @@ -7307,9 +8078,11 @@ pyxeval({expr}) *pyxeval()* See also: |pyeval()|, |py3eval()| Can also be used as a |method|: > - GetExpr()->pyxeval() + < GetExpr()->pyxeval() +< + Return type: any, depending on {expr} -< {only available when compiled with the |+python| or the + {only available when compiled with the |+python| or the |+python3| feature} rand([{expr}]) *rand()* *random* @@ -7327,6 +8100,7 @@ rand([{expr}]) *rand()* *random* :echo rand(seed) :echo rand(seed) % 16 " random number 0 - 15 < + Return type: |Number| *E726* *E727* range({expr} [, {max} [, {stride}]]) *range()* @@ -7350,6 +8124,8 @@ range({expr} [, {max} [, {stride}]]) *range()* Can also be used as a |method|: > GetExpr()->range() < + Return type: list<number> + readblob({fname} [, {offset} [, {size}]]) *readblob()* Read file {fname} in binary mode and return a |Blob|. @@ -7375,6 +8151,8 @@ readblob({fname} [, {offset} [, {size}]]) *readblob()* is truncated. Also see |readfile()| and |writefile()|. + Return type: |Blob| + readdir({directory} [, {expr} [, {dict}]]) *readdir()* Return a list with file and directory names in {directory}. @@ -7432,6 +8210,9 @@ readdir({directory} [, {expr} [, {dict}]]) *readdir()* Can also be used as a |method|: > GetDirName()->readdir() < + Return type: list<string> or list<any> + + readdirex({directory} [, {expr} [, {dict}]]) *readdirex()* Extended version of |readdir()|. Return a list of Dictionaries with file and directory @@ -7491,6 +8272,8 @@ readdirex({directory} [, {expr} [, {dict}]]) *readdirex()* Can also be used as a |method|: > GetDirName()->readdirex() < + Return type: list<dict<any>> or list<any> + *readfile()* readfile({fname} [, {type} [, {max}]]) @@ -7529,6 +8312,8 @@ readfile({fname} [, {type} [, {max}]]) Can also be used as a |method|: > GetFileName()->readfile() +< + Return type: list<string> or list<any> reduce({object}, {func} [, {initial}]) *reduce()* *E998* {func} is called for every item in {object}, which can be a @@ -7549,6 +8334,9 @@ reduce({object}, {func} [, {initial}]) *reduce()* *E998* < Can also be used as a |method|: > echo mylist->reduce({ acc, val -> acc + val }, 0) +< + Return type: |String|, |Blob|, list<{type}> or dict<{type}> + depending on {object} and {func} reg_executing() *reg_executing()* @@ -7556,13 +8344,19 @@ reg_executing() *reg_executing()* Returns an empty string when no register is being executed. See |@|. + Return type: |String| + + reg_recording() *reg_recording()* Returns the single letter name of the register being recorded. Returns an empty string when not recording. See |q|. -reltime() + Return type: |String| + + +reltime() *reltime()* reltime({start}) -reltime({start}, {end}) *reltime()* +reltime({start}, {end}) Return an item that represents a time value. The item is a list with items that depend on the system. In Vim 9 script the type list<any> can be used. @@ -7588,8 +8382,11 @@ reltime({start}, {end}) *reltime()* Can also be used as a |method|: > GetStart()->reltime() < + Return type: list<number> + {only available when compiled with the |+reltime| feature} + reltimefloat({time}) *reltimefloat()* Return a Float that represents the time value of {time}. Example: > @@ -7603,8 +8400,11 @@ reltimefloat({time}) *reltimefloat()* Can also be used as a |method|: > reltime(start)->reltimefloat() +< + Return type: |Float| + + {only available when compiled with the |+reltime| feature} -< {only available when compiled with the |+reltime| feature} reltimestr({time}) *reltimestr()* Return a String that represents the time value of {time}. @@ -7625,8 +8425,10 @@ reltimestr({time}) *reltimestr()* Can also be used as a |method|: > reltime(start)->reltimestr() +< + Return type: |String| -< {only available when compiled with the |+reltime| feature} + {only available when compiled with the |+reltime| feature} *remote_expr()* *E449* remote_expr({server}, {string} [, {idvar} [, {timeout}]]) @@ -7663,6 +8465,9 @@ remote_expr({server}, {string} [, {idvar} [, {timeout}]]) < Can also be used as a |method|: > ServerName()->remote_expr(expr) +< + Return type: |String| or list<{type}> + remote_foreground({server}) *remote_foreground()* Move the Vim server with the name {server} to the foreground. @@ -7678,8 +8483,10 @@ remote_foreground({server}) *remote_foreground()* Can also be used as a |method|: > ServerName()->remote_foreground() +< + Return type: |Number| -< {only in the Win32, Motif and GTK GUI versions and the + {only in the Win32, Motif and GTK GUI versions and the Win32 console version} @@ -7699,6 +8506,9 @@ remote_peek({serverid} [, {retvar}]) *remote_peek()* < Can also be used as a |method|: > ServerId()->remote_peek() +< + Return type: |Number| + remote_read({serverid}, [{timeout}]) *remote_read()* Return the oldest available reply from {serverid} and consume @@ -7714,8 +8524,10 @@ remote_read({serverid}, [{timeout}]) *remote_read()* < Can also be used as a |method|: > ServerId()->remote_read() < - *remote_send()* *E241* -remote_send({server}, {string} [, {idvar}]) + Return type: |String| + + +remote_send({server}, {string} [, {idvar}]) *remote_send()* *E241* Send the {string} to {server}. The {server} argument is a string, also see |{server}|. @@ -7745,19 +8557,24 @@ remote_send({server}, {string} [, {idvar}]) Can also be used as a |method|: > ServerName()->remote_send(keys) < - *remote_startserver()* *E941* *E942* -remote_startserver({name}) + Return type: |String| + + +remote_startserver({name}) *remote_startserver()* *E941* *E942* Become the server {name}. {name} must be a non-empty string. This fails if already running as a server, when |v:servername| is not empty. Can also be used as a |method|: > ServerName()->remote_startserver() +< + Return type: |Number| + + {only available when compiled with the |+clientserver| feature} -< {only available when compiled with the |+clientserver| feature} -remove({list}, {idx}) -remove({list}, {idx}, {end}) *remove()* +remove({list}, {idx}) *remove()* +remove({list}, {idx}, {end}) Without {end}: Remove the item at {idx} from |List| {list} and return the item. With {end}: Remove items from {idx} to {end} (inclusive) and @@ -7774,6 +8591,9 @@ remove({list}, {idx}, {end}) *remove()* Can also be used as a |method|: > mylist->remove(idx) +< + Return type: any, depending on {list} + remove({blob}, {idx}) remove({blob}, {idx}, {end}) @@ -7787,6 +8607,8 @@ remove({blob}, {idx}, {end}) Example: > :echo "last byte: " .. remove(myblob, -1) :call remove(mylist, 0, 9) +< + Return type: |Number| remove({dict}, {key}) Remove the entry from {dict} with key {key} and return it. @@ -7795,6 +8617,9 @@ remove({dict}, {key}) < If there is no {key} in {dict} this is an error. Returns zero on error. + Return type: any, depending on {dict} + + rename({from}, {to}) *rename()* Rename the file by the name {from} to the name {to}. This should also work to move files across file systems. The @@ -7805,6 +8630,9 @@ rename({from}, {to}) *rename()* Can also be used as a |method|: > GetOldName()->rename(newname) +< + Return type: |Number| + repeat({expr}, {count}) *repeat()* Repeat {expr} {count} times and return the concatenated @@ -7818,6 +8646,10 @@ repeat({expr}, {count}) *repeat()* Can also be used as a |method|: > mylist->repeat(count) +< + Return type: |String|, |Blob| or list<{type}> depending on + {expr} + resolve({filename}) *resolve()* *E655* On MS-Windows, when {filename} is a shortcut (a .lnk file), @@ -7837,6 +8669,9 @@ resolve({filename}) *resolve()* *E655* Can also be used as a |method|: > GetName()->resolve() +< + Return type: |String| + reverse({object}) *reverse()* Reverse the order of items in {object}. {object} can be a @@ -7849,6 +8684,10 @@ reverse({object}) *reverse()* :let revlist = reverse(copy(mylist)) < Can also be used as a |method|: > mylist->reverse() +< + Return type: |String|, |Blob| or list<{type}> depending on + {object} + round({expr}) *round()* Round off {expr} to the nearest integral value and return it @@ -7866,6 +8705,9 @@ round({expr}) *round()* Can also be used as a |method|: > Compute()->round() +< + Return type: |Float| + rubyeval({expr}) *rubyeval()* Evaluate Ruby expression {expr} and return its result @@ -7881,8 +8723,10 @@ rubyeval({expr}) *rubyeval()* Can also be used as a |method|: > GetRubyExpr()->rubyeval() +< + Return type: any, depending on {expr} -< {only available when compiled with the |+ruby| feature} + {only available when compiled with the |+ruby| feature} screenattr({row}, {col}) *screenattr()* Like |screenchar()|, but return the attribute. This is a rather @@ -7892,6 +8736,9 @@ screenattr({row}, {col}) *screenattr()* Can also be used as a |method|: > GetRow()->screenattr(col) +< + Return type: |Number| + screenchar({row}, {col}) *screenchar()* The result is a Number, which is the character at position @@ -7905,6 +8752,9 @@ screenchar({row}, {col}) *screenchar()* Can also be used as a |method|: > GetRow()->screenchar(col) +< + Return type: |Number| + screenchars({row}, {col}) *screenchars()* The result is a |List| of Numbers. The first number is the same @@ -7915,6 +8765,9 @@ screenchars({row}, {col}) *screenchars()* Can also be used as a |method|: > GetRow()->screenchars(col) +< + Return type: list<number> or list<any> + screencol() *screencol()* The result is a Number, which is the current screen column of @@ -7930,6 +8783,9 @@ screencol() *screencol()* nnoremap <silent> GG :echom screencol()<CR> nnoremap GG <Cmd>echom screencol()<CR> < + Return type: |Number| + + screenpos({winid}, {lnum}, {col}) *screenpos()* The result is a Dict with the screen position of the text character in window {winid} at buffer line {lnum} and column @@ -7956,6 +8812,9 @@ screenpos({winid}, {lnum}, {col}) *screenpos()* Can also be used as a |method|: > GetWinid()->screenpos(lnum, col) +< + Return type: dict<number> or dict<any> + screenrow() *screenrow()* The result is a Number, which is the current screen row of the @@ -7965,6 +8824,9 @@ screenrow() *screenrow()* Note: Same restrictions as with |screencol()|. + Return type: |Number| + + screenstring({row}, {col}) *screenstring()* The result is a String that contains the base character and any composing characters at position [row, col] on the screen. @@ -7976,6 +8838,8 @@ screenstring({row}, {col}) *screenstring()* Can also be used as a |method|: > GetRow()->screenstring(col) < + Return type: |String| + *search()* search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]]) Search for regexp pattern {pattern}. The search starts at the @@ -8082,6 +8946,9 @@ search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]]) Can also be used as a |method|: > GetPattern()->search() +< + Return type: |Number| + searchcount([{options}]) *searchcount()* Get or update the last search count, like what is displayed @@ -8208,6 +9075,9 @@ searchcount([{options}]) *searchcount()* Can also be used as a |method|: > GetSearchOpts()->searchcount() < + Return type: dict<number> + + searchdecl({name} [, {global} [, {thisblock}]]) *searchdecl()* Search for the declaration of {name}. @@ -8229,6 +9099,8 @@ searchdecl({name} [, {global} [, {thisblock}]]) *searchdecl()* Can also be used as a |method|: > GetName()->searchdecl() < + Return type: |Number| + *searchpair()* searchpair({start}, {middle}, {end} [, {flags} [, {skip} [, {stopline} [, {timeout}]]]]) @@ -8317,6 +9189,8 @@ searchpair({start}, {middle}, {end} [, {flags} [, {skip} :echo searchpair('{', '', '}', 'bW', \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"') < + Return type: |Number| + *searchpairpos()* searchpairpos({start}, {middle}, {end} [, {flags} [, {skip} [, {stopline} [, {timeout}]]]]) @@ -8330,6 +9204,8 @@ searchpairpos({start}, {middle}, {end} [, {flags} [, {skip} < See |match-parens| for a bigger and more useful example. + Return type: list<number> + *searchpos()* searchpos({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]]) Same as |search()|, but returns a |List| with the line and @@ -8348,6 +9224,9 @@ searchpos({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]]) Can also be used as a |method|: > GetPattern()->searchpos() +< + Return type: list<number> + server2client({clientid}, {string}) *server2client()* Send a reply string to {clientid}. The most recent {clientid} @@ -8365,6 +9244,9 @@ server2client({clientid}, {string}) *server2client()* < Can also be used as a |method|: > GetClientId()->server2client(string) < + Return type: |Number| + + serverlist() *serverlist()* Return a list of available server names, one per line. When there are no servers or the information is not available @@ -8373,6 +9255,9 @@ serverlist() *serverlist()* Example: > :echo serverlist() < + Return type: |String| + + setbufline({buf}, {lnum}, {text}) *setbufline()* Set line {lnum} to {text} in buffer {buf}. This works like |setline()| for the specified buffer. @@ -8403,6 +9288,9 @@ setbufline({buf}, {lnum}, {text}) *setbufline()* Can also be used as a |method|, the base is passed as the third argument: > GetText()->setbufline(buf, lnum) +< + Return type: |Number| + setbufvar({buf}, {varname}, {val}) *setbufvar()* Set option or local variable {varname} in buffer {buf} to @@ -8421,6 +9309,8 @@ setbufvar({buf}, {varname}, {val}) *setbufvar()* Can also be used as a |method|, the base is passed as the third argument: > GetValue()->setbufvar(buf, varname) +< + Return type: |Number| setcellwidths({list}) *setcellwidths()* @@ -8457,6 +9347,8 @@ setcellwidths({list}) *setcellwidths()* match with what Vim knows about each emoji. If it doesn't look right you need to adjust the {list} argument. + Return type: |Number| + setcharpos({expr}, {list}) *setcharpos()* Same as |setpos()| but uses the specified column number as the @@ -8471,6 +9363,9 @@ setcharpos({expr}, {list}) *setcharpos()* Can also be used as a |method|: > GetPosition()->setcharpos('.') +< + Return type: |Number| + setcharsearch({dict}) *setcharsearch()* Set the current character search information to {dict}, @@ -8494,6 +9389,9 @@ setcharsearch({dict}) *setcharsearch()* Can also be used as a |method|: > SavedSearch()->setcharsearch() +< + Return type: dict<any> + setcmdline({str} [, {pos}]) *setcmdline()* Set the command line to {str} and set the cursor position to @@ -8504,6 +9402,9 @@ setcmdline({str} [, {pos}]) *setcmdline()* Can also be used as a |method|: > GetText()->setcmdline() +< + Return type: |Number| + setcmdpos({pos}) *setcmdpos()* Set the cursor position in the command line to byte position @@ -8522,6 +9423,9 @@ setcmdpos({pos}) *setcmdpos()* Can also be used as a |method|: > GetPos()->setcmdpos() +< + Return type: |Number| + setcursorcharpos({lnum}, {col} [, {off}]) *setcursorcharpos()* setcursorcharpos({list}) @@ -8537,6 +9441,8 @@ setcursorcharpos({list}) Can also be used as a |method|: > GetCursorPos()->setcursorcharpos() +< + Return type: |Number| setenv({name}, {val}) *setenv()* @@ -8549,6 +9455,9 @@ setenv({name}, {val}) *setenv()* Can also be used as a |method|, the base is passed as the second argument: > GetPath()->setenv('PATH') +< + Return type: |Number| + setfperm({fname}, {mode}) *setfperm()* *chmod* Set the file permissions for {fname} to {mode}. @@ -8570,11 +9479,14 @@ setfperm({fname}, {mode}) *setfperm()* *chmod* < To read permissions see |getfperm()|. + Return type: |Number| + setline({lnum}, {text}) *setline()* Set line {lnum} of the current buffer to {text}. To insert lines use |append()|. To set lines in another buffer use - |setbufline()|. Any text properties in {lnum} are cleared. + |setbufline()|. + Any text properties in {lnum} are cleared |text-prop-cleared|. {lnum} is used like with |getline()|. When {lnum} is just below the last line the {text} will be @@ -8603,6 +9515,9 @@ setline({lnum}, {text}) *setline()* Can also be used as a |method|, the base is passed as the second argument: > GetText()->setline(lnum) +< + Return type: |Number| + setloclist({nr}, {list} [, {action} [, {what}]]) *setloclist()* Create or replace or add to the location list for window {nr}. @@ -8623,6 +9538,9 @@ setloclist({nr}, {list} [, {action} [, {what}]]) *setloclist()* Can also be used as a |method|, the base is passed as the second argument: > GetLoclist()->setloclist(winnr) +< + Return type: |Number| + setmatches({list} [, {win}]) *setmatches()* Restores a list of matches saved by |getmatches()| for the @@ -8635,8 +9553,10 @@ setmatches({list} [, {win}]) *setmatches()* Can also be used as a |method|: > GetMatches()->setmatches() < - *setpos()* -setpos({expr}, {list}) + Return type: |Number| + + +setpos({expr}, {list}) *setpos()* Set the position for String {expr}. Possible values: . the cursor 'x mark x @@ -8687,6 +9607,9 @@ setpos({expr}, {list}) Can also be used as a |method|: > GetPosition()->setpos('.') +< + Return type: |Number| + setqflist({list} [, {action} [, {what}]]) *setqflist()* Create or replace or add to the quickfix list. @@ -8805,8 +9728,10 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()* second argument: > GetErrorlist()->setqflist() < - *setreg()* -setreg({regname}, {value} [, {options}]) + Return type: |Number| + + +setreg({regname}, {value} [, {options}]) *setreg()* Set the register {regname} to {value}. If {regname} is "" or "@", the unnamed register '"' is used. The {regname} argument is a string. In |Vim9-script| @@ -8864,6 +9789,9 @@ setreg({regname}, {value} [, {options}]) < Can also be used as a |method|, the base is passed as the second argument: > GetText()->setreg('a') +< + Return type: |Number| + settabvar({tabnr}, {varname}, {val}) *settabvar()* Set tab-local variable {varname} to {val} in tab page {tabnr}. @@ -8878,6 +9806,9 @@ settabvar({tabnr}, {varname}, {val}) *settabvar()* Can also be used as a |method|, the base is passed as the third argument: > GetValue()->settabvar(tab, name) +< + Return type: |Number| + settabwinvar({tabnr}, {winnr}, {varname}, {val}) *settabwinvar()* Set option or local variable {varname} in window {winnr} to @@ -8900,6 +9831,9 @@ settabwinvar({tabnr}, {winnr}, {varname}, {val}) *settabwinvar()* Can also be used as a |method|, the base is passed as the fourth argument: > GetValue()->settabwinvar(tab, winnr, name) +< + Return type: |Number| + settagstack({nr}, {dict} [, {action}]) *settagstack()* Modify the tag stack of the window {nr} using {dict}. @@ -8937,6 +9871,9 @@ settagstack({nr}, {dict} [, {action}]) *settagstack()* Can also be used as a |method|, the base is passed as the second argument: > GetStack()->settagstack(winnr) +< + Return type: |Number| + setwinvar({winnr}, {varname}, {val}) *setwinvar()* Like |settabwinvar()| for the current tab page. @@ -8947,6 +9884,9 @@ setwinvar({winnr}, {varname}, {val}) *setwinvar()* < Can also be used as a |method|, the base is passed as the third argument: > GetValue()->setwinvar(winnr, name) +< + Return type: |Number| + sha256({string}) *sha256()* Returns a String with 64 hex characters, which is the SHA256 @@ -8954,8 +9894,10 @@ sha256({string}) *sha256()* Can also be used as a |method|: > GetText()->sha256() +< + Return type: |String| -< {only available when compiled with the |+cryptv| feature} + {only available when compiled with the |+cryptv| feature} shellescape({string} [, {special}]) *shellescape()* Escape {string} for use as a shell command argument. @@ -8969,11 +9911,12 @@ shellescape({string} [, {special}]) *shellescape()* Otherwise it will enclose {string} in single quotes and replace all "'" with "'\''". - When the {special} argument is present and it's a non-zero - Number or a non-empty String (|non-zero-arg|), then special - items such as "!", "%", "#" and "<cword>" will be preceded by - a backslash. This backslash will be removed again by the |:!| - command. + The {special} argument adds additional escaping of keywords + used in Vim commands. When it is not omitted and a non-zero + number or a non-empty String (|non-zero-arg|), then special + items such as "!", "%", "#" and "<cword>" (as listed in + |expand()|) will be preceded by a backslash. + This backslash will be removed again by the |:!| command. The "!" character will be escaped (again with a |non-zero-arg| {special}) when 'shell' contains "csh" in the tail. That is @@ -8997,6 +9940,9 @@ shellescape({string} [, {special}]) *shellescape()* Can also be used as a |method|: > GetCommand()->shellescape() +< + Return type: |String| + shiftwidth([{col}]) *shiftwidth()* Returns the effective value of 'shiftwidth'. This is the @@ -9012,6 +9958,8 @@ shiftwidth([{col}]) *shiftwidth()* Can also be used as a |method|: > GetColumn()->shiftwidth() +< + Return type: |Number| sign_ functions are documented here: |sign-functions-details| @@ -9035,6 +9983,9 @@ simplify({filename}) *simplify()* Can also be used as a |method|: > GetName()->simplify() +< + Return type: |String| + sin({expr}) *sin()* Return the sine of {expr}, measured in radians, as a |Float|. @@ -9048,6 +9999,8 @@ sin({expr}) *sin()* Can also be used as a |method|: > Compute()->sin() +< + Return type: |Float| sinh({expr}) *sinh()* @@ -9063,6 +10016,8 @@ sinh({expr}) *sinh()* Can also be used as a |method|: > Compute()->sinh() +< + Return type: |Float| slice({expr}, {start} [, {end}]) *slice()* @@ -9077,6 +10032,8 @@ slice({expr}, {start} [, {end}]) *slice()* Can also be used as a |method|: > GetList()->slice(offset) +< + Return type: list<{type}> sort({list} [, {how} [, {dict}]]) *sort()* *E702* @@ -9156,12 +10113,17 @@ sort({list} [, {how} [, {dict}]]) *sort()* *E702* < For a simple expression you can use a lambda: > eval mylist->sort({i1, i2 -> i1 - i2}) < + Return type: list<{type}> + + sound_clear() *sound_clear()* Stop playing all sounds. On some Linux systems you may need the libcanberra-pulse package, otherwise sound may not stop. + Return type: |Number| + {only available when compiled with the |+sound| feature} *sound_playevent()* @@ -9197,8 +10159,10 @@ sound_playevent({name} [, {callback}]) Can also be used as a |method|: > GetSoundName()->sound_playevent() +< + Return type: |Number| -< {only available when compiled with the |+sound| feature} + {only available when compiled with the |+sound| feature} *sound_playfile()* sound_playfile({path} [, {callback}]) @@ -9209,8 +10173,10 @@ sound_playfile({path} [, {callback}]) < Can also be used as a |method|: > GetSoundPath()->sound_playfile() +< + Return type: |Number| -< {only available when compiled with the |+sound| feature} + {only available when compiled with the |+sound| feature} sound_stop({id}) *sound_stop()* @@ -9225,8 +10191,10 @@ sound_stop({id}) *sound_stop()* Can also be used as a |method|: > soundid->sound_stop() +< + Return type: |Number| -< {only available when compiled with the |+sound| feature} + {only available when compiled with the |+sound| feature} *soundfold()* soundfold({word}) @@ -9240,8 +10208,10 @@ soundfold({word}) Can also be used as a |method|: > GetWord()->soundfold() < - *spellbadword()* -spellbadword([{sentence}]) + Return type: |String| + + +spellbadword([{sentence}]) *spellbadword()* Without argument: The result is the badly spelled word under or after the cursor. The cursor is moved to the start of the bad word. When no bad word is found in the cursor line the @@ -9268,8 +10238,10 @@ spellbadword([{sentence}]) Can also be used as a |method|: > GetText()->spellbadword() < - *spellsuggest()* -spellsuggest({word} [, {max} [, {capital}]]) + Return type: list<string> + + +spellsuggest({word} [, {max} [, {capital}]]) *spellsuggest()* Return a |List| with spelling suggestions to replace {word}. When {max} is given up to this number of suggestions are returned. Otherwise up to 25 suggestions are returned. @@ -9292,6 +10264,9 @@ spellsuggest({word} [, {max} [, {capital}]]) Can also be used as a |method|: > GetWord()->spellsuggest() +< + Return type: list<string> or list<any> + split({string} [, {pattern} [, {keepempty}]]) *split()* Make a |List| out of {string}. When {pattern} is omitted or @@ -9318,6 +10293,8 @@ split({string} [, {pattern} [, {keepempty}]]) *split()* Can also be used as a |method|: > GetString()->split() +< + Return type: list<string> sqrt({expr}) *sqrt()* Return the non-negative square root of Float {expr} as a @@ -9334,6 +10311,8 @@ sqrt({expr}) *sqrt()* Can also be used as a |method|: > Compute()->sqrt() +< + Return type: |Float| srand([{expr}]) *srand()* @@ -9349,6 +10328,9 @@ srand([{expr}]) *srand()* :let seed = srand() :let seed = srand(userinput) :echo rand(seed) +< + Return type: list<number> + state([{what}]) *state()* Return a string which contains characters indicating the @@ -9386,6 +10368,9 @@ state([{what}]) *state()* recursiveness up to "ccc") s screen has scrolled for messages + Return type: |String| + + str2float({string} [, {quoted}]) *str2float()* Convert String {string} to a Float. This mostly works the same as when using a floating point number in an expression, @@ -9407,6 +10392,9 @@ str2float({string} [, {quoted}]) *str2float()* Can also be used as a |method|: > let f = text->substitute(',', '', 'g')->str2float() +< + Return type: |Float| + str2list({string} [, {utf8}]) *str2list()* Return a list containing the number values which represent @@ -9423,6 +10411,8 @@ str2list({string} [, {utf8}]) *str2list()* < Can also be used as a |method|: > GetString()->str2list() +< + Return type: list<number> str2nr({string} [, {base} [, {quoted}]]) *str2nr()* @@ -9446,6 +10436,8 @@ str2nr({string} [, {base} [, {quoted}]]) *str2nr()* Can also be used as a |method|: > GetText()->str2nr() +< + Return type: |Number| strcharlen({string}) *strcharlen()* @@ -9460,6 +10452,8 @@ strcharlen({string}) *strcharlen()* Can also be used as a |method|: > GetText()->strcharlen() +< + Return type: |Number| strcharpart({src}, {start} [, {len} [, {skipcc}]]) *strcharpart()* @@ -9479,6 +10473,8 @@ strcharpart({src}, {start} [, {len} [, {skipcc}]]) *strcharpart()* Can also be used as a |method|: > GetText()->strcharpart(5) +< + Return type: |String| strchars({string} [, {skipcc}]) *strchars()* @@ -9511,6 +10507,9 @@ strchars({string} [, {skipcc}]) *strchars()* < Can also be used as a |method|: > GetText()->strchars() +< + Return type: |Number| + strdisplaywidth({string} [, {col}]) *strdisplaywidth()* The result is a Number, which is the number of display cells @@ -9528,6 +10527,9 @@ strdisplaywidth({string} [, {col}]) *strdisplaywidth()* Can also be used as a |method|: > GetText()->strdisplaywidth() +< + Return type: |Number| + strftime({format} [, {time}]) *strftime()* The result is a String, which is a formatted date and time, as @@ -9550,6 +10552,9 @@ strftime({format} [, {time}]) *strftime()* < Can also be used as a |method|: > GetFormat()->strftime() +< + Return type: |String| + strgetchar({str}, {index}) *strgetchar()* Get a Number corresponding to the character at {index} in @@ -9562,6 +10567,9 @@ strgetchar({str}, {index}) *strgetchar()* Can also be used as a |method|: > GetText()->strgetchar(5) +< + Return type: |Number| + stridx({haystack}, {needle} [, {start}]) *stridx()* The result is a Number, which gives the byte index in @@ -9585,8 +10593,11 @@ stridx({haystack}, {needle} [, {start}]) *stridx()* Can also be used as a |method|: > GetHaystack()->stridx(needle) < - *string()* -string({expr}) Return {expr} converted to a String. If {expr} is a Number, + Return type: |Number| + + +string({expr}) *string()* + Return {expr} converted to a String. If {expr} is a Number, Float, String, Blob or a composition of them, then the result can be parsed back with |eval()|. {expr} type result ~ @@ -9615,6 +10626,8 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number, < Also see |strtrans()|. + Return type: |String| + strlen({string}) *strlen()* The result is a Number, which is the length of the String @@ -9627,6 +10640,9 @@ strlen({string}) *strlen()* Can also be used as a |method|: > GetString()->strlen() +< + Return type: |Number| + strpart({src}, {start} [, {len} [, {chars}]]) *strpart()* The result is a String, which is part of {src}, starting from @@ -9655,6 +10671,9 @@ strpart({src}, {start} [, {len} [, {chars}]]) *strpart()* Can also be used as a |method|: > GetText()->strpart(5) +< + Return type: |String| + strptime({format}, {timestring}) *strptime()* The result is a Number, which is a unix timestamp representing @@ -9685,6 +10704,9 @@ strptime({format}, {timestring}) *strptime()* < Not available on all systems. To check use: > :if exists("*strptime") +< + Return type: |Number| + strridx({haystack}, {needle} [, {start}]) *strridx()* The result is a Number, which gives the byte index in @@ -9706,6 +10728,9 @@ strridx({haystack}, {needle} [, {start}]) *strridx()* Can also be used as a |method|: > GetHaystack()->strridx(needle) +< + Return type: |Number| + strtrans({string}) *strtrans()* The result is a String, which is {string} with all unprintable @@ -9719,6 +10744,9 @@ strtrans({string}) *strtrans()* Can also be used as a |method|: > GetString()->strtrans() +< + Return type: |String| + strutf16len({string} [, {countcc}]) *strutf16len()* The result is a Number, which is the number of UTF-16 code @@ -9742,6 +10770,9 @@ strutf16len({string} [, {countcc}]) *strutf16len()* Can also be used as a |method|: > GetText()->strutf16len() < + Return type: |Number| + + strwidth({string}) *strwidth()* The result is a Number, which is the number of display cells String {string} occupies. A Tab character is counted as one @@ -9753,6 +10784,9 @@ strwidth({string}) *strwidth()* Can also be used as a |method|: > GetString()->strwidth() +< + Return type: |Number| + submatch({nr} [, {list}]) *submatch()* *E935* Only for an expression in a |:substitute| command or @@ -9784,6 +10818,9 @@ submatch({nr} [, {list}]) *submatch()* *E935* Can also be used as a |method|: > GetNr()->submatch() +< + Return type: |String| or list<string> depending on {list} + substitute({string}, {pat}, {sub}, {flags}) *substitute()* The result is a String, which is a copy of {string}, in which @@ -9830,6 +10867,9 @@ substitute({string}, {pat}, {sub}, {flags}) *substitute()* Can also be used as a |method|: > GetString()->substitute(pat, sub, flags) +< + Return type: |String| + swapfilelist() *swapfilelist()* Returns a list of swap file names, like what "vim -r" shows. @@ -9841,6 +10881,9 @@ swapfilelist() *swapfilelist()* let &directory = '.' let swapfiles = swapfilelist() let &directory = save_dir +< + Return type: list<string> + swapinfo({fname}) *swapinfo()* The result is a dictionary, which holds information about the @@ -9863,6 +10906,9 @@ swapinfo({fname}) *swapinfo()* Can also be used as a |method|: > GetFilename()->swapinfo() +< + Return type: dict<any> or dict<string> + swapname({buf}) *swapname()* The result is the swap file path of the buffer {expr}. @@ -9873,6 +10919,9 @@ swapname({buf}) *swapname()* Can also be used as a |method|: > GetBufname()->swapname() +< + Return type: |String| + synID({lnum}, {col}, {trans}) *synID()* The result is a Number, which is the syntax ID at the position @@ -9899,6 +10948,8 @@ synID({lnum}, {col}, {trans}) *synID()* Example (echoes the name of the syntax item under the cursor): > :echo synIDattr(synID(line("."), col("."), 1), "name") < + Return type: |Number| + synIDattr({synID}, {what} [, {mode}]) *synIDattr()* The result is a String, which is the {what} attribute of @@ -9942,6 +10993,8 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()* < Can also be used as a |method|: > :echo synID(line("."), col("."), 1)->synIDtrans()->synIDattr("fg") +< + Return type: |String| synIDtrans({synID}) *synIDtrans()* @@ -9954,6 +11007,9 @@ synIDtrans({synID}) *synIDtrans()* Can also be used as a |method|: > :echo synID(line("."), col("."), 1)->synIDtrans()->synIDattr("fg") +< + Return type: |Number| + synconcealed({lnum}, {col}) *synconcealed()* The result is a |List| with currently three items: @@ -9983,6 +11039,8 @@ synconcealed({lnum}, {col}) *synconcealed()* Note: Doesn't consider |matchadd()| highlighting items, since syntax and matching highlighting are two different mechanisms |syntax-vs-match|. +< + Return type: list<any> synstack({lnum}, {col}) *synstack()* @@ -10004,6 +11062,9 @@ synstack({lnum}, {col}) *synstack()* character in a line and the first column in an empty line are valid positions. + Return type: list<number> or list<any> + + system({expr} [, {input}]) *system()* *E677* Get the output of the shell command {expr} as a |String|. See |systemlist()| to get the output as a |List|. @@ -10066,6 +11127,8 @@ system({expr} [, {input}]) *system()* *E677* Can also be used as a |method|: > :echo GetCmd()->system() +< + Return type: |String| systemlist({expr} [, {input}]) *systemlist()* @@ -10084,6 +11147,8 @@ systemlist({expr} [, {input}]) *systemlist()* Can also be used as a |method|: > :echo GetCmd()->systemlist() +< + Return type: list<string> tabpagebuflist([{arg}]) *tabpagebuflist()* @@ -10101,6 +11166,9 @@ tabpagebuflist([{arg}]) *tabpagebuflist()* Can also be used as a |method|: > GetTabpage()->tabpagebuflist() +< + Return type: list<number> + tabpagenr([{arg}]) *tabpagenr()* The result is a Number, which is the number of the current @@ -10116,6 +11184,8 @@ tabpagenr([{arg}]) *tabpagenr()* Returns zero on error. + Return type: |Number| + tabpagewinnr({tabarg} [, {arg}]) *tabpagewinnr()* Like |winnr()| but for tab page {tabarg}. @@ -10133,10 +11203,15 @@ tabpagewinnr({tabarg} [, {arg}]) *tabpagewinnr()* Can also be used as a |method|: > GetTabpage()->tabpagewinnr() < - *tagfiles()* -tagfiles() Returns a |List| with the file names used to search for tags + Return type: |Number| + + +tagfiles() *tagfiles()* + Returns a |List| with the file names used to search for tags for the current buffer. This is the 'tags' option expanded. + Return type: list<string> or list<any> + taglist({expr} [, {filename}]) *taglist()* Returns a |List| of tags matching the regular expression {expr}. @@ -10183,6 +11258,9 @@ taglist({expr} [, {filename}]) *taglist()* Can also be used as a |method|: > GetTagpattern()->taglist() +< + Return type: list<dict<any>> or list<any> + tan({expr}) *tan()* Return the tangent of {expr}, measured in radians, as a |Float| @@ -10197,6 +11275,8 @@ tan({expr}) *tan()* Can also be used as a |method|: > Compute()->tan() +< + Return type: |Float| tanh({expr}) *tanh()* @@ -10212,6 +11292,8 @@ tanh({expr}) *tanh()* Can also be used as a |method|: > Compute()->tanh() +< + Return type: |Float| tempname() *tempname()* *temp-file-name* @@ -10220,11 +11302,15 @@ tempname() *tempname()* *temp-file-name* is different for at least 26 consecutive calls. Example: > :let tmpfile = tempname() :exe "redir > " .. tmpfile -< For Unix, the file will be in a private directory |tempfile|. +< For Unix, the file will be in a private directory |tempfile| + that is recursively deleted when Vim exits, on other systems + temporary files are not cleaned up automatically on exit. For MS-Windows forward slashes are used when the 'shellslash' option is set, or when 'shellcmdflag' starts with '-' and 'shell' does not contain powershell or pwsh. + Return type: |String| + term_ functions are documented here: |terminal-function-details| @@ -10263,6 +11349,8 @@ terminalprops() *terminalprops()* - |v:termstyleresp| and |v:termblinkresp| for the response to |t_RS| and |t_RC|. + Return type: dict<string> + test_ functions are documented here: |test-functions-details| @@ -10287,8 +11375,11 @@ timer_info([{id}]) Can also be used as a |method|: > GetTimer()->timer_info() +< + Return type: list<dict<any>> or list<any> + + {only available when compiled with the |+timers| feature} -< {only available when compiled with the |+timers| feature} timer_pause({timer}, {paused}) *timer_pause()* Pause or unpause a timer. A paused timer does not invoke its @@ -10305,8 +11396,11 @@ timer_pause({timer}, {paused}) *timer_pause()* Can also be used as a |method|: > GetTimer()->timer_pause(1) +< + Return type: |Number| + + {only available when compiled with the |+timers| feature} -< {only available when compiled with the |+timers| feature} *timer_start()* *timer* *timers* timer_start({time}, {callback} [, {options}]) @@ -10349,8 +11443,12 @@ timer_start({time}, {callback} [, {options}]) GetMsec()->timer_start(callback) < Not available in the |sandbox|. + + Return type: |Number| + {only available when compiled with the |+timers| feature} + timer_stop({timer}) *timer_stop()* Stop a timer. The timer callback will no longer be invoked. {timer} is an ID returned by timer_start(), thus it must be a @@ -10358,16 +11456,22 @@ timer_stop({timer}) *timer_stop()* Can also be used as a |method|: > GetTimer()->timer_stop() +< + Return type: |Number| + + {only available when compiled with the |+timers| feature} -< {only available when compiled with the |+timers| feature} timer_stopall() *timer_stopall()* Stop all timers. The timer callbacks will no longer be invoked. Useful if a timer is misbehaving. If there are no timers there is no error. + Return type: |Number| + {only available when compiled with the |+timers| feature} + tolower({expr}) *tolower()* The result is a copy of the String given, with all uppercase characters turned into lowercase (just like applying |gu| to @@ -10375,6 +11479,9 @@ tolower({expr}) *tolower()* Can also be used as a |method|: > GetText()->tolower() +< + Return type: |String| + toupper({expr}) *toupper()* The result is a copy of the String given, with all lowercase @@ -10383,6 +11490,9 @@ toupper({expr}) *toupper()* Can also be used as a |method|: > GetText()->toupper() +< + Return type: |String| + tr({src}, {fromstr}, {tostr}) *tr()* The result is a copy of the {src} string with all characters @@ -10402,6 +11512,9 @@ tr({src}, {fromstr}, {tostr}) *tr()* Can also be used as a |method|: > GetText()->tr(from, to) +< + Return type: |String| + trim({text} [, {mask} [, {dir}]]) *trim()* Return {text} as a String where any character in {mask} is @@ -10433,6 +11546,9 @@ trim({text} [, {mask} [, {dir}]]) *trim()* Can also be used as a |method|: > GetText()->trim() +< + Return type: |String| + trunc({expr}) *trunc()* Return the largest integral value with magnitude less than or @@ -10450,6 +11566,9 @@ trunc({expr}) *trunc()* Can also be used as a |method|: > Compute()->trunc() < + Return type: |Float| + + *type()* type({expr}) The result is a Number representing the type of {expr}. Instead of using the number directly, it is better to use the @@ -10484,6 +11603,8 @@ type({expr}) The result is a Number representing the type of {expr}. < Can also be used as a |method|: > mylist->type() +< + Return type: |Number| typename({expr}) *typename()* @@ -10492,6 +11613,8 @@ typename({expr}) *typename()* echo typename([1, 2, 3]) < list<number> ~ + Return type: |String| + undofile({name}) *undofile()* Return the name of the undo file that would be used for a file @@ -10508,6 +11631,9 @@ undofile({name}) *undofile()* Can also be used as a |method|: > GetFilename()->undofile() +< + Return type: |String| + undotree([{buf}]) *undotree()* Return the current state of the undo tree for the current @@ -10553,6 +11679,9 @@ undotree([{buf}]) *undotree()* blocks. Each item may again have an "alt" item. + Return type: dict<any> + + uniq({list} [, {func} [, {dict}]]) *uniq()* *E882* Remove second and succeeding copies of repeated adjacent {list} items in-place. Returns {list}. If you want a list @@ -10566,6 +11695,9 @@ uniq({list} [, {func} [, {dict}]]) *uniq()* *E882* Can also be used as a |method|: > mylist->uniq() < + Return type: list<{type}> + + *utf16idx()* utf16idx({string}, {idx} [, {countcc} [, {charidx}]]) Same as |charidx()| but returns the UTF-16 code unit index of @@ -10596,6 +11728,8 @@ utf16idx({string}, {idx} [, {countcc} [, {charidx}]]) < Can also be used as a |method|: > GetName()->utf16idx(idx) +< + Return type: |Number| values({dict}) *values()* @@ -10605,6 +11739,9 @@ values({dict}) *values()* Can also be used as a |method|: > mydict->values() +< + Return type: list<any> + virtcol({expr} [, {list} [, {winid}]]) *virtcol()* The result is a Number, which is the screen column of the file @@ -10616,7 +11753,9 @@ virtcol({expr} [, {list} [, {winid}]]) *virtcol()* set to 8, it returns 8. |conceal| is ignored. For the byte position use |col()|. - For the use of {expr} see |col()|. + For the use of {expr} see |getpos()| and |col()|. + When {expr} is "$", it means the end of the cursor line, so + the result is the number of cells in the cursor line plus one. When 'virtualedit' is used {expr} can be [lnum, col, off], where "off" is the offset in screen columns from the start of @@ -10626,18 +11765,6 @@ virtcol({expr} [, {list} [, {winid}]]) *virtcol()* beyond the end of the line can be returned. Also see |'virtualedit'| - The accepted positions are: - . the cursor position - $ the end of the cursor line (the result is the - number of displayed characters in the cursor line - plus one) - 'x position of mark x (if the mark is not set, 0 is - returned) - v In Visual mode: the start of the Visual area (the - cursor is the end). When not in Visual mode - returns the cursor position. Differs from |'<| in - that it's updated right away. - If {list} is present and non-zero then virtcol() returns a List with the first and last screen position occupied by the character. @@ -10646,6 +11773,7 @@ virtcol({expr} [, {list} [, {winid}]]) *virtcol()* that window instead of the current window. Note that only marks in the current file can be used. + Examples: > " With text "foo^Lbar" and cursor on the "^L": @@ -10656,13 +11784,18 @@ virtcol({expr} [, {list} [, {winid}]]) *virtcol()* " With text " there", with 't at 'h': virtcol("'t") " returns 6 -< The first column is 1. 0 or [0, 0] is returned for an error. +< + The first column is 1. 0 or [0, 0] is returned for an error. + A more advanced example that echoes the maximum length of all lines: > echo max(map(range(1, line('$')), "virtcol([v:val, '$'])")) < Can also be used as a |method|: > GetPos()->virtcol() +< + Return type: |Number| + virtcol2col({winid}, {lnum}, {col}) *virtcol2col()* The result is a Number, which is the byte index of the @@ -10688,6 +11821,9 @@ virtcol2col({winid}, {lnum}, {col}) *virtcol2col()* Can also be used as a |method|: > GetWinid()->virtcol2col(lnum, col) +< + Return type: |Number| + visualmode([{expr}]) *visualmode()* The result is a String, which describes the last Visual mode @@ -10707,6 +11843,9 @@ visualmode([{expr}]) *visualmode()* a non-empty String, then the Visual mode will be cleared and the old value is returned. See |non-zero-arg|. + Return type: |String| + + wildmenumode() *wildmenumode()* Returns |TRUE| when the wildmenu is active and |FALSE| otherwise. See 'wildmenu' and 'wildmode'. @@ -10718,6 +11857,9 @@ wildmenumode() *wildmenumode()* < (Note, this needs the 'wildcharm' option set appropriately). + Return type: |Number| + + win_execute({id}, {command} [, {silent}]) *win_execute()* Like `execute()` but in the context of window {id}. The window will temporarily be made the current window, @@ -10736,6 +11878,9 @@ win_execute({id}, {command} [, {silent}]) *win_execute()* Can also be used as a |method|, the base is passed as the second argument: > GetCommand()->win_execute(winid) +< + Return type: |String| + win_findbuf({bufnr}) *win_findbuf()* Returns a |List| with |window-ID|s for windows that contain @@ -10743,6 +11888,9 @@ win_findbuf({bufnr}) *win_findbuf()* Can also be used as a |method|: > GetBufnr()->win_findbuf() +< + Return type: list<number> or list<any> + win_getid([{win} [, {tab}]]) *win_getid()* Get the |window-ID| for the specified window. @@ -10755,6 +11903,8 @@ win_getid([{win} [, {tab}]]) *win_getid()* Can also be used as a |method|: > GetWinnr()->win_getid() +< + Return type: |Number| win_gettype([{nr}]) *win_gettype()* @@ -10780,6 +11930,9 @@ win_gettype([{nr}]) *win_gettype()* Can also be used as a |method|: > GetWinid()->win_gettype() < + Return type: |String| + + win_gotoid({expr}) *win_gotoid()* Go to window with ID {expr}. This may also change the current tabpage. @@ -10787,6 +11940,9 @@ win_gotoid({expr}) *win_gotoid()* Can also be used as a |method|: > GetWinid()->win_gotoid() +< + Return type: |Number| + win_id2tabwin({expr}) *win_id2tabwin()* Return a list with the tab number and window number of window @@ -10795,6 +11951,9 @@ win_id2tabwin({expr}) *win_id2tabwin()* Can also be used as a |method|: > GetWinid()->win_id2tabwin() +< + Return type: list<number> + win_id2win({expr}) *win_id2win()* Return the window number of window with ID {expr}. @@ -10802,6 +11961,9 @@ win_id2win({expr}) *win_id2win()* Can also be used as a |method|: > GetWinid()->win_id2win() +< + Return type: |Number| + win_move_separator({nr}, {offset}) *win_move_separator()* Move window {nr}'s vertical separator (i.e., the right border) @@ -10820,6 +11982,9 @@ win_move_separator({nr}, {offset}) *win_move_separator()* Can also be used as a |method|: > GetWinnr()->win_move_separator(offset) +< + Return type: |Number| + win_move_statusline({nr}, {offset}) *win_move_statusline()* Move window {nr}'s status line (i.e., the bottom border) by @@ -10835,6 +12000,9 @@ win_move_statusline({nr}, {offset}) *win_move_statusline()* Can also be used as a |method|: > GetWinnr()->win_move_statusline(offset) +< + Return type: |Number| + win_screenpos({nr}) *win_screenpos()* Return the screen position of window {nr} as a list with two @@ -10847,6 +12015,9 @@ win_screenpos({nr}) *win_screenpos()* Can also be used as a |method|: > GetWinid()->win_screenpos() < + Return type: list<number> + + win_splitmove({nr}, {target} [, {options}]) *win_splitmove()* Temporarily switch to window {target}, then move window {nr} to a new split adjacent to {target}. @@ -10870,6 +12041,8 @@ win_splitmove({nr}, {target} [, {options}]) *win_splitmove()* Can also be used as a |method|: > GetWinid()->win_splitmove(target) < + Return type: |Number| + *winbufnr()* winbufnr({nr}) The result is a Number, which is the number of the buffer @@ -10884,11 +12057,17 @@ winbufnr({nr}) The result is a Number, which is the number of the buffer Can also be used as a |method|: > FindWindow()->winbufnr()->bufname() < + Return type: |Number| + + *wincol()* wincol() The result is a Number, which is the virtual column of the cursor in the window. This is counting screen cells from the left side of the window. The leftmost column is one. + Return type: |Number| + + *windowsversion()* windowsversion() The result is a String. For MS-Windows it indicates the OS @@ -10896,6 +12075,8 @@ windowsversion() Windows XP is "5.1". For non-MS-Windows systems the result is an empty string. + Return type: |String| + winheight({nr}) *winheight()* The result is a Number, which is the height of window {nr}. {nr} can be the window number or the |window-ID|. @@ -10909,6 +12090,9 @@ winheight({nr}) *winheight()* < Can also be used as a |method|: > GetWinid()->winheight() < + Return type: |Number| + + winlayout([{tabnr}]) *winlayout()* The result is a nested List containing the layout of windows in a tabpage. @@ -10942,15 +12126,21 @@ winlayout([{tabnr}]) *winlayout()* Can also be used as a |method|: > GetTabnr()->winlayout() < - *winline()* -winline() The result is a Number, which is the screen line of the cursor + Return type: list<any> + + +winline() *winline()* + The result is a Number, which is the screen line of the cursor in the window. This is counting screen lines from the top of the window. The first line is one. If the cursor was moved the view on the file will be updated first, this may cause a scroll. - *winnr()* -winnr([{arg}]) The result is a Number, which is the number of the current + Return type: |Number| + + +winnr([{arg}]) *winnr()* + The result is a Number, which is the number of the current window. The top window has number 1. Returns zero for a popup window. @@ -10983,8 +12173,11 @@ winnr([{arg}]) The result is a Number, which is the number of the current < Can also be used as a |method|: > GetWinval()->winnr() < - *winrestcmd()* -winrestcmd() Returns a sequence of |:resize| commands that should restore + Return type: |Number| + + +winrestcmd() *winrestcmd()* + Returns a sequence of |:resize| commands that should restore the current window sizes. Only works properly when no windows are opened or closed and the current window and tab page is unchanged. @@ -10993,8 +12186,10 @@ winrestcmd() Returns a sequence of |:resize| commands that should restore :call MessWithWindowSizes() :exe cmd < - *winrestview()* -winrestview({dict}) + Return type: |String| + + +winrestview({dict}) *winrestview()* Uses the |Dictionary| returned by |winsaveview()| to restore the view of the current window. Note: The {dict} does not have to contain all values, that are @@ -11013,8 +12208,11 @@ winrestview({dict}) Can also be used as a |method|: > GetView()->winrestview() < - *winsaveview()* -winsaveview() Returns a |Dictionary| that contains information to restore + Return type: |Number| + + +winsaveview() *winsaveview()* + Returns a |Dictionary| that contains information to restore the view of the current window. Use |winrestview()| to restore the view. This is useful if you have a mapping that jumps around in the @@ -11040,6 +12238,8 @@ winsaveview() Returns a |Dictionary| that contains information to restore skipcol columns skipped Note that no option values are saved. + Return type: dict<number> + winwidth({nr}) *winwidth()* The result is a Number, which is the width of window {nr}. @@ -11057,6 +12257,8 @@ winwidth({nr}) *winwidth()* Can also be used as a |method|: > GetWinid()->winwidth() +< + Return type: |Number| wordcount() *wordcount()* @@ -11080,9 +12282,10 @@ wordcount() *wordcount()* visual_words Number of words visually selected (only in Visual mode) + Return type: dict<number> - *writefile()* -writefile({object}, {fname} [, {flags}]) + +writefile({object}, {fname} [, {flags}]) *writefile()* When {object} is a |List| write it to file {fname}. Each list item is separated with a NL. Each list item must be a String or Number. @@ -11130,6 +12333,8 @@ writefile({object}, {fname} [, {flags}]) < Can also be used as a |method|: > GetText()->writefile("thefile") +< + Return type: |Number| xor({expr}, {expr}) *xor()* @@ -11142,6 +12347,7 @@ xor({expr}, {expr}) *xor()* Can also be used as a |method|: > :let bits = bits->xor(0x80) < + Return type: |Number| ============================================================================== 3. Feature list *feature-list* |