Home Explore Blog CI



neovim

14th chunk of `runtime/doc/gui.txt`
0597bb052e25271b369582b29987bb95516577fe4b8569930000000100000925
   :unmenu! *      " remove all menus in Insert and Command-line mode
        :aunmenu *      " remove all menus in all modes, except for Terminal
                        " mode
        :tlunmenu *     " remove all menus in Terminal mode

If you want to get rid of the menu bar: >
        :set guioptions-=m


Disabling Menus                                         *disable-menus*

                                                *:menu-disable* *:menu-enable*
If you do not want to remove a menu, but disable it for a moment, this can be
done by adding the "enable" or "disable" keyword to a ":menu" command.
Examples: >
        :menu disable &File.&Open\.\.\.
        :amenu enable *
        :amenu disable &Tools.*

The command applies to the modes as used with all menu commands.  Note that
characters like "&" need to be included for translated names to be found.
When the argument is "*", all menus are affected.  Otherwise the given menu
name and all existing submenus below it are affected.


Examples for Menus                                      *menu-examples*

Here is an example on how to add menu items with menus!  You can add a menu
item for the keyword under the cursor.  The register "z" is used. >

  :nmenu Words.Add\ Var         wb"zye:menu! Words.<C-R>z <C-R>z<CR>
  :nmenu Words.Remove\ Var      wb"zye:unmenu! Words.<C-R>z<CR>
  :vmenu Words.Add\ Var         "zy:menu! Words.<C-R>z <C-R>z <CR>
  :vmenu Words.Remove\ Var      "zy:unmenu! Words.<C-R>z<CR>
  :imenu Words.Add\ Var         <Esc>wb"zye:menu! Words.<C-R>z <C-R>z<CR>a
  :imenu Words.Remove\ Var      <Esc>wb"zye:unmenu! Words.<C-R>z<CR>a

(the rhs is in <> notation, you can copy/paste this text to try out the
mappings, or put these lines in your gvimrc; "<C-R>" is CTRL-R, "<CR>" is
the <CR> key.  |<>|)

                                                        *tooltips* *menu-tips*
Tooltips & Menu tips

See section |42.4| in the user manual.

                                                        *:tmenu*
:tm[enu] {menupath} {rhs}       Define a tip for a menu or tool.  (only in
                                X11 and Win32 GUI)

:tm[enu] [menupath]             List menu tips. (only in X11 and Win32 GUI)

                                                        *:tunmenu*
:tu[nmenu] {menupath}           Remove a tip for a menu or tool.
    

Title: Vim Menu Disabling, Examples, and Tooltips
Summary
This section details how to remove menus from specific modes and how to disable menus temporarily using the `:menu` command with the `enable` or `disable` keyword. It provides examples of adding and removing menu items for keywords under the cursor, including variations for Normal, Visual, and Insert modes. Additionally, it covers how to define, list, and remove tooltips for menus, which are available in the X11 and Win32 GUI environments.