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