annotate runtime/doc/gui_w32.txt @ 6145:2fd550c75256 v7.4.410

updated for version 7.4.410 Problem: Fold does not open after search when there is a CmdwinLeave autocommand. Solution: Restore KeyTyped. (Jacob Niehus)
author Bram Moolenaar <bram@vim.org>
date Sun, 17 Aug 2014 17:24:07 +0200
parents 359743c1f59a
children 11d78e58a487
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5294
359743c1f59a release version 7.4
Bram Moolenaar <bram@vim.org>
parents: 5247
diff changeset
1 *gui_w32.txt* For Vim version 7.4. Last change: 2012 Aug 04
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 VIM REFERENCE MANUAL by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 Vim's Win32 Graphical User Interface *gui-w32* *win32-gui*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 1. Starting the GUI |gui-w32-start|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 2. Vim as default editor |vim-default-editor|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 3. Using the clipboard |gui-clipboard|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 4. Shell Commands |gui-shell-win32|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 5. Special colors |win32-colors|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 6. Windows dialogs & browsers |gui-w32-dialogs|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 7. Command line arguments |gui-w32-cmdargs|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 8. Various |gui-w32-various|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 Other relevant documentation:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 |gui.txt| For generic items of the GUI.
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3750
diff changeset
20 |os_win32.txt| For Win32 specific items.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 {Vi does not have a Windows GUI}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 1. Starting the GUI *gui-w32-start*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 The Win32 GUI version of Vim will always start the GUI, no matter how you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 start it or what it's called.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 The GUI will always run in the Windows subsystem. Mostly shells automatically
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 return with a command prompt after starting gvim. If not, you should use the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 "start" command: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 start gvim [options] file ..
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 Note: All fonts (bold, italic) must be of the same size!!! If you don't do
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 this, text will disappear or mess up the display. Vim does not check the font
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 sizes. It's the size in screen pixels that must be the same. Note that some
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 fonts that have the same point size don't have the same pixel size!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 Additionally, the positioning of the fonts must be the same (ascent and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 descent).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 The Win32 GUI has an extra menu item: "Edit/Select Font". It brings up the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 standard Windows font selector.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 Setting the menu height doesn't work for the Win32 GUI.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 *gui-win32-maximized*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 If you want Vim to start with a maximized window, add this command to your
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 vimrc or gvimrc file: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 au GUIEnter * simalt ~x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 <
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 *gui-w32s*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 There is a specific version of gvim.exe that runs under the Win32s subsystem
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 of Windows 3.1 or 3.11. See |win32s|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
1376
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
56
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
57 Using Vim as a plugin *gui-w32-windowid*
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
58
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
59 When gvim starts up normally, it creates its own top level window. If you
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
60 pass Vim the command-line option |--windowid| with a decimal or hexadecimal
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
61 value, Vim will create a window that is a child of the window with the given
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
62 ID. This enables Vim to act as a plugin in another application. This really
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
63 is a programmer's interface, and is of no use without a supporting application
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
64 to spawn Vim correctly.
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
65
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 2. Vim as default editor *vim-default-editor*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 To set Vim as the default editor for a file type:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 1. Start a Windows Explorer
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
71 2. Choose View/Options -> File Types
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 3. Select the path to gvim for every file type that you want to use it for.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 (you can also use three spaces in the file type field, for files without an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 extension).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 In the "open" action, use: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 gvim "%1"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 < The quotes are required for using file names with embedded spaces.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 You can also use this: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 gvim "%L"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 < This should avoid short (8.3 character) file names in some situations. But
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 I'm not sure if this works everywhere.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 When you open a file in Vim by double clicking it, Vim changes to that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 file's directory.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 If you want Vim to start full-screen, use this for the Open action: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 gvim -c "simalt ~x" "%1"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 Another method, which also works when you put Vim in another directory (e.g.,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 when you have got a new version):
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 1. select a file you want to use Vim with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 2. <Shift-F10>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 3. select "Open With..." menu entry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 4. click "Other..."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 5. browse to the (new) location of Vim and click "Open"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 6. make "Always Use this program..." checked
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 7. <OK>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 *send-to-menu* *sendto*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 You can also install Vim in the "Send To" menu:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 1. Start a Windows Explorer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 2. Navigate to your sendto directory:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 Windows 95: %windir%\sendto (e.g. "c:\windows\sendto")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 Windows NT: %windir%\profiles\%user%\sendto (e.g.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 "c:\winnt\profiles\mattha\sendto").
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 3. Right-click in the file pane and select New->Shortcut
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 4. Follow the shortcut wizard, using the full path to VIM/GVIM.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 When you 'send a file to Vim', Vim changes to that file's directory. Note,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 however, that any long directory names will appear in their short (MS-DOS)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 form. This is a limitation of the Windows "Send To" mechanism.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 *notepad*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 You could replace notepad.exe with gvim.exe, but that has a few side effects.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 Some programs rely on notepad arguments, which are not recognized by Vim. For
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 example "notepad -p" is used by some applications to print a file. It's
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 better to leave notepad where it is and use another way to start Vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 *win32-popup-menu*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 A more drastic approach is to install an "Edit with Vim" entry in the popup
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 menu for the right mouse button. With this you can edit any file with Vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 This can co-exist with the file associations mentioned above. The difference
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 is that the file associations will make starting Vim the default action. With
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 the "Edit with Vim" menu entry you can keep the existing file association for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 double clicking on the file, and edit the file with Vim when you want. For
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 example, you can associate "*.mak" with your make program. You can execute
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 the makefile by double clicking it and use the "Edit with Vim" entry to edit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 the makefile.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 You can select any files and right-click to see a menu option called "Edit
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
132 with gvim". Choosing this menu option will invoke gvim with the file you have
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 selected. If you select multiple files, you will find two gvim-related menu
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 options:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 "Edit with multiple gvims" -- one gvim for each file in the selection
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 "Edit with single gvim" -- one gvim for all the files in the selection
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 And if there already is a gvim running:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 "Edit with existing gvim" -- edit the file with the running gvim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2681
diff changeset
140 The "edit with existing Vim" entries can be disabled by adding an entry in the
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2681
diff changeset
141 registry under HKLM\Software\Vim\Gvim, named DisableEditWithExisting, and with
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2681
diff changeset
142 any value.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 *install-registry*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 You can add the "Edit with Vim" menu entry in an easy way by using the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 "install.exe" program. It will add several registry entries for you.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 You can also do this by hand. This is complicated! Use the install.exe if
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 you can.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 1. Start the registry editor with "regedit".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 2. Add these keys:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 key value name value ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 {default} Vim Shell Extension
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}\InProcServer32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 {default} {path}\gvimext.dll
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 ThreadingModel Apartment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\gvim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 {default} {51EEE242-AD87-11d3-9C1E-0090278BBD99}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 {51EEE242-AD87-11d3-9C1E-0090278BBD99}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 Vim Shell Extension
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 HKEY_LOCAL_MACHINE\Software\Vim\Gvim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 path {path}\gvim.exe
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\vim 5.6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 DisplayName Vim 5.6: Edit with Vim popup menu entry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 UninstallString {path}\uninstal.exe
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 Replace {path} with the path that leads to the executable.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 Don't type {default}, this is the value for the key itself.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 To remove "Edit with Vim" from the popup menu, just remove the registry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 entries mentioned above. The "uninstal.exe" program can do this for you. You
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 can also use the entry in the Windows standard "Add/Remove Programs" list.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 If you notice that this entry overrules other file type associations, set
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 those associations again by hand (using Windows Explorer, see above). This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 only seems to happen on some Windows NT versions (Windows bug?). Procedure:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 1. Find the name of the file type. This can be done by starting the registry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 editor, and searching for the extension in \\HKEY_CLASSES_ROOT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 2. In a Windows Explorer, use View/Options/File Types. Search for the file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 type in the list and click "Edit". In the actions list, you can select on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 to be used as the default (normally the "open" action) and click on the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 "Set Default" button.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 Vim in the "Open With..." context menu *win32-open-with-menu*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 If you use the Vim install program you have the choice to add Vim to the "Open
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 With..." menu. This means you can use Vim to edit many files. Not every file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 (for unclear reasons...), thus the "Edit with Vim" menu entry is still useful.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 One reason to add this is to be able to edit HTML files directly from Internet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 Explorer. To enable this use the "Tools" menu, "Internet Options..." entry.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 In the dialog select the "Programs" tab and select Vim in the "HTML editor"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 choice. If it's not there than installing didn't work properly.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 Doing this manually can be done with this script:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 ----------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 REGEDIT4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 [HKEY_CLASSES_ROOT\Applications\gvim.exe]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 [HKEY_CLASSES_ROOT\Applications\gvim.exe\shell]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 [HKEY_CLASSES_ROOT\Applications\gvim.exe\shell\edit]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 [HKEY_CLASSES_ROOT\Applications\gvim.exe\shell\edit\command]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 @="c:\\vim\\vim62\\gvim.exe \"%1\""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 [HKEY_CLASSES_ROOT\.htm\OpenWithList\gvim.exe]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 [HKEY_CLASSES_ROOT\*\OpenWithList\gvim.exe]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 ----------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 Change the "c:\\vim\\vim62" bit to where gvim.exe is actually located.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 To uninstall this run the Vim uninstall program or manually delete the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 registry entries with "regedit".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 3. Using the clipboard *gui-clipboard*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 Windows has a clipboard, where you can copy text to, and paste text from. Vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 supports this in several ways. For other systems see |gui-selections|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 The "* register reflects the contents of the clipboard. |quotestar|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 When the "unnamed" string is included in the 'clipboard' option, the unnamed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 register is the same. Thus you can yank to and paste from the clipboard
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 without prepending "* to commands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 The 'a' flag in 'guioptions' is not included by default. This means that text
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 is only put on the clipboard when an operation is performed on it. Just
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 Visually selecting text doesn't put it on the clipboard. When the 'a' flag is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 included, the text is copied to the clipboard even when it is not operated
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 upon.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 *mswin.vim*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 To use the standard MS-Windows way of CTRL-X, CTRL-C and CTRL-V, use the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 $VIMRUNTIME/mswin.vim script. You could add this line to your _vimrc file: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 source $VIMRUNTIME/mswin.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 Since CTRL-C is used to copy the text to the clipboard, it can't be used to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 cancel an operation. Use CTRL-Break for that.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 874
diff changeset
249 CTRL-Z is used for undo. This means you can't suspend Vim with this key, use
e63691e7c504 updated for version 7.1a
vimboss
parents: 874
diff changeset
250 |:suspend| instead (if it's supported at all).
81
bf3f798c35c6 updated for version 7.0033
vimboss
parents: 7
diff changeset
251
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 81
diff changeset
252 *CTRL-V-alternative* *CTRL-Q*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 Since CTRL-V is used to paste, you can't use it to start a blockwise Visual
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 selection. You can use CTRL-Q instead. You can also use CTRL-Q in Insert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 mode and Command-line mode to get the old meaning of CTRL-V. But CTRL-Q
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 doesn't work for terminals when it's used for control flow.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 NOTE: The clipboard support still has a number of bugs. See |todo|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 4. Shell Commands *gui-shell-win32*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 Vim uses another window for external commands, to make it possible to run any
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 command. The external command gets its own environment for running, just like
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 it was started from a DOS prompt.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 *win32-vimrun*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 Executing an external command is done indirectly by the "vimrun" command. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 "vimrun.exe" must be in the path for this to work. Or it must be in the same
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 directory as the Vim executable. If "vimrun" cannot be found, the command is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 executed directly, but then the DOS window closes immediately after the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 external command has finished.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 WARNING: If you close this window with the "X" button, and confirm the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 question if you really want to kill the application, Vim may be killed too!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 (This does not apply to commands run asynchronously with ":!start".)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 In Windows 95, the window in which the commands are executed is always 25x80
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 characters, to be as DOS compatible as possible (this matters!). The default
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
279 system font is used. On NT, the window will be the default you have set up for
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
280 "Console" in Control Panel. On Win32s, the properties of the DOS box are
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 determined by _default.pif in the windows directory.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 *msdos-mode*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 If you get a dialog that says "This program is set to run in MS-DOS mode..."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 when you run an external program, you can solve this by changing the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 properties of the associated shortcut:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 - Use a Windows Explorer to find the command.com that is used. It can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 c:\command.com, c:\dos\command.com, c:\windows\command.com, etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 - With the right mouse button, select properties of this command.com.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 - In the Program tab select "Advanced".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 - Unselect "MS-DOS mode".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 - Click "OK" twice.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 *win32-!start*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 Normally, Vim waits for a command to complete before continuing (this makes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 sense for most shell commands which produce output for Vim to use). If you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297 want Vim to start a program and return immediately, you can use the following
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 syntax on W95 & NT: >
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
299 :!start [/min] {command}
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
300 The optional "/min" causes the window to be minimized.
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
301
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
302 On Win32s, you will have to go to another window instead. Don't forget that
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 you must tell Windows 3.1x to keep executing a DOS command in the background
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 while you switch back to Vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 5. Special colors *win32-colors*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 On Win32, the normal DOS colors can be used. See |dos-colors|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311 Additionally the system configured colors can also be used. These are known
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 by the names Sys_XXX, where XXX is the appropriate system color name, from the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 following list (see the Win32 documentation for full descriptions). Case is
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
314 ignored. Note: On Win32s not all of these colors are supported.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316 Sys_3DDKShadow Sys_3DFace Sys_BTNFace
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 Sys_3DHilight Sys_3DHighlight Sys_BTNHilight
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 Sys_BTNHighlight Sys_3DLight Sys_3DShadow
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319 Sys_BTNShadow Sys_ActiveBorder Sys_ActiveCaption
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 Sys_AppWorkspace Sys_Background Sys_Desktop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 Sys_BTNText Sys_CaptionText Sys_GrayText
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 Sys_Highlight Sys_HighlightText Sys_InactiveBorder
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 Sys_InactiveCaption Sys_InactiveCaptionText Sys_InfoBK
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 Sys_InfoText Sys_Menu Sys_MenuText
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 Sys_ScrollBar Sys_Window Sys_WindowFrame
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326 Sys_WindowText
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328 Probably the most useful values are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329 Sys_Window Normal window background
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330 Sys_WindowText Normal window text
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 Sys_Highlight Highlighted background
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332 Sys_HighlightText Highlighted text
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 These extra colors are also available:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 Gray, Grey, LightYellow, SeaGreen, Orange, Purple, SlateBlue, Violet,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 *rgb.txt*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 Additionally, colors defined by a "rgb.txt" file can be used. This file is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339 well known from X11. A few lines from it: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 255 218 185 peach puff
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342 205 133 63 peru
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 255 181 197 pink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 This shows the layout of the file: First the R, G and B value as a decimal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 number, followed by the name of the color. The four fields are separated by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 spaces.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 You can get an rgb.txt file from any X11 distribution. It is located in a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 directory like "/usr/X11R6/lib/X11/". For Vim it must be located in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351 $VIMRUNTIME directory. Thus the file can be found with "$VIMRUNTIME/rgb.txt".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 *gui-w32-dialogs* *dialog*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 6. Windows dialogs & browsers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 The Win32 GUI can use familiar Windows components for some operations, as well
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 as the traditional interface shared with the console version.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361 6.1 Dialogs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 The dialogs displayed by the "confirm" family (i.e. the 'confirm' option,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 |:confirm| command and |confirm()| function) are GUI-based rather than the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365 console-based ones used by other versions. The 'c' flag in 'guioptions'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366 changes this.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369 6.2 File Browsers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 When prepending ":browse" before file editing commands, a file requester is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 used to allow you to select an existing file. See |:browse|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 6.3 Tearoff Menus
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 The Win32 GUI emulates Motif's tear-off menus. At the top of each menu you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 will see a small graphic "rip here" sign. Selecting it will cause a floating
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 window to be created with the same menu entries on it. The floating menu can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 then be accessed just as if it was the original (including sub-menus), but
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381 without having to go to the menu bar each time.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 This is most useful if you find yourself using a command buried in a sub-menu
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 over and over again.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 The tearoff menus can be positioned where you like, and always stay just above
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
385 the Main Vim window. You can get rid of them by closing them as usual; they
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386 also of course close when you exit Vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 *:tearoff* *:te*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389 :te[aroff] {name} Tear-off the menu {name}. The menu named must have at
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 least one subentry, but need not appear on the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 menu-bar (see |win32-hidden-menus|).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 Example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 :tearoff File
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 will make the "File" menu (if there is one) appear as a tearoff menu. >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 :amenu ]Toolbar.Make :make<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398 :tearoff ]Toolbar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 This creates a floating menu that doesn't exist on the main menu-bar.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 Note that a menu that starts with ']' will not be displayed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404 7. Command line arguments *gui-w32-cmdargs*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 Analysis of a command line into parameters is not standardised in MS Windows.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 Gvim has to provide logic to analyse a command line. This logic is likely to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 be different from the default logic provided by a compilation system used to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 build vim. The differences relate to unusual double quote (") usage.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 The arguments "C:\My Music\freude.txt" and "+/Sch\"iller" are handled in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 same way. The argument "+/Sch""iller" may be handled different by gvim and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 vim, depending what it was compiled with.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 The rules are:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 a) A parameter is a sequence of graphic characters.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 b) Parameters are separated by white space.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 c) A parameter can be enclosed in double quotes to include white space.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 d) A sequence of zero or more backslashes (\) and a double quote (")
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
419 is special. The effective number of backslashes is halved, rounded
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 down. An even number of backslashes reverses the acceptability of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421 spaces and tabs, an odd number of backslashes produces a literal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 double quote.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 So:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 " is a special double quote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 \" is a literal double quote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 \\" is a literal backslash and a special double quote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 \\\" is a literal backslash and a literal double quote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 \\\\" is 2 literal backslashes and a special double quote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 \\\\\" is 2 literal backslashes and a literal double quote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 Example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 gvim "C:\My Music\freude" +"set ignorecase" +/"\"foo\\" +\"bar\\\"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 opens "C:\My Music\freude" and executes the line mode commands: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 set ignorecase; /"foo\ and /bar\"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 8. Various *gui-w32-various*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 *gui-w32-printing*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443 The "File/Print" menu prints the text with syntax highlighting, see
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 |:hardcopy|. If you just want to print the raw text and have a default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 printer installed this should also work: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446 :w >>prn
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
448 Vim supports a number of standard MS Windows features. Some of these are
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451 *drag-n-drop-win32*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 You can drag and drop one or more files into the Vim window, where they will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453 be opened as normal. See |drag-n-drop|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455 *:simalt* *:si*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456 :sim[alt] {key} simulate pressing {key} while holding Alt pressed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457 {not in Vi} {only for Win32 versions}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459 Normally, Vim takes control of all Alt-<Key> combinations, to increase the
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
460 number of possible mappings. This clashes with the standard use of Alt as the
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461 key for accessing menus.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462 The quick way of getting standard behavior is to set the 'winaltkeys' option
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463 to "yes". This however prevents you from mapping Alt keys at all.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464 Another way is to set 'winaltkeys' to "menu". Menu shortcut keys are then
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 handled by windows, other ALT keys can be mapped. This doesn't allow a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466 dependency on the current state though.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467 To get round this, the :simalt command allows Vim (when 'winaltkeys' is not
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
468 "yes") to fake a Windows-style Alt keypress. You can use this to map Alt key
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469 combinations (or anything else for that matter) to produce standard Windows
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
470 actions. Here are some examples: >
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472 :map <M-f> :simalt f<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473 This makes Alt-F pop down the 'File' menu (with the stock Menu.vim) by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474 simulating the keystrokes Alt, F. >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475 :map <M-Space> :simalt ~<CR>
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
476 This maps Alt-Space to pop down the system menu for the Vim window. Note that
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 ~ is used by simalt to represent the <Space> character. >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478 :map <C-n> :simalt ~n<CR>
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
479 Maps Control-N to produce the keys Alt-Space followed by N. This minimizes the
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480 Vim window via the system menu.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 874
diff changeset
482 Note that the key changes depending on the language you are using.
e63691e7c504 updated for version 7.1a
vimboss
parents: 874
diff changeset
483
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484 *intellimouse-wheel-problems*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485 When using the Intellimouse mouse wheel causes Vim to stop accepting input, go
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486 to:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487 ControlPanel - Mouse - Wheel - UniversalScrolling - Exceptions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
488
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489 And add gvim to the list of applications. This problem only appears to happen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490 with the Intellimouse driver 2.2 and when "Universal Scrolling" is turned on.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491
3750
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
492
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
493 XPM support *w32-xpm-support*
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
494
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
495 Gvim can be build on MS-Windows with support for XPM files. |+xpm_w32|
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
496 See the Make_mvc.mak file for instructions, search for XPM.
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
497
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
498 To try out if XPM support works do this: >
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
499 :help
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
500 :exe 'sign define vimxpm icon=' . $VIMRUNTIME . '\\vim16x16.xpm'
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
501 :exe 'sign place 1 line=1 name=vimxpm file=' . expand('%:p')
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
502 <
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
503
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504 vim:tw=78:sw=4:ts=8:ft=help:norl: