Home Explore Blog CI



neovim

84th chunk of `runtime/doc/vimfn.txt`
02560851a74707111a9cb620d701197adf29b7977563c8a00000000100000fab
    "name": "Test",
			    "priority": 500,
			    "shortcut": 0
			  } ]
			} ]
<

                Parameters: ~
                  • {path} (`string`)
                  • {modes} (`string?`)

                Return: ~
                  (`any`)

menu_info({name} [, {mode}])                                       *menu_info()*
		Return information about the specified menu {name} in
		mode {mode}. The menu name should be specified without the
		shortcut character ('&'). If {name} is "", then the top-level
		menu names are returned.

		{mode} can be one of these strings:
			"n"	Normal
			"v"	Visual (including Select)
			"o"	Operator-pending
			"i"	Insert
			"c"	Cmd-line
			"s"	Select
			"x"	Visual
			"t"	Terminal-Job
			""	Normal, Visual and Operator-pending
			"!"	Insert and Cmd-line
		When {mode} is omitted, the modes for "" are used.

		Returns a |Dictionary| containing the following items:
		  accel		menu item accelerator text |menu-text|
		  display	display name (name without '&')
		  enabled	v:true if this menu item is enabled
				Refer to |:menu-enable|
		  icon		name of the icon file (for toolbar)
				|toolbar-icon|
		  iconidx	index of a built-in icon
		  modes		modes for which the menu is defined. In
				addition to the modes mentioned above, these
				characters will be used:
				" "	Normal, Visual and Operator-pending
		  name		menu item name.
		  noremenu	v:true if the {rhs} of the menu item is not
				remappable else v:false.
		  priority	menu order priority |menu-priority|
		  rhs		right-hand-side of the menu item. The returned
				string has special characters translated like
				in the output of the ":menu" command listing.
				When the {rhs} of a menu item is empty, then
				"<Nop>" is returned.
		  script	v:true if script-local remapping of {rhs} is
				allowed else v:false.  See |:menu-script|.
		  shortcut	shortcut key (character after '&' in
				the menu name) |menu-shortcut|
		  silent	v:true if the menu item is created
				with <silent> argument |:menu-silent|
		  submenus	|List| containing the names of
				all the submenus.  Present only if the menu
				item has submenus.

		Returns an empty dictionary if the menu item is not found.

		Examples: >vim
			echo menu_info('Edit.Cut')
			echo menu_info('File.Save', 'n')

			" Display the entire menu hierarchy in a buffer
			func ShowMenu(name, pfx)
			  let m = menu_info(a:name)
			  call append(line('$'), a:pfx .. m.display)
			  for child in m->get('submenus', [])
			    call ShowMenu(a:name .. '.' .. escape(child, '.'),
							\ a:pfx .. '    ')
			  endfor
			endfunc
			new
			for topmenu in menu_info('').submenus
			  call ShowMenu(topmenu, '')
			endfor
<

                Parameters: ~
                  • {name} (`string`)
                  • {mode} (`string?`)

                Return: ~
                  (`any`)

min({expr})                                                              *min()*
		Return the minimum value of all items in {expr}. Example: >vim
			echo min([apples, pears, oranges])

<		{expr} can be a |List| or a |Dictionary|.  For a Dictionary,
		it returns the minimum of all values in the Dictionary.
		If {expr} is neither a List nor a Dictionary, or one of the
		items in {expr} cannot be used as a Number this results in
		an error.  An empty |List| or |Dictionary| results in zero.

                Parameters: ~
                  • {expr} (`any`)

                Return: ~
                  (`number`)

mkdir({name} [, {flags} [, {prot}]])                              *mkdir()* *E739*
		Create directory {name}.

		When {flags} is present it must be a string.  An empty string
		has no effect.

		{flags} can contain these character flags:
		 "p"	intermediate directories will be created as necessary
		 "D"	{name} will be deleted at the end of the current
			function, but not recursively |:defer|
		 "R"	{name} will be deleted recursively at the end of the
			current function |:defer|

		Note that when {name} has more than one part and "p" is used

Title: Vim Function Documentation: menu_info(), min(), and mkdir()
Summary
This section provides detailed documentation for the `menu_info()` function, which retrieves information about a specific menu item, including its accelerator, display name, status, icon, mode, and associated right-hand-side command. It also gives an example of using it to display the entire menu hierarchy in a buffer. Following that, it explains the `min()` function, which returns the minimum value in a list or dictionary, and lastly, the `mkdir()` function, which creates a directory with specified flags for creating intermediate directories or marking the directory for deletion using `:defer`.