Skip to main content
Module

x/denops_std/mapping/mod.ts>map

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

Register a mapping for lhs to rhs with given options.

import { Denops } from "../mod.ts";
import * as mapping from "../mapping/mod.ts";

export async function main(denops: Denops): Promise<void> {
  await mapping.map(denops, "<Plug>(test-denops-std)", "Hello");
  await mapping.map(denops, "<Plug>(test-denops-std)", "Hello", {
    mode: "i",
  });
}

Users can specify multiple mode value like:

import { Denops } from "../mod.ts";
import * as mapping from "../mapping/mod.ts";

export async function main(denops: Denops): Promise<void> {
  await mapping.map(denops, "<Plug>(test-denops-std)", "Hello", {
    mode: ["n", "i", "x"],
  });
}

Parameters

denops: Denops
lhs: string
rhs: string
optional
options: MapOptions = [UNSUPPORTED]

Returns

Promise<void>