Skip to main content
Module

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

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

Executes Vimscript (multiline block of Ex commands), like anonymous :source.

Unlike nvim_command() this function supports heredocs, script-scope (s:), etc.

On execution error: fails with VimL error, updates v:errmsg.

Parameters:

  • {src} Vimscript code
  • {opts} Optional parameters. - output: (boolean, default false) Whether to capture and return all (non-error, non-shell :!) output.

Return: Dictionary containing information about execution, with these keys: - output: (string|nil) Output if opts.output is true.

See also:

  • execute()
  • nvim_command()
  • nvim_cmd()

Parameters

denops: Denops
src: unknown
opts: unknown

Returns

Promise<unknown>