Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

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

📚 Standard module for denops.vim
Go to Latest
function serverstart
import { serverstart } from "https://deno.land/x/denops_std@v5.1.0/function/nvim/mod.ts";

Opens a socket or named pipe at {address} and listens for RPC messages. Clients can send API commands to the returned address to control Nvim.

Returns the address string (may differ from the requested {address}).

  • If {address} contains a colon ":" it is interpreted as a TCP/IPv4/IPv6 address where the last ":" separates host and port (empty or zero assigns a random port).
  • Else it is interpreted as a named pipe or Unix domain socket path. If there are no slashes it is treated as a name and appended to a generated path.
  • If {address} is empty it generates a path.

Example named pipe:

if has('win32')
  echo serverstart('\\.\pipe\nvim-pipe-1234')
else
  echo serverstart('nvim.sock')
endif

Example TCP/IP address:

echo serverstart('::1:12345')

Parameters

denops: Denops
optional
address: unknown

Returns

Promise<unknown>