Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddc_vim/deps.ts>autocmd.define

Dark deno-powered completion framework for neovim/Vim
Go to Latest
function autocmd.define
import { autocmd } from "https://deno.land/x/ddc_vim@v4.1.0/deps.ts";
const { define } = autocmd;

Define an autocmd

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

export async function main(denops: Denops): Promise<void> {
  // Define new autocmd for BufEnter
  await autocmd.define(denops, "BufEnter", "*", "echo 'BufEnter'");

  // Define new autocmd for BufEnter in 'MyGroup'
  await autocmd.define(denops, "BufEnter", "*", "echo 'BufEnter'", {
    group: "MyGroup",
  });

  // Define new autocmd for BufEnter with '++once'
  await autocmd.define(denops, "BufEnter", "*", "echo 'BufEnter'", {
    once: true,
  });

  // Define new autocmd for BufEnter with '++nested'
  await autocmd.define(denops, "BufEnter", "*", "echo 'BufEnter'", {
    nested: true,
  });

  // Define multiple autocmds
  await autocmd.define(denops, ["BufEnter", "WinEnter"], "*", "echo 'Enter'");
}

Parameters

denops: Denops
pat: string | string[]
cmd: string
optional
options: DefineOptions = [UNSUPPORTED]

Returns

Promise<void>