Skip to main content
Module

x/denops_std/function/nvim/mod.ts>menu_get

📚 Standard module for denops.vim
Latest
function menu_get
import { menu_get } from "https://deno.land/x/denops_std@v6.5.0/function/nvim/mod.ts";

Returns a List of Dictionaries describing menus (defined by :menu, :amenu, …), including hidden-menus.

{path} matches a menu by name, or all menus if {path} is an empty string. Example:

:echo menu_get('File','')
:echo menu_get('')

{modes} is a string of zero or more modes (see maparg() or creating-menus for the list of modes). "a" means "all".

Example:

nnoremenu &Test.Test inormal
inoremenu Test.Test insert
vnoremenu Test.Test x
echo menu_get("")

returns something like this:

[ {
  "hidden": 0,
  "name": "Test",
  "priority": 500,
  "shortcut": 84,
  "submenus": [ {
    "hidden": 0,
    "mappings": {
      i": {
        "enabled": 1,
        "noremap": 1,
        "rhs": "insert",
        "sid": 1,
        "silent": 0
      },
      n": { ... },
      s": { ... },
      v": { ... }
    },
    "name": "Test",
    "priority": 500,
    "shortcut": 0
  } ]
} ]

Parameters

denops: Denops
path: unknown
optional
modes: unknown

Returns

Promise<unknown[]>