// NOTE: This file is generated. Do NOT modify it manually. // deno-lint-ignore-file camelcase import type { Denops } from "https://deno.land/x/denops_core@v4.0.0/mod.ts"; /** * Return the absolute value of **{expr}**. When **{expr}** evaluates to * a `Float` abs() returns a `Float`. When **{expr}** can be * converted to a `Number` abs() returns a `Number`. Otherwise * abs() gives an error message and returns -1. * Examples: * * echo abs(1.456) * * 1.456 * * echo abs(-5.456) * * 5.456 * * echo abs(-4) * * 4 * * Can also be used as a `method`: * * Compute()->abs() * * *only available when compiled with the `+float` feature* */ export function abs(denops: Denops, expr: unknown): Promise; export function abs(denops: Denops, ...args: unknown[]): Promise { return denops.call("abs", ...args); } /** * Return the arc cosine of **{expr}** measured in radians, as a * `Float` in the range of [0, pi]. * **{expr}** must evaluate to a `Float` or a `Number` in the range * [-1, 1]. Otherwise acos() returns "nan". * Examples: * * :echo acos(0) * * 1.570796 * * :echo acos(-0.5) * * 2.094395 * * Can also be used as a `method`: * * Compute()->acos() * * *only available when compiled with the `+float` feature* */ export function acos(denops: Denops, expr: unknown): Promise; export function acos(denops: Denops, ...args: unknown[]): Promise { return denops.call("acos", ...args); } /** * Append the item **{expr}** to `List` or `Blob` **{object}**. Returns * the resulting `List` or `Blob`. Examples: * * :let alist = add([1, 2, 3], item) * :call add(mylist, "woodstock") * * Note that when **{expr}** is a `List` it is appended as a single * item. Use `extend()` to concatenate `Lists`. * When **{object}** is a `Blob` then **{expr}** must be a number. * Use `insert()` to add an item at another position. * Returns 1 if **{object}** is not a `List` or a `Blob`. * * Can also be used as a `method`: * * mylist->add(val1)->add(val2) */ export function add( denops: Denops, object: unknown, expr: unknown, ): Promise; export function add(denops: Denops, ...args: unknown[]): Promise { return denops.call("add", ...args); } /** * Bitwise AND on the two arguments. The arguments are converted * to a number. A List, Dict or Float argument causes an error. * Also see `or()` and `xor()`. * Example: * * :let flag = and(bits, 0x80) * * Can also be used as a `method`: * * :let flag = bits->and(0x80) */ export function and( denops: Denops, expr1: unknown, expr2: unknown, ): Promise; export function and(denops: Denops, ...args: unknown[]): Promise { return denops.call("and", ...args); } /** * When **{text}** is a `List`: Append each item of the `List` as a * text line below line **{lnum}** in the current buffer. * Otherwise append **{text}** as one text line below line **{lnum}** in * the current buffer. * Any type of item is accepted and converted to a String. * **{lnum}** can be zero to insert a line before the first one. * **{lnum}** is used like with `getline()`. * Returns 1 for failure (**{lnum}** out of range or out of memory), * 0 for success. In `Vim9` script an invalid argument or * negative number results in an error. Example: * * :let failed = append(line('$'), "# THE END") * :let failed = append(0, ["Chapter 1", "the beginning"]) * * Can also be used as a `method` after a List, the base is * passed as the second argument: * * mylist->append(lnum) */ export function append( denops: Denops, lnum: unknown, text: unknown, ): Promise; export function append(denops: Denops, ...args: unknown[]): Promise { return denops.call("append", ...args); } /** * Like `append()` but append the text in buffer **{buf}**. * * This function works only for loaded buffers. First call * `bufload()` if needed. * * For the use of **{buf}**, see `bufname()`. * * **{lnum}** is the line number to append below. Note that using * `line()` would use the current buffer, not the one appending * to. Use "$" to append at the end of the buffer. Other string * values are not supported. * * On success 0 is returned, on failure 1 is returned. * In `Vim9` script an error is given for an invalid **{lnum}**. * * If **{buf}** is not a valid buffer or **{lnum}** is not valid, an * error message is given. Example: * * :let failed = appendbufline(13, 0, "# THE START") * * Can also be used as a `method` after a List, the base is * passed as the second argument: * * mylist->appendbufline(buf, lnum) */ export function appendbufline( denops: Denops, buf: unknown, lnum: unknown, text: unknown, ): Promise; export function appendbufline( denops: Denops, ...args: unknown[] ): Promise { return denops.call("appendbufline", ...args); } /** * The result is the number of files in the argument list. See * `arglist`. * If **{winid}** is not supplied, the argument list of the current * window is used. * If **{winid}** is -1, the global argument list is used. * Otherwise **{winid}** specifies the window of which the argument * list is used: either the window number or the window ID. * Returns -1 if the **{winid}** argument is invalid. */ export function argc(denops: Denops, winid?: unknown): Promise; export function argc(denops: Denops, ...args: unknown[]): Promise { return denops.call("argc", ...args); } /** * The result is the current index in the argument list. 0 is * the first file. argc() - 1 is the last one. See `arglist`. */ export function argidx(denops: Denops): Promise; export function argidx(denops: Denops, ...args: unknown[]): Promise { return denops.call("argidx", ...args); } /** * Return the argument list ID. This is a number which * identifies the argument list being used. Zero is used for the * global argument list. See `arglist`. * Returns -1 if the arguments are invalid. * * Without arguments use the current window. * With **{winnr}** only use this window in the current tab page. * With **{winnr}** and **{tabnr}** use the window in the specified tab * page. * **{winnr}** can be the window number or the `window-ID`. */ export function arglistid( denops: Denops, winnr?: unknown, tabnr?: unknown, ): Promise; export function arglistid( denops: Denops, ...args: unknown[] ): Promise { return denops.call("arglistid", ...args); } /** * The result is the **{nr}**th file in the argument list. See * `arglist`. "argv(0)" is the first one. Example: * * :let i = 0 * :while i < argc() * : let f = escape(fnameescape(argv(i)), '.') * : exe 'amenu Arg.' .. f .. ' :e ' .. f .. '' * : let i = i + 1 * :endwhile * * Without the **{nr}** argument, or when **{nr}** is -1, a `List` with * the whole `arglist` is returned. * * The **{winid}** argument specifies the window ID, see `argc()`. * For the Vim command line arguments see `v:argv`. * * Returns an empty string if **{nr}**th argument is not present in * the argument list. Returns an empty List if the **{winid}** * argument is invalid. */ export function argv( denops: Denops, nr?: unknown, winid?: unknown, ): Promise; export function argv(denops: Denops, ...args: unknown[]): Promise { return denops.call("argv", ...args); } /** * Return the arc sine of **{expr}** measured in radians, as a `Float` * in the range of [-pi/2, pi/2]. * **{expr}** must evaluate to a `Float` or a `Number` in the range * [-1, 1]. * Returns "nan" if **{expr}** is outside the range [-1, 1]. Returns * 0.0 if **{expr}** is not a `Float` or a `Number`. * Examples: * * :echo asin(0.8) * * 0.927295 * * :echo asin(-0.5) * * -0.523599 * * Can also be used as a `method`: * * Compute()->asin() * * *only available when compiled with the `+float` feature* */ export function asin(denops: Denops, expr: unknown): Promise; export function asin(denops: Denops, ...args: unknown[]): Promise { return denops.call("asin", ...args); } /** * Return the principal value of the arc tangent of **{expr}**, in * the range [-pi/2, +pi/2] radians, as a `Float`. * **{expr}** must evaluate to a `Float` or a `Number`. * Returns 0.0 if **{expr}** is not a `Float` or a `Number`. * Examples: * * :echo atan(100) * * 1.560797 * * :echo atan(-4.01) * * -1.326405 * * Can also be used as a `method`: * * Compute()->atan() * * *only available when compiled with the `+float` feature* */ export function atan(denops: Denops, expr: unknown): Promise; export function atan(denops: Denops, ...args: unknown[]): Promise { return denops.call("atan", ...args); } /** * Return the arc tangent of **{expr1}** / **{expr2}**, measured in * radians, as a `Float` in the range [-pi, pi]. * **{expr1}** and **{expr2}** must evaluate to a `Float` or a `Number`. * Returns 0.0 if **{expr1}** or **{expr2}** is not a `Float` or a * `Number`. * Examples: * * :echo atan2(-1, 1) * * -0.785398 * * :echo atan2(1, -1) * * 2.356194 * * Can also be used as a `method`: * * Compute()->atan2(1) * * *only available when compiled with the `+float` feature* */ export function atan2( denops: Denops, expr1: unknown, expr2: unknown, ): Promise; export function atan2(denops: Denops, ...args: unknown[]): Promise { return denops.call("atan2", ...args); } /** * Put up a file requester. This only works when "has("browse")" * returns `TRUE` (only in some GUI versions). * The input fields are: * **{save}** when `TRUE`, select file to write * **{title}** title for the requester * **{initdir}** directory to start browsing in * **{default}** default file name * An empty string is returned when the "Cancel" button is hit, * something went wrong, or browsing is not possible. */ export function browse( denops: Denops, save: unknown, title: unknown, initdir: unknown, defaultValue: unknown, ): Promise; export function browse(denops: Denops, ...args: unknown[]): Promise { return denops.call("browse", ...args); } /** * 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 * browser is used. In that case: select a file in the directory * to be used. * The input fields are: * **{title}** title for the requester * **{initdir}** directory to start browsing in * When the "Cancel" button is hit, something went wrong, or * browsing is not possible, an empty string is returned. */ export function browsedir( denops: Denops, title: unknown, initdir: unknown, ): Promise; export function browsedir( denops: Denops, ...args: unknown[] ): Promise { return denops.call("browsedir", ...args); } /** * Return byte index of the **{nr}**'th character in the String * **{expr}**. Use zero for the first character, it then returns * zero. * If there are no multibyte characters the returned value is * equal to **{nr}**. * Composing characters are not counted separately, their byte * length is added to the preceding base character. See * `byteidxcomp()` below for counting composing characters * separately. * Example : * * echo matchstr(str, ".", byteidx(str, 3)) * * will display the fourth character. Another way to do the * same: * * let s = strpart(str, byteidx(str, 3)) * echo strpart(s, 0, byteidx(s, 1)) * * Also see `strgetchar()` and `strcharpart()`. * * If there are less than **{nr}** characters -1 is returned. * If there are exactly **{nr}** characters the length of the string * in bytes is returned. * * Can also be used as a `method`: * * GetName()->byteidx(idx) */ export function byteidx( denops: Denops, expr: unknown, nr: unknown, ): Promise; export function byteidx(denops: Denops, ...args: unknown[]): Promise { return denops.call("byteidx", ...args); } /** * Like byteidx(), except that a composing character is counted * as a separate character. Example: * * let s = 'e' .. nr2char(0x301) * echo byteidx(s, 1) * echo byteidxcomp(s, 1) * echo byteidxcomp(s, 2) * * The first and third echo result in 3 ('e' plus composing * character is 3 bytes), the second echo results in 1 ('e' is * one byte). * Only works differently from byteidx() when 'encoding' is set * to a Unicode encoding. * * Can also be used as a `method`: * * GetName()->byteidxcomp(idx) */ export function byteidxcomp( denops: Denops, expr: unknown, nr: unknown, ): Promise; export function byteidxcomp( denops: Denops, ...args: unknown[] ): Promise { return denops.call("byteidxcomp", ...args); } /** * Call function **{func}** with the items in `List` **{arglist}** as * arguments. * **{func}** can either be a `Funcref` or the name of a function. * a:firstline and a:lastline are set to the cursor line. * Returns the return value of the called function. * **{dict}** is for functions with the "dict" attribute. It will be * used to set the local variable "self". `Dictionary-function` * * Can also be used as a `method`: * * GetFunc()->call([arg, arg], dict) */ export function call( denops: Denops, func: unknown, arglist: unknown, dict?: unknown, ): Promise; export function call(denops: Denops, ...args: unknown[]): Promise { return denops.call("call", ...args); } /** * Return the smallest integral value greater than or equal to * **{expr}** as a `Float` (round up). * **{expr}** must evaluate to a `Float` or a `Number`. * Examples: * * echo ceil(1.456) * * 2.0 * * echo ceil(-5.456) * * -5.0 * * echo ceil(4.0) * * 4.0 * * Returns 0.0 if **{expr}** is not a `Float` or a `Number`. * * Can also be used as a `method`: * * Compute()->ceil() * * *only available when compiled with the `+float` feature* */ export function ceil(denops: Denops, expr: unknown): Promise; export function ceil(denops: Denops, ...args: unknown[]): Promise { return denops.call("ceil", ...args); } /** * Return the number of the most recent change. This is the same * number as what is displayed with `:undolist` and can be used * with the `:undo` command. * When a change was made it is the number of that change. After * redo it is the number of the redone change. After undo it is * one less than the number of the undone change. * Returns 0 if the undo list is empty. */ export function changenr(denops: Denops): Promise; export function changenr(denops: Denops, ...args: unknown[]): Promise { return denops.call("changenr", ...args); } /** * Return Number value of the first char in **{string}**. * Examples: * * char2nr(" ") returns 32 * char2nr("ABC") returns 65 * * When **{utf8}** is omitted or zero, the current 'encoding' is used. * Example for "utf-8": * * char2nr("á") returns 225 * char2nr("á"[0]) returns 195 * * When **{utf8}** is TRUE, always treat as UTF-8 characters. * A combining character is a separate character. * `nr2char()` does the opposite. * To turn a string into a list of character numbers: * * let str = "ABC" * let list = map(split(str, '\zs'), {_, val -> char2nr(val)}) * * Result: [65, 66, 67] * * Returns 0 if **{string}** is not a `String`. * * Can also be used as a `method`: * * GetChar()->char2nr() */ export function char2nr( denops: Denops, string: unknown, utf8?: unknown, ): Promise; export function char2nr(denops: Denops, ...args: unknown[]): Promise { return denops.call("char2nr", ...args); } /** * Return the character class of the first character in **{string}**. * The character class is one of: * 0 blank * 1 punctuation * 2 word character * 3 emoji * other specific Unicode class * The class is used in patterns and word motions. * Returns 0 if **{string}** is not a `String`. */ export function charclass(denops: Denops, string: unknown): Promise; export function charclass( denops: Denops, ...args: unknown[] ): Promise { return denops.call("charclass", ...args); } /** * Same as `col()` but returns the character index of the column * position given with **{expr}** instead of the byte position. * * Example: * With the cursor on '세' in line 5 with text "여보세요": * * charcol('.') returns 3 * col('.') returns 7 * * Can also be used as a `method`: * * GetPos()->col() */ export function charcol(denops: Denops, expr: unknown): Promise; export function charcol(denops: Denops, ...args: unknown[]): Promise { return denops.call("charcol", ...args); } /** * Return the character index of the byte at **{idx}** in **{string}**. * The index of the first character is zero. * If there are no multibyte characters the returned value is * equal to **{idx}**. * When **{countcc}** is omitted or `FALSE`, then composing characters * are not counted separately, their byte length is * added to the preceding base character. * When **{countcc}** is `TRUE`, then composing characters are * counted as separate characters. * Returns -1 if the arguments are invalid or if **{idx}** is greater * than the index of the last byte in **{string}**. An error is * given if the first argument is not a string, the second * argument is not a number or when the third argument is present * and is not zero or one. * See `byteidx()` and `byteidxcomp()` for getting the byte index * from the character index. * Examples: * * echo charidx('áb́ć', 3) returns 1 * echo charidx('áb́ć', 6, 1) returns 4 * echo charidx('áb́ć', 16) returns -1 * * Can also be used as a `method`: * * GetName()->charidx(idx) */ export function charidx( denops: Denops, string: unknown, idx: unknown, countcc?: unknown, ): Promise; export function charidx(denops: Denops, ...args: unknown[]): Promise { return denops.call("charidx", ...args); } /** * Change the current working directory to **{dir}**. The scope of * the directory change depends on the directory of the current * window: * - If the current window has a window-local directory * (`:lcd`), then changes the window local directory. * - Otherwise, if the current tabpage has a local * directory (`:tcd`) then changes the tabpage local * directory. * - Otherwise, changes the global directory. * **{dir}** must be a String. * If successful, returns the previous working directory. Pass * this to another chdir() to restore the directory. * On failure, returns an empty string. * * Example: * * let save_dir = chdir(newdir) * if save_dir != "" * " ... do some work * call chdir(save_dir) * endif * * Can also be used as a `method`: * * GetDir()->chdir() */ export function chdir(denops: Denops, dir: unknown): Promise; export function chdir(denops: Denops, ...args: unknown[]): Promise { return denops.call("chdir", ...args); } /** * Get the amount of indent for line **{lnum}** according the C * indenting rules, as with 'cindent'. * The indent is counted in spaces, the value of 'tabstop' is * relevant. **{lnum}** is used just like in `getline()`. * When **{lnum}** is invalid -1 is returned. * See `C-indenting`. * * Can also be used as a `method`: * * GetLnum()->cindent() */ export function cindent(denops: Denops, lnum: unknown): Promise; export function cindent(denops: Denops, ...args: unknown[]): Promise { return denops.call("cindent", ...args); } /** * Clears all matches previously defined for the current window * by `matchadd()` and the `:match` commands. * If **{win}** is specified, use the window with this number or * window ID instead of the current window. * * Can also be used as a `method`: * * GetWin()->clearmatches() */ export function clearmatches(denops: Denops, win?: unknown): Promise; export function clearmatches( denops: Denops, ...args: unknown[] ): Promise { return denops.call("clearmatches", ...args); } /** * Set the matches for Insert mode completion. * Can only be used in Insert mode. You need to use a mapping * with CTRL-R = (see `i_CTRL-R`). It does not work after CTRL-O * or with an expression mapping. * **{startcol}** is the byte offset in the line where the completed * text start. The text up to the cursor is the original text * that will be replaced by the matches. Use col('.') for an * empty string. "col('.') - 1" will replace one character by a * match. * **{matches}** must be a `List`. Each `List` item is one match. * See `complete-items` for the kind of items that are possible. * "longest" in 'completeopt' is ignored. * Note that the after calling this function you need to avoid * inserting anything that would cause completion to stop. * The match can be selected with CTRL-N and CTRL-P as usual with * Insert mode completion. The popup menu will appear if * specified, see `ins-completion-menu`. * Example: * * inoremap =ListMonths() * * func! ListMonths() * call complete(col('.'), ['January', 'February', 'March', * \ 'April', 'May', 'June', 'July', 'August', 'September', * \ 'October', 'November', 'December']) * return '' * endfunc * * This isn't very useful, but it shows how it works. Note that * an empty string is returned to avoid a zero being inserted. * * Can also be used as a `method`, the base is passed as the * second argument: * * GetMatches()->complete(col('.')) */ export function complete( denops: Denops, startcol: unknown, matches: unknown, ): Promise; export function complete(denops: Denops, ...args: unknown[]): Promise { return denops.call("complete", ...args); } /** * Add **{expr}** to the list of matches. Only to be used by the * function specified with the 'completefunc' option. * Returns 0 for failure (empty string or out of memory), * 1 when the match was added, 2 when the match was already in * the list. * See `complete-functions` for an explanation of **{expr}**. It is * the same as one item in the list that 'omnifunc' would return. * * Can also be used as a `method`: * * GetMoreMatches()->complete_add() */ export function complete_add(denops: Denops, expr: unknown): Promise; export function complete_add( denops: Denops, ...args: unknown[] ): Promise { return denops.call("complete_add", ...args); } /** * Check for a key typed while looking for completion matches. * This is to be used when looking for matches takes some time. * Returns `TRUE` when searching for matches is to be aborted, * zero otherwise. * Only to be used by the function specified with the * 'completefunc' option. */ export function complete_check(denops: Denops): Promise; export function complete_check( denops: Denops, ...args: unknown[] ): Promise { return denops.call("complete_check", ...args); } /** * Returns a `Dictionary` with information about Insert mode * completion. See `ins-completion`. * The items are: * mode Current completion mode name string. * See `complete_info_mode` for the values. * pum_visible `TRUE` if popup menu is visible. * See `pumvisible()`. * items List of completion matches. Each item is a * dictionary containing the entries "word", * "abbr", "menu", "kind", "info" and "user_data". * See `complete-items`. * selected Selected item index. First index is zero. * Index is -1 if no item is selected (showing * typed text only, or the last completion after * no item is selected when using the `` or * `` keys) * inserted Inserted string. [NOT IMPLEMENTED YET] * * mode values are: * "" Not in completion mode * "keyword" Keyword completion `i_CTRL-X_CTRL-N` * "ctrl_x" Just pressed CTRL-X `i_CTRL-X` * "scroll" Scrolling with `i_CTRL-X_CTRL-E` or * `i_CTRL-X_CTRL-Y` * "whole_line" Whole lines `i_CTRL-X_CTRL-L` * "files" File names `i_CTRL-X_CTRL-F` * "tags" Tags `i_CTRL-X_CTRL-]` * "path_defines" Definition completion `i_CTRL-X_CTRL-D` * "path_patterns" Include completion `i_CTRL-X_CTRL-I` * "dictionary" Dictionary `i_CTRL-X_CTRL-K` * "thesaurus" Thesaurus `i_CTRL-X_CTRL-T` * "cmdline" Vim Command line `i_CTRL-X_CTRL-V` * "function" User defined completion `i_CTRL-X_CTRL-U` * "omni" Omni completion `i_CTRL-X_CTRL-O` * "spell" Spelling suggestions `i_CTRL-X_s` * "eval" `complete()` completion * "unknown" Other internal modes * * If the optional **{what}** list argument is supplied, then only * the items listed in **{what}** are returned. Unsupported items in * **{what}** are silently ignored. * * To get the position and size of the popup menu, see * `pum_getpos()`. It's also available in `v:event` during the * `CompleteChanged` event. * * Returns an empty `Dictionary` on error. * * Examples: * * " Get all items * call complete_info() * " Get only 'mode' * call complete_info(['mode']) * " Get only 'mode' and 'pum_visible' * call complete_info(['mode', 'pum_visible']) * * Can also be used as a `method`: * * GetItems()->complete_info() */ export function complete_info(denops: Denops, what?: unknown): Promise; export function complete_info( denops: Denops, ...args: unknown[] ): Promise { return denops.call("complete_info", ...args); } /** * confirm() offers the user a dialog, from which a choice can be * made. It returns the number of the choice. For the first * choice this is 1. * Note: confirm() is only supported when compiled with dialog * support, see `+dialog_con` and `+dialog_gui`. * * **{msg}** is displayed in a `dialog` with **{choices}** as the * alternatives. When **{choices}** is missing or empty, "&OK" is * used (and translated). * **{msg}** is a String, use '\n' to include a newline. Only on * some systems the string is wrapped when it doesn't fit. * * **{choices}** is a String, with the individual choices separated * by '\n', e.g. * * confirm("Save changes?", "&Yes\n&No\n&Cancel") * * The letter after the '&' is the shortcut key for that choice. * Thus you can type 'c' to select "Cancel". The shortcut does * not need to be the first letter: * * confirm("file has been modified", "&Save\nSave &All") * * For the console, the first letter of each choice is used as * the default shortcut key. Case is ignored. * * The optional **{default}** argument is the number of the choice * that is made if the user hits ``. Use 1 to make the first * choice the default one. Use 0 to not set a default. If * **{default}** is omitted, 1 is used. * * The optional **{type}** String argument gives the type of dialog. * This is only used for the icon of the GTK, Mac, Motif and * Win32 GUI. It can be one of these values: "Error", * "Question", "Info", "Warning" or "Generic". Only the first * character is relevant. When **{type}** is omitted, "Generic" is * used. * * If the user aborts the dialog by pressing ``, CTRL-C, * or another valid interrupt key, confirm() returns 0. * * An example: * * let choice = confirm("What do you want?", * \ "&Apples\n&Oranges\n&Bananas", 2) * if choice == 0 * echo "make up your mind!" * elseif choice == 3 * echo "tasteful" * else * echo "I prefer bananas myself." * endif * * In a GUI dialog, buttons are used. The layout of the buttons * depends on the 'v' flag in 'guioptions'. If it is included, * the buttons are always put vertically. Otherwise, confirm() * tries to put the buttons in one horizontal line. If they * don't fit, a vertical layout is used anyway. For some systems * the horizontal layout is always used. * * Can also be used as a `method`in: * * BuildMessage()->confirm("&Yes\n&No") */ export function confirm( denops: Denops, msg: unknown, choices?: unknown, defaultValue?: unknown, type?: unknown, ): Promise; export function confirm(denops: Denops, ...args: unknown[]): Promise { return denops.call("confirm", ...args); } /** * 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 * copy, and vice versa. But the items are identical, thus * changing an item changes the contents of both `Lists`. * A `Dictionary` is copied in a similar way as a `List`. * Also see `deepcopy()`. * Can also be used as a `method`: * * mylist->copy() */ export function copy(denops: Denops, expr: unknown): Promise; export function copy(denops: Denops, ...args: unknown[]): Promise { return denops.call("copy", ...args); } /** * Return the cosine of **{expr}**, measured in radians, as a `Float`. * **{expr}** must evaluate to a `Float` or a `Number`. * Returns 0.0 if **{expr}** is not a `Float` or a `Number`. * Examples: * * :echo cos(100) * * 0.862319 * * :echo cos(-4.01) * * -0.646043 * * Can also be used as a `method`: * * Compute()->cos() * * *only available when compiled with the `+float` feature* */ export function cos(denops: Denops, expr: unknown): Promise; export function cos(denops: Denops, ...args: unknown[]): Promise { return denops.call("cos", ...args); } /** * Return the hyperbolic cosine of **{expr}** as a `Float` in the range * [1, inf]. * **{expr}** must evaluate to a `Float` or a `Number`. * Returns 0.0 if **{expr}** is not a `Float` or a `Number`. * Examples: * * :echo cosh(0.5) * * 1.127626 * * :echo cosh(-0.5) * * -1.127626 * * Can also be used as a `method`: * * Compute()->cosh() * * *only available when compiled with the `+float` feature* */ export function cosh(denops: Denops, expr: unknown): Promise; export function cosh(denops: Denops, ...args: unknown[]): Promise { return denops.call("cosh", ...args); } /** * Return the number of times an item with value **{expr}** appears * in `String`, `List` or `Dictionary` **{comp}**. * * If **{start}** is given then start with the item with this index. * **{start}** can only be used with a `List`. * * When **{ic}** is given and it's `TRUE` then case is ignored. * * When **{comp}** is a string then the number of not overlapping * occurrences of **{expr}** is returned. Zero is returned when * **{expr}** is an empty string. * * Can also be used as a `method`: * * mylist->count(val) */ export function count( denops: Denops, comp: unknown, expr: unknown, ic?: unknown, start?: unknown, ): Promise; export function count(denops: Denops, ...args: unknown[]): Promise { return denops.call("count", ...args); } /** * Checks for the existence of a `cscope` connection. If no * parameters are specified, then the function returns: * 0, if cscope was not available (not compiled in), or * if there are no cscope connections; * 1, if there is at least one cscope connection. * * If parameters are specified, then the value of **{num}** * determines how existence of a cscope connection is checked: * * **{num}** Description of existence check * ----- ------------------------------ * 0 Same as no parameters (e.g., "cscope_connection()"). * 1 Ignore **{prepend}**, and use partial string matches for * **{dbpath}**. * 2 Ignore **{prepend}**, and use exact string matches for * **{dbpath}**. * 3 Use **{prepend}**, use partial string matches for both * **{dbpath}** and **{prepend}**. * 4 Use **{prepend}**, use exact string matches for both * **{dbpath}** and **{prepend}**. * * Note: All string comparisons are case sensitive! * * Examples. Suppose we had the following (from ":cs show"): * * # pid database name prepend path * 0 27664 cscope.out /usr/local * * Invocation Return Val * ---------- ---------- * * cscope_connection() 1 * cscope_connection(1, "out") 1 * cscope_connection(2, "out") 0 * cscope_connection(3, "out") 0 * cscope_connection(3, "out", "local") 1 * cscope_connection(4, "out") 0 * cscope_connection(4, "out", "local") 0 * cscope_connection(4, "cscope.out", "/usr/local") 1 */ export function cscope_connection( denops: Denops, num?: unknown, dbpath?: unknown, prepend?: unknown, ): Promise; export function cscope_connection( denops: Denops, ...args: unknown[] ): Promise { return denops.call("cscope_connection", ...args); } /** * Specifically used to interrupt a program being debugged. It * will cause process **{pid}** to get a SIGTRAP. Behavior for other * processes is undefined. See `terminal-debugger`. * *only available on MS-Windows* * * Returns `TRUE` if successfully interrupted the program. * Otherwise returns `FALSE`. * * Can also be used as a `method`: * * GetPid()->debugbreak() */ export function debugbreak(denops: Denops, pid: unknown): Promise; export function debugbreak( denops: Denops, ...args: unknown[] ): Promise { return denops.call("debugbreak", ...args); } /** * Make a copy of **{expr}**. For Numbers and Strings this isn't * different from using **{expr}** directly. * When **{expr}** is a `List` a full copy is created. This means * that the original `List` can be changed without changing the * copy, and vice versa. When an item is a `List` or * `Dictionary`, a copy for it is made, recursively. Thus * changing an item in the copy does not change the contents of * the original `List`. * A `Dictionary` is copied in a similar way as a `List`. * * When **{noref}** is omitted or zero a contained `List` or * `Dictionary` is only copied once. All references point to * this single copy. With **{noref}** set to 1 every occurrence of a * `List` or `Dictionary` results in a new copy. This also means * that a cyclic reference causes deepcopy() to fail. * * Nesting is possible up to 100 levels. When there is an item * that refers back to a higher level making a deep copy with * **{noref}** set to 1 will fail. * Also see `copy()`. * * Can also be used as a `method`: * * GetObject()->deepcopy() */ export function deepcopy( denops: Denops, expr: unknown, noref?: unknown, ): Promise; export function deepcopy(denops: Denops, ...args: unknown[]): Promise { return denops.call("deepcopy", ...args); } /** * Without **{flags}** or with **{flags}** empty: Deletes the file by the * name **{fname}**. * * This also works when **{fname}** is a symbolic link. The symbolic * link itself is deleted, not what it points to. * * When **{flags}** is "d": Deletes the directory by the name * **{fname}**. This fails when directory **{fname}** is not empty. * * When **{flags}** is "rf": Deletes the directory by the name * **{fname}** and everything in it, recursively. BE CAREFUL! * Note: on MS-Windows it is not possible to delete a directory * that is being used. * * The result is a Number, which is 0/false if the delete * operation was successful and -1/true when the deletion failed * or partly failed. * * Use `remove()` to delete an item from a `List`. * To delete a line from the buffer use `:delete` or * `deletebufline()`. * * Can also be used as a `method`: * * GetName()->delete() */ export function delete_( denops: Denops, fname: unknown, flags?: unknown, ): Promise; export function delete_(denops: Denops, ...args: unknown[]): Promise { return denops.call("delete_", ...args); } /** * Delete lines **{first}** to **{last}** (inclusive) from buffer **{buf}**. * If **{last}** is omitted then delete line **{first}** only. * On success 0 is returned, on failure 1 is returned. * * This function works only for loaded buffers. First call * `bufload()` if needed. * * For the use of **{buf}**, see `bufname()` above. * * **{first}** and **{last}** are used like with `getline()`. Note that * when using `line()` this refers to the current buffer. Use "$" * to refer to the last line in buffer **{buf}**. * * Can also be used as a `method`: * * GetBuffer()->deletebufline(1) */ export function deletebufline( denops: Denops, buf: unknown, first: unknown, last?: unknown, ): Promise; export function deletebufline( denops: Denops, ...args: unknown[] ): Promise { return denops.call("deletebufline", ...args); } /** * Returns `TRUE` when autocommands are being executed and the * FileType event has been triggered at least once. Can be used * to avoid triggering the FileType event again in the scripts * that detect the file type. `FileType` * Returns `FALSE` when `:setf FALLBACK` was used. * When editing another file, the counter is reset, thus this * really checks if the FileType event has been triggered for the * current buffer. This allows an autocommand that starts * editing another buffer to set 'filetype' and load a syntax * file. */ export function did_filetype(denops: Denops): Promise; export function did_filetype( denops: Denops, ...args: unknown[] ): Promise { return denops.call("did_filetype", ...args); } /** * Returns the highlight ID for diff mode at line **{lnum}** column * **{col}** (byte index). When the current line does not have a * diff change zero is returned. * **{lnum}** is used like with `getline()`. Thus "." is the current * line, "'m" mark m, etc. * **{col}** is 1 for the leftmost column, **{lnum}** is 1 for the first * line. * The highlight ID can be used with `synIDattr()` to obtain * syntax information about the highlighting. * * Can also be used as a `method`: * * GetLnum()->diff_hlID(col) */ export function diff_hlID( denops: Denops, lnum: unknown, col: unknown, ): Promise; export function diff_hlID( denops: Denops, ...args: unknown[] ): Promise { return denops.call("diff_hlID", ...args); } /** * Return the digraph of **{chars}**. This should be a string with * exactly two characters. If **{chars}** are not just two * characters, or the digraph of **{chars}** does not exist, an error * is given and an empty string is returned. * * The character will be converted from Unicode to 'encoding' * when needed. This does require the conversion to be * available, it might fail. * * Also see `digraph_getlist()`. * * Examples: * * " Get a built-in digraph * :echo digraph_get('00') " Returns '∞' * * " Get a user-defined digraph * :call digraph_set('aa', 'あ') * :echo digraph_get('aa') " Returns 'あ' * * Can also be used as a `method`: * * GetChars()->digraph_get() * * This function works only when compiled with the `+digraphs` * feature. If this feature is disabled, this function will * display an error message. */ export function digraph_get(denops: Denops, chars: unknown): Promise; export function digraph_get( denops: Denops, ...args: unknown[] ): Promise { return denops.call("digraph_get", ...args); } /** * Return a list of digraphs. If the **{listall}** argument is given * and it is TRUE, return all digraphs, including the default * digraphs. Otherwise, return only user-defined digraphs. * * The characters will be converted from Unicode to 'encoding' * when needed. This does require the conservation to be * available, it might fail. * * Also see `digraph_get()`. * * Examples: * * " Get user-defined digraphs * :echo digraph_getlist() * * " Get all the digraphs, including default digraphs * :echo digraph_getlist(1) * * Can also be used as a `method`: * * GetNumber()->digraph_getlist() * * This function works only when compiled with the `+digraphs` * feature. If this feature is disabled, this function will * display an error message. */ export function digraph_getlist( denops: Denops, listall?: unknown, ): Promise; export function digraph_getlist( denops: Denops, ...args: unknown[] ): Promise { return denops.call("digraph_getlist", ...args); } /** * Add digraph **{chars}** to the list. **{chars}** must be a string * with two characters. **{digraph}** is a string with one UTF-8 * encoded character. * Be careful, composing characters are NOT ignored. This * 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 * this fails an error message is given and v:false is returned. * * If you want to define multiple digraphs at once, you can use * `digraph_setlist()`. * * Example: * * call digraph_set(' ', 'あ') * * Can be used as a `method`: * * GetString()->digraph_set('あ') * * This function works only when compiled with the `+digraphs` * feature. If this feature is disabled, this function will * display an error message. */ export function digraph_set( denops: Denops, chars: unknown, digraph: unknown, ): Promise; export function digraph_set( denops: Denops, ...args: unknown[] ): Promise { return denops.call("digraph_set", ...args); } /** * Similar to `digraph_set()` but this function can add multiple * digraphs at once. **{digraphlist}** is a list composed of lists, * where each list contains two strings with **{chars}** and * **{digraph}** as in `digraph_set()`. * Example: * * call digraph_setlist([['aa', 'あ'], ['ii', 'い']]) * * It is similar to the following: * * for [chars, digraph] in [['aa', 'あ'], ['ii', 'い']] * call digraph_set(chars, digraph) * endfor * * Except that the function returns after the first error, * following digraphs will not be added. * * Can be used as a `method`: * * GetList()->digraph_setlist() * * This function works only when compiled with the `+digraphs` * feature. If this feature is disabled, this function will * display an error message. */ export function digraph_setlist( denops: Denops, digraphlist: unknown, ): Promise; export function digraph_setlist( denops: Denops, ...args: unknown[] ): Promise { return denops.call("digraph_setlist", ...args); } /** * Return the Number 1 if **{expr}** is empty, zero otherwise. * - A `List` or `Dictionary` is empty when it does not have any * items. * - A `String` is empty when its length is zero. * - A `Number` and `Float` are empty when their value is zero. * - `v:false`, `v:none` and `v:null` are empty, `v:true` is not. * - A `Job` is empty when it failed to start. * - A `Channel` is empty when it is closed. * - A `Blob` is empty when its length is zero. * * For a long `List` this is much faster than comparing the * length with zero. * * Can also be used as a `method`: * * mylist->empty() */ export function empty(denops: Denops, expr: unknown): Promise; export function empty(denops: Denops, ...args: unknown[]): Promise { return denops.call("empty", ...args); } /** * Return all of environment variables as dictionary. You can * check if an environment variable exists like this: * * :echo has_key(environ(), 'HOME') * * Note that the variable name may be CamelCase; to ignore case * use this: * * :echo index(keys(environ()), 'HOME', 0, 1) != -1 */ export function environ(denops: Denops): Promise; export function environ(denops: Denops, ...args: unknown[]): Promise { return denops.call("environ", ...args); } /** * Escape the characters in **{chars}** that occur in **{string}** with a * backslash. Example: * * :echo escape('c:\program files\vim', ' \') * * results in: * * c:\\program\ files\\vim * * Also see `shellescape()` and `fnameescape()`. * * Can also be used as a `method`: * * GetText()->escape(' \') */ export function escape( denops: Denops, string: unknown, chars: unknown, ): Promise; export function escape(denops: Denops, ...args: unknown[]): Promise { return denops.call("escape", ...args); } /** * Evaluate **{string}** and return the result. Especially useful to * turn the result of `string()` back into the original value. * This works for Numbers, Floats, Strings, Blobs and composites * of them. Also works for `Funcref`s that refer to existing * functions. * * Can also be used as a `method`: * * argv->join()->eval() */ export function eval_(denops: Denops, string: unknown): Promise; export function eval_(denops: Denops, ...args: unknown[]): Promise { return denops.call("eval_", ...args); } /** * Returns 1 when inside an event handler. That is that Vim got * interrupted while waiting for the user to type a character, * e.g., when dropping a file on Vim. This means interactive * commands cannot be used. Otherwise zero is returned. */ export function eventhandler(denops: Denops): Promise; export function eventhandler( denops: Denops, ...args: unknown[] ): Promise { return denops.call("eventhandler", ...args); } /** * This function checks if an executable with the name **{expr}** * exists. **{expr}** must be the name of the program without any * arguments. * executable() uses the value of $PATH and/or the normal * searchpath for programs. * On MS-Windows the ".exe", ".bat", etc. can optionally be * included. Then the extensions in $PATHEXT are tried. Thus if * "foo.exe" does not exist, "foo.exe.bat" can be found. If * $PATHEXT is not set then ".com;.exe;.bat;.cmd" is used. A dot * by itself can be used in $PATHEXT to try using the name * without an extension. When 'shell' looks like a Unix shell, * then the name is also tried without adding an extension. * On MS-Windows it only checks if the file exists and is not a * directory, not if it's really executable. * On MS-Windows an executable in the same directory as Vim is * normally found. Since this directory is added to $PATH it * should also work to execute it `win32-PATH`. This can be * disabled by setting the $NoDefaultCurrentDirectoryInExePath * environment variable. * The result is a Number: * 1 exists * 0 does not exist * -1 not implemented on this system * `exepath()` can be used to get the full path of an executable. * * Can also be used as a `method`: * * GetCommand()->executable() */ export function executable(denops: Denops, expr: unknown): Promise; export function executable( denops: Denops, ...args: unknown[] ): Promise { return denops.call("executable", ...args); } /** * Execute an Ex command or commands and return the output as a * string. * **{command}** can be a string or a List. In case of a List the * lines are executed one by one. * This is equivalent to: * * redir => var * {command} * redir END * * The optional **{silent}** argument can have these values: * "" no `:silent` used * "silent" `:silent` used * "silent!" `:silent!` used * The default is "silent". Note that with "silent!", unlike * `:redir`, error messages are dropped. When using an external * command the screen may be messed up, use `system()` instead. * * It is not possible to use `:redir` anywhere in **{command}**. * * To get a list of lines use `split()` on the result: * * execute('args')->split("\n") * * To execute a command in another window than the current one * use `win_execute()`. * * When used recursively the output of the recursive call is not * included in the output of the higher level call. * * Can also be used as a `method`: * * GetCommand()->execute() */ export function execute( denops: Denops, command: unknown, silent?: unknown, ): Promise; export function execute(denops: Denops, ...args: unknown[]): Promise { return denops.call("execute", ...args); } /** * If **{expr}** is an executable and is either an absolute path, a * relative path or found in $PATH, return the full path. * Note that the current directory is used when **{expr}** starts * with "./", which may be a problem for Vim: * * echo exepath(v:progpath) * * If **{expr}** cannot be found in $PATH or is not executable then * an empty string is returned. * * Can also be used as a `method`: * * GetCommand()->exepath() */ export function exepath(denops: Denops, expr: unknown): Promise; export function exepath(denops: Denops, ...args: unknown[]): Promise { return denops.call("exepath", ...args); } /** * Return the exponential of **{expr}** as a `Float` in the range * [0, inf]. * **{expr}** must evaluate to a `Float` or a `Number`. * Returns 0.0 if **{expr}** is not a `Float` or a `Number`. * Examples: * * :echo exp(2) * * 7.389056 * * :echo exp(-1) * * 0.367879 * * Can also be used as a `method`: * * Compute()->exp() * * *only available when compiled with the `+float` feature* */ export function exp(denops: Denops, expr: unknown): Promise; export function exp(denops: Denops, ...args: unknown[]): Promise { return denops.call("exp", ...args); } /** * Expand wildcards and the following special keywords in * **{string}**. 'wildignorecase' applies. * * If **{list}** is given and it is `TRUE`, a List will be returned. * Otherwise the result is a String and when there are several * matches, they are separated by `` characters. [Note: in * version 5.0 a space was used, which caused problems when a * file name contains a space] * * If the expansion fails, the result is an empty string. A name * for a non-existing file is not included, unless **{string}** does * not start with '%', '#' or '<', see below. * * When **{string}** starts with '%', '#' or '<', the expansion is * done like for the `cmdline-special` variables with their * associated modifiers. Here is a short overview: * * % current file name * # alternate file name * #n alternate file name n * `` file name under the cursor * `` autocmd file name * `` autocmd buffer number (as a String!) * `` autocmd matched name * `` C expression under the cursor * `` sourced script file or function name * `` sourced script line number or function * line number * `` script file line number, also when in * a function * `` `"123_"` where "123" is the * current script ID `` * `