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

x/denops_std/helper/mod.ts

๐Ÿ“š Standard module for denops.vim
Go to Latest
import * as denopsStd from "https://deno.land/x/denops_std@v6.5.0/helper/mod.ts";

A module to provide expression string function to represents Vim's string constant.

import type { Entrypoint } from "https://deno.land/x/denops_std@v6.5.0/mod.ts";
import * as fn from "https://deno.land/x/denops_std@v6.5.0/function/mod.ts";
import {
  type ExprString,
  exprQuote as q,
  useExprString,
} from "https://deno.land/x/denops_std@v6.5.0/helper/expr_string.ts";

export const main: Entrypoint = async (denops) => {
  // Create `ExprString` value with `exprQuote`.
  const vimKeySequence: ExprString = q`\<Cmd>echo 'foo'\<CR>`;

  // Use `ExprString` value in `useExprString` block.
  await useExprString(denops, async (denops) => {
    await fn.feedkeys(denops, vimKeySequence)
    await denops.cmd('echo value', { value: q`\U0001F680` })
  });
}

Functions

Echo message as like echo on Vim script.

Echo message as an error message.

Ensure global silent status during given function

Execute multi-lined Vim script directly

Tagged template function that marks a string as Vim's string constant format. Returns a String wrapper object instead of a primitive string.

Call given function and print a friendly error message (without stack trace) on failure.

Get global silent status

Open a prompt to get user input.

Returns true if the value is a string marked as Vim's string constant format.

Load a Vim script in a local/remote URL

Send key sequences synchronously. denops#request blocks, so note that it can only be used within denops#notify.

Set global silent status

Call the denops function using Vim's string constant format.

Type Aliases

String that marked as Vim's string constant format.