Home Explore Blog CI



neovim

4th chunk of `runtime/doc/usr_42.txt`
b363ec260a3458b0cd075f79fb3bb70c0fd3a3e8441d2c520000000100000953
 but with "menu"
changed to "unmenu".  Thus ":menu" becomes, ":unmenu", ":nmenu" becomes
":nunmenu", etc.  To delete the "Tools.Make" item for Insert mode: >

	:iunmenu Tools.Make

You can delete a whole menu, with all its items, by using the menu name.
Example: >

	:aunmenu Syntax

This deletes the Syntax menu and all the items in it.

==============================================================================
*42.3*	Various

You can change the appearance of the menus with flags in 'guioptions'.  In the
default value they are all included, except "M".  You can remove a flag with a
command like: >

	:set guioptions-=m
<
	m		When removed the menubar is not displayed.

	M		When added the default menus are not loaded.

	g		When removed the inactive menu items are not made grey
			but are completely removed.  (Does not work on all
			systems.)

For translating menu items, see |:menutrans|.

Since the mouse has to be used to select a menu item, it is a good idea to use
the ":browse" command for selecting a file.  And ":confirm" to get a dialog
instead of an error message, e.g., when the current buffer contains changes.
These two can be combined: >

	:amenu File.Open  :browse confirm edit<CR>

The ":browse" makes a file browser appear to select the file to edit.  The
":confirm" will pop up a dialog when the current buffer has changes.  You can
then select to save the changes, throw them away or cancel the command.
   For more complicated items, the confirm() and inputdialog() functions can
be used.  The default menus contain a few examples.

==============================================================================
*42.4*	Toolbar and popup menus

There are two special menus: ToolBar and PopUp.  Items that start with these
names do not appear in the normal menu bar.


TOOLBAR

The toolbar appears only when the "T" flag is included in the 'guioptions'
option.
   The toolbar uses icons rather than text to represent the command.  For
example, the {menu-item} named "ToolBar.New" causes the "New" icon to appear
on the toolbar.
   The Vim editor has 28 built-in icons.  You can find a table here:
|builtin-tools|.  Most of them are used in the default toolbar.  You can
redefine what these items do (after the default menus are setup).
   You can add another bitmap for a toolbar item.  Or define a new toolbar
item with a bitmap.  For example, define a new

Title: Menu Deletion, Appearance, and Special Menus: Toolbar and Popup
Summary
This section explains how to delete menus using the ":unmenu" command and customize menu appearance with 'guioptions' flags. It also introduces special menus like ToolBar and PopUp. The ToolBar menu uses icons from |builtin-tools| and is displayed when the 'T' flag is in 'guioptions'. It suggests using ":browse" and ":confirm" for menu items that require mouse usage or handling unsaved changes. It mentions using confirm() and inputdialog() functions for complex items.