Skip to main content
Module

x/denops_std/function/vim/mod.ts>remote_expr

📚 Standard module for denops.vim
Go to Latest
function remote_expr
import { remote_expr } from "https://deno.land/x/denops_std@v6.4.0/function/vim/mod.ts";

Send the {string} to {server}. The {server} argument is a string, also see {server}.

The string is sent as an expression and the result is returned after evaluation. The result must be a String or a List. A List is turned into a String by joining the items with a line break in between (not at the end), like with join(expr, "\n").

If {idvar} is present and not empty, it is taken as the name of a variable and a {serverid} for later use with remote_read() is stored there.

If {timeout} is given the read times out after this many seconds. Otherwise a timeout of 600 seconds is used.

See also clientserver RemoteReply. This function is not available in the sandbox. only available when compiled with the +clientserver feature Note: Any errors will cause a local error message to be issued and the result will be the empty string.

Variables will be evaluated in the global namespace, independent of a function currently being active. Except when in debug mode, then local function variables and arguments can be evaluated.

Examples:

:echo remote_expr("gvim", "2+2")
:echo remote_expr("gvim1", "b:current_syntax")

Can also be used as a method:

ServerName()->remote_expr(expr)

Parameters

denops: Denops
server: unknown
string: unknown
optional
idvar: unknown
optional
timeout: unknown

Returns

Promise<string>