Nefarious Planetary Meddling
    Have ideas to improve npm?Join in the discussion! »

    TypeScript icon, indicating that this package has built-in type declarations

    3.0.2 • Public • Published


    NPM Version Node.js Version Test Lint Test Coverage

    Show the help of Vim.

    This package uses Vim in background. So you need Vim in your environment.


    • Node.js v12.10.0+
      • v13 is not supported because it is no longer maintained
    • Vim
      • Version 7.4 or later is recommended.
    • Git
      • To use PluginManager.
      • Git 2.3 or above is recommended.
        • Because GIT_TERMINAL_PROMPT environment variable is available. This script may freeze when the interactive prompt appears with old Git. For example, when you specify the non-exist repository.


    Install it using npm:

    $ npm install vimhelp


    // You can search the help of Vim.
    const {VimHelp} = require("vimhelp");
    (async () => {
    let vimHelp = new VimHelp();
    let text = await"j");
    /* The following text is shown:
    j               or                                      *j*
    <Down>          or                                      *<Down>*
    CTRL-J          or                                      *CTRL-J*
    <NL>            or                                      *<NL>* *CTRL-N*
    CTRL-N                  [count] lines downward |linewise|.
    // This package have a simple plugin manager.
    const {PluginManager} = require("vimhelp");
    (async () => {
    // Plugins are installed to under the basedir.
    let manager = new PluginManager("/path/to/basedir");
    await manager.install("thinca/vim-quickrun");
    console.log(manager.pluginNames);  // => ["thinca/vim-quickrun"]
    await manager.install("vim-jp/vital.vim");
    console.log(manager.pluginNames);  // => ["thinca/vim-quickrun", "vim-jp/vital.vim"]
    await manager.uninstall("vim-jp/vital.vim");
    console.log(manager.pluginNames);  // => ["thinca/vim-quickrun"]
    // You can also search the help of plugin with PluginManager.
    let text = await"quickrun");
    // => *quickrun* is Vim plugin to execute whole/part of editing file.
    // => (...snip)
    // You can specify the 'helplang' option
    vimHelp.helplang = ["ja", "en"];
    let text = await"quickrun");
    // => *quickrun* は編集中のファイルの全体もしくは一部を実行する Vim プラグインです。
    // => (...snip)


    class VimHelp

    VimHelp can take help text of Vim via vim command.

    new VimHelp([{vimBin}])

    • {vimBin}
      • Path to vim command. "vim" in the $PATH is used in default.


    Searches {subject} from Vim's help and returns A Promise. When the {subject} is found, the Promise will be resolved by the help text. Otherwise, rejected an object like {errorCode, resultText, errorText}. In most cases, errorText is useful to know the cause of error.


    • {provider}
      • A runtimepath provider. This is a function that has no arguments and returns an array of paths.

    The runtimepaths from this is used in .search().


    An array of langs to set 'helplang' option. Default value is an empty array. ex: ["ja", "en"]

    class PluginManager

    PluginManager can install Vim plugins from any Git repository.

    This class references the Vim plugin by {plugin-name}. {plugin-name} is one of the following.

    • A repository name of
      • ex: taglist.vim
    • A GitHub repository name like {user}/{repos}
      • ex: vim-jp/vital.vim
    • An URL of Git repository.
      • ex:

    This class doesn't do a exclusive operation at all for simplification.

    new PluginManager([{basePath} [, {vimBin}]])

    • {basePath}
      • Path to base of plugins. All plugins are installed to under this directory.
    • {vimBin}
      • Path to vim command. "vim" in the $PATH is used in default.
      • This is used when updating helptags.


    An array of installed plugin informations. Read only. Each entry is object as follows:

      pluginName: <plugin name>,
      dirName: <dir name>,
      runtimepath: <runtimepath>,
      repository: <URL of repository>


    An array of installed {plugin-name}s. Read only.


    An array of paths of installed plugins. Read only.


    A function that returns paths of installed plugins. This is not a method. You can pass this function to VimHelp.setRTPProvider(). Read only.


    Installs a new Vim plugin. Returns a Promise. When Installation succeeded, resolved by commit hash of Git which is version of installed plugin. Otherwise, rejected by Error object or an object like {errorCode, resultText, errorText}.


    Uninstalls a installed Vim plugin. Returns a Promise. When Uninstallation succeeded, resolved by the path of uninstalled plugin. Otherwise, rejected by Error object or an object like {errorCode, resultText, errorText}.


    Uninstalls all Vim plugins.


    Updates installed plugins. {plugin-names} is an array of {plugin-name}. When {plugin-names} is omitted, all plugins are updated. Returns a Promise. When updating succeeded, resolved by the array of updating informations. An updating information is following:

    • pluginName
      • {plugin-name} of this plugin.
    • pluginPath
      • A local path of this plugin.
    • beforeVersion
      • A commit hash of Git which is version of before updating.
    • afterVision
      • A commit hash of Git which is version of after updating.
    • updated()
      • A function that returns true when this plugin is updated.

    When updating failed, resolved by the array of updating informations.


    $ npm test


    zlib License




    npm i vimhelp

    DownloadsWeekly Downloads






    Unpacked Size

    20.6 kB

    Total Files


    Last publish


    • avatar