Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
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@v6.4.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 (which may differ from the {address} argument, see below).

  • If {address} has a colon (":") it is a TCP/IPv4/IPv6 address where the last ":" separates host and port (empty or zero assigns a random port).
  • Else {address} is the path to a named pipe (except on Windows).
    • If {address} has no slashes ("/") it is treated as the "name" part of a generated path in this format:

      stdpath("run").."/{name}.{pid}.{counter}"
      
    • If {address} is omitted the name is "nvim".

      :echo serverstart()
      => /tmp/nvim.bram/oknANW/nvim.15430.5
      

Example bash command to list all Nvim servers:

    ls ${XDG_RUNTIME_DIR:-${TMPDIR}nvim.${USER}}/* /nvim.*.0

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>