import { define } from "https://deno.land/x/denops_std@v5.0.2/autocmd/mod.ts";
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
event: AutocmdEvent | AutocmdEvent[]
optional
options: DefineOptions = [UNSUPPORTED]