v6.5.1
π Standard module for denops.vim
Attributes
Extremely Popular
Includes Deno configuration
Repository
Current version released
4 months ago
Dependencies
deno.land/x
Versions
- v6.5.1Latest
- v7.0.0-pre2
- v7.0.0-pre1
- v7.0.0-pre0
- v6.5.0
- v6.4.3
- v6.4.2
- v6.4.1
- v6.4.0
- v6.3.0
- v6.2.0
- v6.1.0
- v6.0.1
- v6.0.0
- v5.3.0
- v5.2.0
- v5.1.0
- v5.0.2
- v5.0.1
- v5.0.0
- v4.3.3
- v4.3.1
- v4.3.0
- v4.2.0
- v4.1.9
- v4.1.8
- v4.1.7
- v4.1.6
- v4.1.5
- v4.1.4
- v4.1.3
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.0
- v3.12.2
- v3.12.1
- v3.12.0
- v3.11.3
- v3.11.2
- v3.11.1
- v3.11.0
- v3.10.2
- v3.10.1
- v3.10.0
- v3.9.3
- v3.9.2
- v3.9.1
- v3.9.0
- v3.8.2
- v3.8.1
- v3.8.0
- v3.7.1
- v3.7.0
- v3.6.0
- v3.5.0
- v3.4.2
- v3.4.1
- v3.4.1
- v3.4.0
- v3.3.2
- v3.3.1
- v3.3.0
- v3.2.0
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.0
- v3.0.0
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.1
- v2.0.0
- v1.11.3
- v1.11.2
- v1.11.1
- v1.11.0
- v1.10.0
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.1
- v1.8.0
- v1.7.4
- v1.7.3
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.1
- v1.6.1
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.0
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.1
- v1.0.0
- v1.0.0-beta.8
- v1.0.0-beta.7
- v1.0.0-beta.6
- v1.0.0-beta.5
- v1.0.0-beta.4
- v1.0.0-beta.3
- v1.0.0-beta.2
- v1.0.0-beta.1
- v1.0.0-beta.0
- v1.0.0-alpha.9
- v1.0.0-alpha.9
- v1.0.0-alpha.8
- v1.0.0-alpha.7
- v1.0.0-alpha.6
- v1.0.0-alpha.5
- v1.0.0-alpha.4
- v1.0.0-alpha.3
- v1.0.0-alpha.2
- v1.0.0-alpha.1
- v1.0.0-alpha.0
- v0.15.0
- v0.14.1
- v0.14.1
- v0.14
- v0.13
- v0.12
- v0.11
- v0.10
- v0.9
- v0.8
- v0.7
- v0.5
- v0.4
- v0.3
- v0.2
- v0.1
- v0.0
π denops_std
Standard module for denops.vim.
This module is assumed to be used for developing denops plugins. The code is assumed to be called in a dedicated worker thread.
By using this module, developers can write Vim/Neovim denops plugins like:
import type { Denops } from "https://deno.land/x/denops_std@v6.5.1/mod.ts";
import * as batch from "https://deno.land/x/denops_std@v6.5.1/batch/mod.ts";
import * as fn from "https://deno.land/x/denops_std@v6.5.1/function/mod.ts";
import * as vars from "https://deno.land/x/denops_std@v6.5.1/variable/mod.ts";
import * as helper from "https://deno.land/x/denops_std@v6.5.1/helper/mod.ts";
import { assert, is } from "https://deno.land/x/unknownutil@v3.14.1/mod.ts";
export function main(denops: Denops): void {
denops.dispatcher = {
async init() {
// This is just an example. Developers usually should define commands directly in Vim script.
await batch.batch(denops, async (denops) => {
await denops.cmd(
`command! HelloWorld call denops#notify("${denops.name}", "say", ["World"])`,
);
await denops.cmd(
`command! HelloDenops call denops#notify("${denops.name}", "say", ["Denops"])`,
);
});
},
async say(where) {
assert(where, is.String);
const [name, progname] = await batch.collect(denops, (denops) => [
fn.input(denops, "Your name: "),
vars.v.get(denops, "progname"),
]);
const messages = [
`Hello ${where}.`,
`Your name is ${name}.`,
`This is ${progname}.`,
];
await helper.echo(denops, messages.join("\n"));
},
};
}
Note that developers should avoid calling initialization code within the
main
function. If necessary, add an init
API or a similar approach like
above and call it from plugin/<your_plugin>.vim
.
See Denops Documentation or denops-helloworld.vim for more details.
License
The code follows MIT license written in LICENSE. Contributors need to agree that any modifications sent in this repository follow the license.