1
- *gui.txt* For Vim version 8.0 . Last change: 2014 Mar 08
1
+ *gui.txt* For Vim version 8.1 . Last change: 2018 Mar 06
2
2
3
3
4
4
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -67,7 +67,7 @@ When the GUI starts up initializations are carried out, in this order:
67
67
executed as an Ex command.
68
68
- If the user gvimrc file exists, it is sourced. The name of this file is
69
69
normally "$HOME/.gvimrc". You can check this with ":version".
70
- - For Win32, when $HOME is not set, "$VIM\_gvimrc" is used .
70
+ - For Win32, $HOME is set by Vim if needed, see | $HOME-windows | .
71
71
- When a "_gvimrc" file is not found, ".gvimrc" is tried too. And vice
72
72
versa.
73
73
The name of the first file found is stored in $MYGVIMRC, unless it was
@@ -79,7 +79,8 @@ When the GUI starts up initializations are carried out, in this order:
79
79
and DOS/Win32 "_gvimrc" is tried first.
80
80
81
81
NOTE: All but the first one are not carried out if Vim was started with
82
- "-u NONE" and no "-U" argument was given, or when started with "-U NONE".
82
+ "-u NONE" or "-u DEFAULTS" and no "-U" argument was given, or when started
83
+ with "-U NONE".
83
84
84
85
All this happens AFTER the normal Vim initializations, like reading your
85
86
.vimrc file. See | initialization | .
@@ -133,7 +134,7 @@ task bar with the 'guiheadroom' option.
133
134
:winp[os]
134
135
Display current position of the top left corner of the GUI vim
135
136
window in pixels. Does not work in all versions.
136
- Also see | getwinposx() | and | getwinposy() | .
137
+ Also see | getwinpos() | , | getwinposx() | and | getwinposy() | .
137
138
138
139
:winp[os] {X} {Y} *E466*
139
140
Put the GUI vim window at the given {X} and {Y} coordinates.
@@ -161,7 +162,7 @@ window Vim is running in with these commands: >
161
162
*gui-IME* *iBus*
162
163
Input methods for international characters in X that rely on the XIM
163
164
framework, most notably iBus, have been known to produce undesirable results
164
- in gVim . These may include an inability to enter spaces, or long delays
165
+ in gvim . These may include an inability to enter spaces, or long delays
165
166
between typing a character and it being recognized by the application.
166
167
167
168
One workaround that has been successful, for unknown reasons, is to prevent
@@ -481,6 +482,7 @@ menus and menu items. They are most useful for things that you can't remember
481
482
what the key sequence was.
482
483
483
484
For creating menus in a different language, see | :menutrans | .
485
+ If you don't want to use menus at all, see | 'go-M' | .
484
486
485
487
*menu.vim*
486
488
The default menus are read from the file "$VIMRUNTIME/menu.vim". See
@@ -497,7 +499,22 @@ in the menu (which can take a bit of time to load). If you want to have all
497
499
filetypes already present at startup, add: >
498
500
:let do_syntax_sel_menu = 1
499
501
500
- <
502
+ The following menuitems show all available color schemes, keymaps and compiler
503
+ settings:
504
+ Edit > Color Scheme ~
505
+ Edit > Keymap ~
506
+ Tools > Set Compiler ~
507
+ However, they can also take a bit of time to load, because they search all
508
+ related files from the directories in 'runtimepath' . Therefore they are
509
+ loaded lazily (by the | CursorHold | event), or you can also load them manually.
510
+ If you want to have all these items already present at startup, add: >
511
+ :let do_no_lazyload_menus = 1
512
+
513
+ Note that the menu.vim is sourced when `:syntax on` or `:filetype on` is
514
+ executed or after your .vimrc file is sourced. This means that the 'encoding'
515
+ option and the language of messages (`:language messages`) must be set before
516
+ that (if you want to change them).
517
+
501
518
*console-menus*
502
519
Although this documentation is in the GUI section, you can actually use menus
503
520
in console mode too. You will have to load | menu.vim | explicitly then, it is
@@ -783,10 +800,40 @@ In the Win32 and GTK+ GUI, starting a menu name with ']' excludes that menu
783
800
from the main menu bar. You must then use the | :popup | or | :tearoff | command
784
801
to display it.
785
802
803
+ *window-toolbar* *WinBar*
804
+ Each window can have a local toolbar. This uses the first line of the window,
805
+ thus reduces the space for the text by one line. The items in the toolbar
806
+ must start with "WinBar".
807
+
808
+ Only text can be used. When using Unicode, special characters can be used to
809
+ make the items look like icons.
810
+
811
+ If the items do not fit then the last ones cannot be used. The toolbar does
812
+ not wrap.
813
+
814
+ Note that Vim may be in any mode when executing these commands. The menu
815
+ should be defined for Normal mode and will be executed without changing the
816
+ current mode. Thus if the current window is in Visual mode and the menu
817
+ command does not intentionally change the mode, Vim will remain in Visual
818
+ mode. Best is to use `:nnoremenu ` to avoid side effects.
819
+
820
+ Example for debugger tools: >
821
+ nnoremenu 1.10 WinBar.Step :Step<CR>
822
+ nnoremenu 1.20 WinBar.Next :Next<CR>
823
+ nnoremenu 1.30 WinBar.Finish :Finish<CR>
824
+ nnoremenu 1.40 WinBar.Cont :Continue<CR>
825
+ <
826
+ The window toolbar uses the ToolbarLine and ToolbarButton highlight groups.
827
+
828
+ When splitting the window the window toolbar is not copied to the new window.
829
+
786
830
*popup-menu*
787
831
In the Win32, GTK+, Motif, Athena and Photon GUI, you can define the
788
832
special menu "PopUp". This is the menu that is displayed when the right mouse
789
833
button is pressed, if 'mousemodel' is set to popup or popup_setpos.
834
+ Example: >
835
+ nnoremenu 1.40 PopUp.&Paste "+gP
836
+ menu PopUp
790
837
791
838
792
839
5.3 Showing What Menus Are Mapped To *showing-menus*
@@ -945,10 +992,14 @@ it behaves in a strange way.
945
992
:popu[p] {name} Popup the menu {name} . The menu named must
946
993
have at least one subentry, but need not
947
994
appear on the menu-bar (see | hidden-menus | ).
948
- {only available for Win32 and GTK GUI}
995
+ {only available for Win32 and GTK GUI or in
996
+ the terminal when compiled with +insert_expand}
949
997
950
998
:popu[p]! {name} Like above, but use the position of the mouse
951
999
pointer instead of the cursor.
1000
+ In the terminal this is the last known
1001
+ position, which is usually at the last click
1002
+ or release (mouse movement is irrelevant).
952
1003
953
1004
Example: >
954
1005
:popup File
@@ -959,6 +1010,10 @@ pointer if ! was used). >
959
1010
:popup ]Toolbar
960
1011
This creates a popup menu that doesn't exist on the main menu-bar.
961
1012
1013
+ Note that in the GUI the :popup command will return immediately, before a
1014
+ selection has been made. In the terminal the commands waits for the user to
1015
+ make a selection.
1016
+
962
1017
Note that a menu that starts with ']' will not be displayed.
963
1018
964
1019
==============================================================================
0 commit comments