import { execute } from "https://deno.land/x/denops_std@v6.1.0/helper/mod.ts";
Execute multi-lined Vim script directly
import type { Denops } from "https://deno.land/x/denops_std@v6.1.0/mod.ts";
import { execute } from "https://deno.land/x/denops_std@v6.1.0/helper/execute.ts";
export async function main(denops: Denops): Promise<void> {
await execute(
denops,
`
command! CommandA echo "A"
command! CommandB echo "B"
command! CommandC echo "C"
`,
);
// You can pass context like
await execute(
denops,
`
command! CommandA echo msg_a
command! CommandB echo msg_b
command! CommandC echo l:msg_c
`,
{
msg_a: "Hello A",
msg_b: "Hello B",
msg_c: "Hello C",
},
);
}