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

x/denops_std/function/nvim/mod.ts>stdioopen

๐Ÿ“š Standard module for denops.vim
Go to Latest
function stdioopen
import { stdioopen } from "https://deno.land/x/denops_std@v6.4.0/function/nvim/mod.ts";

With --headless this opens stdin and stdout as a channel. May be called only once. See channel-stdio. stderr is not handled by this function, see v:stderr.

Close the stdio handles with chanclose(). Use chansend() to send data to stdout, and rpcrequest() and rpcnotify() to communicate over RPC.

{opts} is a dictionary with these keys: on_stdin : callback invoked when stdin is written to. on_print : callback invoked when Nvim needs to print a message, with the message (whose type is string) as sole argument. stdin_buffered : read stdin in channel-buffered mode. rpc : If set, msgpack-rpc will be used to communicate over stdio Returns:

  • channel-id on success (value is always 1)
  • 0 on invalid arguments

Parameters

denops: Denops
opts: unknown

Returns

Promise<number>