gui.txt 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. *gui.txt* Nvim
  2. VIM REFERENCE MANUAL by Bram Moolenaar
  3. Nvim Graphical User Interface *gui* *GUI*
  4. Type |gO| to see the table of contents.
  5. ==============================================================================
  6. Starting the GUI *gui-start* *E229* *E233*
  7. *ginit.vim* *gui-init* *gvimrc* *$MYGVIMRC*
  8. For GUI-specific configuration Nvim provides the |UIEnter| event. This
  9. happens after other |initialization|s, like reading your vimrc file.
  10. Example: this sets "g:gui" to the value of the UI's "rgb" field: >
  11. :autocmd UIEnter * let g:gui = filter(nvim_list_uis(),{k,v-> v.chan==v:event.chan})[0].rgb
  12. <
  13. *:winp* *:winpos* *E188*
  14. :winp[os]
  15. Display current position of the top left corner of the GUI vim
  16. window in pixels. Does not work in all versions.
  17. Also see |getwinpos()|, |getwinposx()| and |getwinposy()|.
  18. :winp[os] {X} {Y} *E466*
  19. Put the GUI vim window at the given {X} and {Y} coordinates.
  20. The coordinates should specify the position in pixels of the
  21. top left corner of the window.
  22. When the GUI window has not been opened yet, the values are
  23. remembered until the window is opened. The position is
  24. adjusted to make the window fit on the screen (if possible).
  25. *:win* *:winsize* *E465*
  26. :win[size] {width} {height}
  27. Set the window height to {width} by {height} characters.
  28. Obsolete, use ":set lines=11 columns=22".
  29. ==============================================================================
  30. Scrollbars *gui-scrollbars*
  31. There are vertical scrollbars and a horizontal scrollbar. You may
  32. configure which ones appear with the 'guioptions' option.
  33. The interface looks like this (with ":set guioptions=mlrb"):
  34. +------------------------------+ `
  35. | File Edit Help | <- Menu bar (m) `
  36. +-+--------------------------+-+ `
  37. |^| |^| `
  38. |#| Text area. |#| `
  39. | | | | `
  40. |v|__________________________|v| `
  41. Normal status line -> |-+ File.c 5,2 +-| `
  42. between Vim windows |^|""""""""""""""""""""""""""|^| `
  43. | | | | `
  44. | | Another file buffer. | | `
  45. | | | | `
  46. |#| |#| `
  47. Left scrollbar (l) -> |#| |#| <- Right `
  48. |#| |#| scrollbar (r) `
  49. | | | | `
  50. |v| |v| `
  51. +-+--------------------------+-+ `
  52. | |< #### >| | <- Bottom `
  53. +-+--------------------------+-+ scrollbar (b) `
  54. Any of the scrollbar or menu components may be turned off by not putting the
  55. appropriate letter in the 'guioptions' string. The bottom scrollbar is
  56. only useful when 'nowrap' is set.
  57. VERTICAL SCROLLBARS *gui-vert-scroll*
  58. Each Vim window has a scrollbar next to it which may be scrolled up and down
  59. to move through the text in that buffer. The size of the scrollbar-thumb
  60. indicates the fraction of the buffer which can be seen in the window.
  61. When the scrollbar is dragged all the way down, the last line of the file
  62. will appear in the top of the window.
  63. If a window is shrunk to zero height (by the growth of another window) its
  64. scrollbar disappears. It reappears when the window is restored.
  65. If a window is vertically split, it will get a scrollbar when it is the
  66. current window and when, taking the middle of the current window and drawing a
  67. vertical line, this line goes through the window.
  68. When there are scrollbars on both sides, and the middle of the current window
  69. is on the left half, the right scrollbar column will contain scrollbars for
  70. the rightmost windows. The same happens on the other side.
  71. HORIZONTAL SCROLLBARS *gui-horiz-scroll*
  72. The horizontal scrollbar (at the bottom of the Vim GUI) may be used to
  73. scroll text sideways when the 'wrap' option is turned off. The
  74. scrollbar-thumb size is such that the text of the longest visible line may be
  75. scrolled as far as possible left and right. The cursor is moved when
  76. necessary, it must remain on a visible character (unless 'virtualedit' is
  77. set).
  78. Computing the length of the longest visible line takes quite a bit of
  79. computation, and it has to be done every time something changes. If this
  80. takes too much time or you don't like the cursor jumping to another line,
  81. include the 'h' flag in 'guioptions'. Then the scrolling is limited by the
  82. text of the current cursor line.
  83. ==============================================================================
  84. Drag and drop *drag-n-drop*
  85. You can drag and drop one or more files into the Vim window, where they will
  86. be opened as if a |:drop| command was used.
  87. If you hold down Shift while doing this, Vim changes to the first dropped
  88. file's directory. If you hold Ctrl Vim will always split a new window for the
  89. file. Otherwise it's only done if the current buffer has been changed.
  90. You can also drop a directory on Vim. This starts the explorer plugin for
  91. that directory (assuming it was enabled, otherwise you'll get an error
  92. message). Keep Shift pressed to change to the directory instead.
  93. If Vim happens to be editing a command line, the names of the dropped files
  94. and directories will be inserted at the cursor. This allows you to use these
  95. names with any Ex command. Special characters (space, tab, double quote and
  96. '|'; backslash on non-MS-Windows systems) will be escaped.
  97. ==============================================================================
  98. Menus *menus*
  99. For an introduction see |usr_42.txt| in the user manual.
  100. Using Menus *using-menus*
  101. Basically, menus can be used just like mappings. You can define your own
  102. menus, as many as you like.
  103. Long-time Vim users won't use menus much. But the power is in adding your own
  104. menus and menu items. They are most useful for things that you can't remember
  105. what the key sequence was.
  106. For creating menus in a different language, see |:menutrans|.
  107. If you don't want to use menus at all, see |'go-M'|.
  108. *menu.vim*
  109. The default menus are read from the file "$VIMRUNTIME/menu.vim". See
  110. |$VIMRUNTIME| for where the path comes from. You can set up your own menus.
  111. Starting off with the default set is a good idea. You can add more items, or,
  112. if you don't like the defaults at all, start with removing all menus
  113. |:unmenu-all|. You can also avoid the default menus being loaded by adding
  114. this line to your vimrc file (NOT your gvimrc file!): >
  115. :let did_install_default_menus = 1
  116. If you also want to avoid the Syntax menu: >
  117. :let did_install_syntax_menu = 1
  118. The first item in the Syntax menu can be used to show all available filetypes
  119. in the menu (which can take a bit of time to load). If you want to have all
  120. filetypes already present at startup, add: >
  121. :let do_syntax_sel_menu = 1
  122. Note that the menu.vim is sourced when `:syntax on` or `:filetype on` is
  123. executed or after your .vimrc file is sourced. This means that the 'encoding'
  124. option and the language of messages (`:language messages`) must be set before
  125. that (if you want to change them).
  126. *console-menus*
  127. Although this documentation is in the GUI section, you can actually use menus
  128. in console mode too. You will have to load |menu.vim| explicitly then, it is
  129. not done by default. You can use the |:emenu| command and command-line
  130. completion with 'wildmenu' to access the menu entries almost like a real menu
  131. system. To do this, put these commands in your vimrc file: >
  132. :source $VIMRUNTIME/menu.vim
  133. :set wildmenu
  134. :set cpo-=<
  135. :set wcm=<C-Z>
  136. :map <F4> :emenu <C-Z>
  137. Pressing <F4> will start the menu. You can now use the cursor keys to select
  138. a menu entry. Hit <Enter> to execute it. Hit <Esc> if you want to cancel.
  139. This does require the |+menu| feature enabled at compile time.
  140. Creating New Menus *creating-menus*
  141. *:me* *:menu* *:noreme* *:noremenu*
  142. *:am* *:amenu* *:an* *:anoremenu*
  143. *:nme* *:nmenu* *:nnoreme* *:nnoremenu*
  144. *:ome* *:omenu* *:onoreme* *:onoremenu*
  145. *:vme* *:vmenu* *:vnoreme* *:vnoremenu*
  146. *:xme* *:xmenu* *:xnoreme* *:xnoremenu*
  147. *:sme* *:smenu* *:snoreme* *:snoremenu*
  148. *:ime* *:imenu* *:inoreme* *:inoremenu*
  149. *:cme* *:cmenu* *:cnoreme* *:cnoremenu*
  150. *E330* *E327* *E331* *E336* *E333*
  151. *E328* *E329* *E337* *E792*
  152. To create a new menu item, use the ":menu" commands. They are mostly like
  153. the ":map" set of commands but the first argument is a menu item name, given
  154. as a path of menus and submenus with a '.' between them, e.g.: >
  155. :menu File.Save :w<CR>
  156. :inoremenu File.Save <C-O>:w<CR>
  157. :menu Edit.Big\ Changes.Delete\ All\ Spaces :%s/[ ^I]//g<CR>
  158. This last one will create a new item in the menu bar called "Edit", holding
  159. the mouse button down on this will pop up a menu containing the item
  160. "Big Changes", which is a sub-menu containing the item "Delete All Spaces",
  161. which when selected, performs the operation.
  162. Special characters in a menu name:
  163. & The next character is the shortcut key. Make sure each
  164. shortcut key is only used once in a (sub)menu. If you want to
  165. insert a literal "&" in the menu name use "&&".
  166. <Tab> Separates the menu name from right-aligned text. This can be
  167. used to show the equivalent typed command. The text "<Tab>"
  168. can be used here for convenience. If you are using a real
  169. tab, don't forget to put a backslash before it!
  170. Example: >
  171. :amenu &File.&Open<Tab>:e :browse e<CR>
  172. [typed literally]
  173. With the shortcut "F" (while keeping the <Alt> key pressed), and then "O",
  174. this menu can be used. The second part is shown as "Open :e". The ":e"
  175. is right aligned, and the "O" is underlined, to indicate it is the shortcut.
  176. The ":amenu" command can be used to define menu entries for all modes at once.
  177. To make the command work correctly, a character is automatically inserted for
  178. some modes:
  179. mode inserted appended ~
  180. Normal nothing nothing
  181. Visual <C-C> <C-\><C-G>
  182. Insert <C-\><C-O>
  183. Cmdline <C-C> <C-\><C-G>
  184. Op-pending <C-C> <C-\><C-G>
  185. Appending CTRL-\ CTRL-G is for going back to insert mode when 'insertmode' is
  186. set. |CTRL-\_CTRL-G|
  187. Example: >
  188. :amenu File.Next :next^M
  189. is equal to: >
  190. :nmenu File.Next :next^M
  191. :vmenu File.Next ^C:next^M^\^G
  192. :imenu File.Next ^\^O:next^M
  193. :cmenu File.Next ^C:next^M^\^G
  194. :omenu File.Next ^C:next^M^\^G
  195. Careful: In Insert mode this only works for a SINGLE Normal mode command,
  196. because of the CTRL-O. If you have two or more commands, you will need to use
  197. the ":imenu" command. For inserting text in any mode, you can use the
  198. expression register: >
  199. :amenu Insert.foobar "='foobar'<CR>P
  200. Note that <Esc> in Cmdline mode executes the command, like in a mapping. This
  201. is Vi compatible. Use CTRL-C to quit Cmdline mode.
  202. *:menu-<silent>* *:menu-silent*
  203. To define a menu which will not be echoed on the command line, add
  204. "<silent>" as the first argument. Example: >
  205. :menu <silent> Settings.Ignore\ case :set ic<CR>
  206. The ":set ic" will not be echoed when using this menu. Messages from the
  207. executed command are still given though. To shut them up too, add a ":silent"
  208. in the executed command: >
  209. :menu <silent> Search.Header :exe ":silent normal /Header\r"<CR>
  210. "<silent>" may also appear just after "<script>".
  211. *:menu-<script>* *:menu-script*
  212. The "to" part of the menu will be inspected for mappings. If you don't want
  213. this, use the ":noremenu" command (or the similar one for a specific mode).
  214. If you do want to use script-local mappings, add "<script>" as the very first
  215. argument to the ":menu" command or just after "<silent>".
  216. *menu-priority*
  217. You can give a priority to a menu. Menus with a higher priority go more to
  218. the right. The priority is given as a number before the ":menu" command.
  219. Example: >
  220. :80menu Buffer.next :bn<CR>
  221. The default menus have these priorities:
  222. File 10
  223. Edit 20
  224. Tools 40
  225. Syntax 50
  226. Buffers 60
  227. Window 70
  228. Help 9999
  229. When no or zero priority is given, 500 is used.
  230. The priority for the PopUp menu is not used.
  231. You can use a priority higher than 9999, to make it go after the Help menu,
  232. but that is non-standard and is discouraged. The highest possible priority is
  233. about 32000. The lowest is 1.
  234. *sub-menu-priority*
  235. The same mechanism can be used to position a sub-menu. The priority is then
  236. given as a dot-separated list of priorities, before the menu name: >
  237. :menu 80.500 Buffer.next :bn<CR>
  238. Giving the sub-menu priority is only needed when the item is not to be put
  239. in a normal position. For example, to put a sub-menu before the other items: >
  240. :menu 80.100 Buffer.first :brew<CR>
  241. Or to put a sub-menu after the other items, and further items with default
  242. priority will be put before it: >
  243. :menu 80.900 Buffer.last :blast<CR>
  244. When a number is missing, the default value 500 will be used: >
  245. :menu .900 myMenu.test :echo "text"<CR>
  246. The menu priority is only used when creating a new menu. When it already
  247. existed, e.g., in another mode, the priority will not change. Thus, the
  248. priority only needs to be given the first time a menu is used.
  249. An exception is the PopUp menu. There is a separate menu for each mode
  250. (Normal, Op-pending, Visual, Insert, Cmdline). The order in each of these
  251. menus can be different. This is different from menu-bar menus, which have
  252. the same order for all modes.
  253. NOTE: sub-menu priorities currently don't work for all versions of the GUI.
  254. *menu-separator* *E332*
  255. Menu items can be separated by a special item that inserts some space between
  256. items. Depending on the system this is displayed as a line or a dotted line.
  257. These items must start with a '-' and end in a '-'. The part in between is
  258. used to give it a unique name. Priorities can be used as with normal items.
  259. Example: >
  260. :menu Example.item1 :do something
  261. :menu Example.-Sep- :
  262. :menu Example.item2 :do something different
  263. Note that the separator also requires a rhs. It doesn't matter what it is,
  264. because the item will never be selected. Use a single colon to keep it
  265. simple.
  266. *gui-toolbar*
  267. The default toolbar is setup in menu.vim. The display of the toolbar is
  268. controlled by the 'guioptions' letter 'T'. You can thus have menu & toolbar
  269. together, or either on its own, or neither. The appearance is controlled by
  270. the 'toolbar' option. You can choose between an image, text or both.
  271. *toolbar-icon*
  272. The toolbar is defined as a special menu called ToolBar, which only has one
  273. level. Vim interprets the items in this menu as follows:
  274. 1) If an "icon=" argument was specified, the file with this name is used.
  275. The file can either be specified with the full path or with the base name.
  276. In the last case it is searched for in the "bitmaps" directory in
  277. 'runtimepath', like in point 3. Examples: >
  278. :amenu icon=/usr/local/pixmaps/foo_icon.xpm ToolBar.Foo :echo "Foo"<CR>
  279. :amenu icon=FooIcon ToolBar.Foo :echo "Foo"<CR>
  280. < Note that in the first case the extension is included, while in the second
  281. case it is omitted.
  282. If the file cannot be opened the next points are tried.
  283. A space in the file name must be escaped with a backslash.
  284. A menu priority must come _after_ the icon argument: >
  285. :amenu icon=foo 1.42 ToolBar.Foo :echo "42!"<CR>
  286. 2) An item called 'BuiltIn##', where ## is a number, is taken as number ## of
  287. the built-in bitmaps available in Vim. Currently there are 31 numbered
  288. from 0 to 30 which cover most common editing operations |builtin-tools|. >
  289. :amenu ToolBar.BuiltIn22 :call SearchNext("back")<CR>
  290. 3) An item with another name is first searched for in the directory
  291. "bitmaps" in 'runtimepath'. If found, the bitmap file is used as the
  292. toolbar button image. Note that the exact filename is OS-specific: For
  293. example, under Win32 the command >
  294. :amenu ToolBar.Hello :echo "hello"<CR>
  295. < would find the file 'hello.bmp'. Under X11 it is 'Hello.xpm'.
  296. For MS-Windows and the bitmap is scaled to fit the button. For
  297. MS-Windows a size of 18 by 18 pixels works best.
  298. For MS-Windows the bitmap should have 16 colors with the standard palette.
  299. The light grey pixels will be changed to the Window frame color and the
  300. dark grey pixels to the window shadow color. More colors might also work,
  301. depending on your system.
  302. 4) If the bitmap is still not found, Vim checks for a match against its list
  303. of built-in names. Each built-in button image has a name.
  304. So the command >
  305. :amenu ToolBar.Open :e
  306. < will show the built-in "open a file" button image if no open.bmp exists.
  307. All the built-in names can be seen used in menu.vim.
  308. 5) If all else fails, a blank, but functioning, button is displayed.
  309. *builtin-tools*
  310. nr Name Normal action ~
  311. 00 New open new window
  312. 01 Open browse for file to open in current window
  313. 02 Save write buffer to file
  314. 03 Undo undo last change
  315. 04 Redo redo last undone change
  316. 05 Cut delete selected text to clipboard
  317. 06 Copy copy selected text to clipboard
  318. 07 Paste paste text from clipboard
  319. 08 Print print current buffer
  320. 09 Help open a buffer on Vim's builtin help
  321. 10 Find start a search command
  322. 11 SaveAll write all modified buffers to file
  323. 12 SaveSesn write session file for current situation
  324. 13 NewSesn write new session file
  325. 14 LoadSesn load session file
  326. 15 RunScript browse for file to run as a Vim script
  327. 16 Replace prompt for substitute command
  328. 17 WinClose close current window
  329. 18 WinMax make current window use many lines
  330. 19 WinMin make current window use few lines
  331. 20 WinSplit split current window
  332. 21 Shell start a shell
  333. 22 FindPrev search again, backward
  334. 23 FindNext search again, forward
  335. 24 FindHelp prompt for word to search help for
  336. 25 Make run make and jump to first error
  337. 26 TagJump jump to tag under the cursor
  338. 27 RunCtags build tags for files in current directory
  339. 28 WinVSplit split current window vertically
  340. 29 WinMaxWidth make current window use many columns
  341. 30 WinMinWidth make current window use few columns
  342. *hidden-menus* *win32-hidden-menus*
  343. In the Win32 GUI, starting a menu name with ']' excludes that menu from the
  344. main menu bar. You must then use the |:popup| command to display it.
  345. When splitting the window the window toolbar is not copied to the new window.
  346. *popup-menu*
  347. You can define the special menu "PopUp". This is the menu that is displayed
  348. when the right mouse button is pressed, if 'mousemodel' is set to popup or
  349. popup_setpos.
  350. Showing What Menus Are Mapped To *showing-menus*
  351. To see what an existing menu is mapped to, use just one argument after the
  352. menu commands (just like you would with the ":map" commands). If the menu
  353. specified is a submenu, then all menus under that hierarchy will be shown.
  354. If no argument is given after :menu at all, then ALL menu items are shown
  355. for the appropriate mode (e.g., Command-line mode for :cmenu).
  356. Special characters in the list, just before the rhs:
  357. * The menu was defined with "nore" to disallow remapping.
  358. & The menu was defined with "<script>" to allow remapping script-local
  359. mappings only.
  360. - The menu was disabled.
  361. Note that hitting <Tab> while entering a menu name after a menu command may
  362. be used to complete the name of the menu item.
  363. Executing Menus *execute-menus*
  364. *:em* *:emenu* *E334* *E335*
  365. :[range]em[enu] {menu} Execute {menu} from the command line.
  366. The default is to execute the Normal mode
  367. menu. If a range is specified, it executes
  368. the Visual mode menu.
  369. If used from <c-o>, it executes the
  370. insert-mode menu Eg: >
  371. :emenu File.Exit
  372. If the console-mode vim has been compiled with WANT_MENU defined, you can
  373. use :emenu to access useful menu items you may have got used to from GUI
  374. mode. See 'wildmenu' for an option that works well with this. See
  375. |console-menus| for an example.
  376. When using a range, if the lines match with '<,'>, then the menu is executed
  377. using the last visual selection.
  378. Deleting Menus *delete-menus*
  379. *:unme* *:unmenu*
  380. *:aun* *:aunmenu*
  381. *:nunme* *:nunmenu*
  382. *:ounme* *:ounmenu*
  383. *:vunme* *:vunmenu*
  384. *:xunme* *:xunmenu*
  385. *:sunme* *:sunmenu*
  386. *:iunme* *:iunmenu*
  387. *:cunme* *:cunmenu*
  388. To delete a menu item or a whole submenu, use the unmenu commands, which are
  389. analogous to the unmap commands. Eg: >
  390. :unmenu! Edit.Paste
  391. This will remove the Paste item from the Edit menu for Insert and
  392. Command-line modes.
  393. Note that hitting <Tab> while entering a menu name after an umenu command
  394. may be used to complete the name of the menu item for the appropriate mode.
  395. To remove all menus use: *:unmenu-all* >
  396. :unmenu * " remove all menus in Normal and visual mode
  397. :unmenu! * " remove all menus in Insert and Command-line mode
  398. :aunmenu * " remove all menus in all modes
  399. If you want to get rid of the menu bar: >
  400. :set guioptions-=m
  401. Disabling Menus *disable-menus*
  402. *:menu-disable* *:menu-enable*
  403. If you do not want to remove a menu, but disable it for a moment, this can be
  404. done by adding the "enable" or "disable" keyword to a ":menu" command.
  405. Examples: >
  406. :menu disable &File.&Open\.\.\.
  407. :amenu enable *
  408. :amenu disable &Tools.*
  409. The command applies to the modes as used with all menu commands. Note that
  410. characters like "&" need to be included for translated names to be found.
  411. When the argument is "*", all menus are affected. Otherwise the given menu
  412. name and all existing submenus below it are affected.
  413. Examples for Menus *menu-examples*
  414. Here is an example on how to add menu items with menu's! You can add a menu
  415. item for the keyword under the cursor. The register "z" is used. >
  416. :nmenu Words.Add\ Var wb"zye:menu! Words.<C-R>z <C-R>z<CR>
  417. :nmenu Words.Remove\ Var wb"zye:unmenu! Words.<C-R>z<CR>
  418. :vmenu Words.Add\ Var "zy:menu! Words.<C-R>z <C-R>z <CR>
  419. :vmenu Words.Remove\ Var "zy:unmenu! Words.<C-R>z<CR>
  420. :imenu Words.Add\ Var <Esc>wb"zye:menu! Words.<C-R>z <C-R>z<CR>a
  421. :imenu Words.Remove\ Var <Esc>wb"zye:unmenu! Words.<C-R>z<CR>a
  422. (the rhs is in <> notation, you can copy/paste this text to try out the
  423. mappings, or put these lines in your gvimrc; "<C-R>" is CTRL-R, "<CR>" is
  424. the <CR> key. |<>|)
  425. Tooltips & Menu tips
  426. See section |42.4| in the user manual.
  427. *:tmenu*
  428. :tm[enu] {menupath} {rhs} Define a tip for a menu or tool. {only in
  429. X11 and Win32 GUI}
  430. :tm[enu] [menupath] List menu tips. {only in X11 and Win32 GUI}
  431. *:tunmenu*
  432. :tu[nmenu] {menupath} Remove a tip for a menu or tool.
  433. {only in X11 and Win32 GUI}
  434. When a tip is defined for a menu item, it appears in the command-line area
  435. when the mouse is over that item, much like a standard Windows menu hint in
  436. the status bar. (Except when Vim is in Command-line mode, when of course
  437. nothing is displayed.)
  438. When a tip is defined for a ToolBar item, it appears as a tooltip when the
  439. mouse pauses over that button, in the usual fashion. Use the |hl-Tooltip|
  440. highlight group to change its colors.
  441. A "tip" can be defined for each menu item. For example, when defining a menu
  442. item like this: >
  443. :amenu MyMenu.Hello :echo "Hello"<CR>
  444. The tip is defined like this: >
  445. :tmenu MyMenu.Hello Displays a greeting.
  446. And delete it with: >
  447. :tunmenu MyMenu.Hello
  448. Tooltips are currently only supported for the X11 and Win32 GUI. However, they
  449. should appear for the other gui platforms in the not too distant future.
  450. The ":tmenu" command works just like other menu commands, it uses the same
  451. arguments. ":tunmenu" deletes an existing menu tip, in the same way as the
  452. other unmenu commands.
  453. If a menu item becomes invalid (i.e. its actions in all modes are deleted) Vim
  454. deletes the menu tip (and the item) for you. This means that :aunmenu deletes
  455. a menu item - you don't need to do a :tunmenu as well.
  456. 5.9 Popup Menus
  457. In the Win32 GUI, you can cause a menu to popup at the cursor. This behaves
  458. similarly to the PopUp menus except that any menu tree can be popped up.
  459. This command is for backwards compatibility, using it is discouraged, because
  460. it behaves in a strange way.
  461. *:popup* *:popu*
  462. :popu[p] {name} Popup the menu {name}. The menu named must
  463. have at least one subentry, but need not
  464. appear on the menu-bar (see |hidden-menus|).
  465. {only available for Win32 GUI}
  466. :popu[p]! {name} Like above, but use the position of the mouse
  467. pointer instead of the cursor.
  468. Example: >
  469. :popup File
  470. will make the "File" menu (if there is one) appear at the text cursor (mouse
  471. pointer if ! was used). >
  472. :amenu ]Toolbar.Make :make<CR>
  473. :popup ]Toolbar
  474. This creates a popup menu that doesn't exist on the main menu-bar.
  475. Note that a menu that starts with ']' will not be displayed.
  476. vim:tw=78:sw=4:ts=8:noet:ft=help:norl: