Created
March 7, 2021 09:17
-
-
Save kkiyama117/88ac9bd1b5725d87b43103bd1ab7d94d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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