pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/vim-denops/deno-denops-std

rossorigen="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-8522af645b000615.css" /> GitHub - vim-denops/deno-denops-std: πŸ“š Standard module for denops.vim Β· GitHub
Skip to content

vim-denops/deno-denops-std

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

787 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐜 @denops/std

JSR Test codecov

Deno 2.3.0 or above Vim 9.1.1646 or above Neovim 0.11.3 or above

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 "jsr:@denops/std";
import * as batch from "jsr:@denops/std/batch";
import * as fn from "jsr:@denops/std/function";
import * as vars from "jsr:@denops/std/variable";
import * as helper from "jsr:@denops/std/helper";

import { assert, is } from "jsr:@core/unknownutil";

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.

About

πŸ“š Standard module for denops.vim

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy