Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/mod.ts>Denops

๐Ÿ“š Standard module for denops.vim
Latest
interface Denops
import { type Denops } from "https://deno.land/x/denops_std@v6.5.1/mod.ts";

Denops is a facade instance visible from each denops plugin.

Properties

readonly
name: string

Denops instance name used to communicate with Vim.

readonly
meta: Meta

Environment meta information.

readonly
context: Record<PropertyKey, unknown>

Context object for plugins.

dispatcher: Dispatcher

User-defined API name and method map used to dispatch API requests.

Methods

redraw(force?: boolean): Promise<void>

Redraw text and cursor on Vim.

It is not equivalent to the redraw command in Vim script and does nothing on Neovim. Use denops.cmd('redraw') instead if you need to execute the redraw command.

call(fn: string, ...args: unknown[]): Promise<unknown>

Call an arbitrary function of Vim/Neovim and return the result.

batch(...calls: [string, ...unknown[]][]): Promise<unknown[]>

Call arbitrary functions of Vim/Neovim sequentially without redraw and return the results.

It throws a BatchError when one of the functions fails. The results attribute of the error instance holds succeeded results of functions prior to the error.

cmd(cmd: string, ctx?: Context): Promise<void>

Execute an arbitrary command of Vim/Neovim under a given context.

eval(expr: string, ctx?: Context): Promise<unknown>

Evaluate an arbitrary expression of Vim/Neovim under a given context and return the result.

dispatch(
name: string,
fn: string,
...args: unknown[],
): Promise<unknown>

Dispatch an arbitrary function of an arbitrary plugin and return the result.