Skip to content

Instantly share code, notes, and snippets.

@kkiyama117
Created March 7, 2021 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkiyama117/88ac9bd1b5725d87b43103bd1ab7d94d to your computer and use it in GitHub Desktop.
Save kkiyama117/88ac9bd1b5725d87b43103bd1ab7d94d to your computer and use it in GitHub Desktop.
// Import 'start' function from denops_std
import {start} from "https://deno.land/x/denops_std@v0.3/mod.ts";
// Call 'start' with async callback. The callback get 'vim' instance.
start(async (vim) => {
vim.register({
// async echo(_: unknown): Promise<unknown> {
async echo(_: unknown): Promise<void> {
// const test = await vim.g.get("denops_helloworld") as [boolean];
const test = await vim.g.get("denops_helloworld");
console.log("", typeof test);
console.log("", typeof test[0] );
},
});
// Use 'vim.execute()' to execute Vim script
await vim.execute(`
command! DenopsRustEcho echo denops#request("${vim.name}", "echo", [""])
let g:denops_helloworld = [v:true]
`);
console.log("denops-demo.vim has loaded");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment