annotate runtime/doc/gui_w32.txt @ 33947:f4d88db48a63 v9.0.2168

patch 9.0.2168: Moving tabpages on :drop may cause an endless loop Commit: https://github.com/vim/vim/commit/df12e39b8b9dd39056e22b452276622cb7b617fd Author: Christian Brabandt <cb@256bit.org> Date: Sat Dec 16 13:55:32 2023 +0100 patch 9.0.2168: Moving tabpages on :drop may cause an endless loop Problem: Moving tabpages on :drop may cause an endless loop Solution: Disallow moving tabpages on :drop when cleaning up the arglist first Moving tabpages during drop command may cause an endless loop When executing a :tab drop command, Vim will close all windows not in the argument list. This triggers various autocommands. If a user has created an 'au Tabenter * :tabmove -' autocommand, this can cause Vim to end up in an endless loop, when trying to iterate over all tabs (which would trigger the tabmove autocommand, which will change the tpnext pointer, etc). So instead of blocking all autocommands before we actually try to edit the given file, lets simply disallow to move tabpages around. Otherwise, we may change the expected number of events triggered during a :drop command, which users may rely on (there is actually a test, that expects various TabLeave/TabEnter autocommands) and would therefore be a backwards incompatible change. Don't make this an error, as this could trigger several times during the drop command, but silently ignore the :tabmove command in this case (and it should in fact finally trigger successfully when loading the given file in a new tab). So let's just be quiet here instead. fixes: #13676 closes: #13686 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 16 Dec 2023 14:00:05 +0100
parents a9b5ffbc0428
children 4635e43f2c6f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29314
f8116058ca76 release version 9.0
Bram Moolenaar <Bram@vim.org>
parents: 28141
diff changeset
1 *gui_w32.txt* For Vim version 9.0. Last change: 2022 Mar 09
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.
32004
a9b5ffbc0428 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 30320
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 1. Starting the GUI *gui-w32-start*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 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
27 start it or what it's called.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 The GUI will always run in the Windows subsystem. Mostly shells automatically
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 return with a command prompt after starting gvim. If not, you should use the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 "start" command: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 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
46 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
47 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
48 fonts that have the same point size don't have the same pixel size!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 Additionally, the positioning of the fonts must be the same (ascent and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 descent).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 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
53 standard Windows font selector.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 Setting the menu height doesn't work for the Win32 GUI.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 *gui-win32-maximized*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 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
59 vimrc or gvimrc file: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 au GUIEnter * simalt ~x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 <
1376
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
62
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
63 Using Vim as a plugin *gui-w32-windowid*
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
64
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
65 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
66 pass Vim the command-line option |--windowid| with a decimal or hexadecimal
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
67 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
68 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
69 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
70 to spawn Vim correctly.
53b2bedccfdf updated for version 7.1-091
vimboss
parents: 1244
diff changeset
71
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 2. Vim as default editor *vim-default-editor*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 To set Vim as the default editor for a file type:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 1. Start a Windows Explorer
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
77 2. Choose View/Options -> File Types
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 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
79 (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
80 extension).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 In the "open" action, use: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 gvim "%1"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 < The quotes are required for using file names with embedded spaces.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 You can also use this: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 gvim "%L"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 < This should avoid short (8.3 character) file names in some situations. But
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 I'm not sure if this works everywhere.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 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
90 file's directory.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 If you want Vim to start full-screen, use this for the Open action: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 gvim -c "simalt ~x" "%1"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 Another method, which also works when you put Vim in another directory (e.g.,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 when you have got a new version):
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 1. select a file you want to use Vim with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 2. <Shift-F10>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 3. select "Open With..." menu entry
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 4. click "Other..."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 5. browse to the (new) location of Vim and click "Open"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 6. make "Always Use this program..." checked
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 7. <OK>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 *send-to-menu* *sendto*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 You can also install Vim in the "Send To" menu:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 1. Start a Windows Explorer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 2. Navigate to your sendto directory:
30320
0763cb330a65 patch 9.0.0496: no good reason to keep supporting Windows-XP
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
109 C:\Users\%user%\AppData\Roaming\Microsoft\Windows\SendTo .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 3. Right-click in the file pane and select New->Shortcut
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 4. Follow the shortcut wizard, using the full path to VIM/GVIM.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 When you 'send a file to Vim', Vim changes to that file's directory. Note,
19116
9b7f90e56753 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 18972
diff changeset
114 however, that any long directory names will appear in their short (MS-DOS)
9b7f90e56753 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 18972
diff changeset
115 form on some Windows versions. This is a limitation of the Windows "Send To"
9b7f90e56753 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 18972
diff changeset
116 mechanism.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 *notepad*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 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
120 Some programs rely on notepad arguments, which are not recognized by Vim. For
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 example "notepad -p" is used by some applications to print a file. It's
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 better to leave notepad where it is and use another way to start Vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 *win32-popup-menu*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 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
126 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
127
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 This can co-exist with the file associations mentioned above. The difference
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 is that the file associations will make starting Vim the default action. With
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 the "Edit with Vim" menu entry you can keep the existing file association for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 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
132 example, you can associate "*.mak" with your make program. You can execute
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 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
134 the makefile.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 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
137 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
138 selected. If you select multiple files, you will find two gvim-related menu
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 options:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 "Edit with multiple gvims" -- one gvim for each file in the selection
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 "Edit with single gvim" -- one gvim for all the files in the selection
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 And if there already is a gvim running:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 "Edit with existing gvim" -- edit the file with the running gvim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2681
diff changeset
145 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
146 registry under HKLM\Software\Vim\Gvim, named DisableEditWithExisting, and with
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2681
diff changeset
147 any value.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 *install-registry*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 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
150 "install.exe" program. It will add several registry entries for you.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 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
153 you can.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 1. Start the registry editor with "regedit".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 2. Add these keys:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 key value name value ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 {default} Vim Shell Extension
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}\InProcServer32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 {default} {path}\gvimext.dll
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 ThreadingModel Apartment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\gvim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 {default} {51EEE242-AD87-11d3-9C1E-0090278BBD99}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 {51EEE242-AD87-11d3-9C1E-0090278BBD99}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 Vim Shell Extension
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 HKEY_LOCAL_MACHINE\Software\Vim\Gvim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 path {path}\gvim.exe
19116
9b7f90e56753 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 18972
diff changeset
170 HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\vim 8.2
9b7f90e56753 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 18972
diff changeset
171 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
172 UninstallString {path}\uninstall.exe
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 Replace {path} with the path that leads to the executable.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 Don't type {default}, this is the value for the key itself.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 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
178 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
179 You can also use the entry in the Windows standard "Add/Remove Programs" list.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 If you notice that this entry overrules other file type associations, set
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 those associations again by hand (using Windows Explorer, see above). This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 only seems to happen on some Windows NT versions (Windows bug?). Procedure:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 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
185 editor, and searching for the extension in \\HKEY_CLASSES_ROOT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 2. In a Windows Explorer, use View/Options/File Types. Search for the file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 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
188 to be used as the default (normally the "open" action) and click on the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 "Set Default" button.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 Vim in the "Open With..." context menu *win32-open-with-menu*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 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
195 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
196 (for unclear reasons...), thus the "Edit with Vim" menu entry is still useful.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 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
199 Explorer. To enable this use the "Tools" menu, "Internet Options..." entry.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 In the dialog select the "Programs" tab and select Vim in the "HTML editor"
19968
1908e92b02fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19813
diff changeset
201 choice. If it's not there then installing didn't work properly.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 Doing this manually can be done with this script:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 ----------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 REGEDIT4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 [HKEY_CLASSES_ROOT\Applications\gvim.exe]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 [HKEY_CLASSES_ROOT\Applications\gvim.exe\shell]
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\Applications\gvim.exe\shell\edit]
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\Applications\gvim.exe\shell\edit\command]
19116
9b7f90e56753 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 18972
diff changeset
215 @="c:\\vim\\vim82\\gvim.exe \"%1\""
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 [HKEY_CLASSES_ROOT\.htm\OpenWithList\gvim.exe]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 [HKEY_CLASSES_ROOT\*\OpenWithList\gvim.exe]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 ----------------------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222
19116
9b7f90e56753 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 18972
diff changeset
223 Change the "c:\\vim\\vim82" bit to where gvim.exe is actually located.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 To uninstall this run the Vim uninstall program or manually delete the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 registry entries with "regedit".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 3. Using the clipboard *gui-clipboard*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 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
232 supports this in several ways. For other systems see |gui-selections|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 The "* register reflects the contents of the clipboard. |quotestar|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 When the "unnamed" string is included in the 'clipboard' option, the unnamed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 register is the same. Thus you can yank to and paste from the clipboard
28141
dce918af0c00 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 26100
diff changeset
238 without prepending "* to commands. If this doesn't work use the "unnamedplus"
dce918af0c00 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 26100
diff changeset
239 string in the 'clipboard' option.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 The 'a' flag in 'guioptions' is not included by default. This means that text
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 is only put on the clipboard when an operation is performed on it. Just
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 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
244 included, the text is copied to the clipboard even when it is not operated
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 upon.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 *mswin.vim*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 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
249 $VIMRUNTIME/mswin.vim script. You could add this line to your _vimrc file: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 source $VIMRUNTIME/mswin.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 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
253 cancel an operation. Use CTRL-Break for that.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 874
diff changeset
255 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
256 |:suspend| instead (if it's supported at all).
81
bf3f798c35c6 updated for version 7.0033
vimboss
parents: 7
diff changeset
257
167
c93c9cad9618 updated for version 7.0051
vimboss
parents: 81
diff changeset
258 *CTRL-V-alternative* *CTRL-Q*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 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
260 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
261 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
262 doesn't work for terminals when it's used for control flow.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 NOTE: The clipboard support still has a number of bugs. See |todo|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 4. Shell Commands *gui-shell-win32*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 Vim uses another window for external commands, to make it possible to run any
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 command. The external command gets its own environment for running, just like
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 it was started from a DOS prompt.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 *win32-vimrun*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 Executing an external command is done indirectly by the "vimrun" command. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 "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
276 directory as the Vim executable. If "vimrun" cannot be found, the command is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 executed directly, but then the DOS window closes immediately after the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 external command has finished.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 WARNING: If you close this window with the "X" button, and confirm the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 question if you really want to kill the application, Vim may be killed too!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 (This does not apply to commands run asynchronously with ":!start".)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282
10264
c036c0f636d5 commit https://github.com/vim/vim/commit/cea912af725c54f4727a0565e31661f6b29c6bb1
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
283 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
284 up for "Console" in Control Panel.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 *win32-!start*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 Normally, Vim waits for a command to complete before continuing (this makes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 sense for most shell commands which produce output for Vim to use). If you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 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
290 syntax: >
2681
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
291 :!start [/min] {command}
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
292 The optional "/min" causes the window to be minimized.
85c5a72551e2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
293
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 5. Special colors *win32-colors*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297 On Win32, the normal DOS colors can be used. See |dos-colors|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 Additionally the system configured colors can also be used. These are known
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 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
301 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
302 ignored.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 Sys_3DDKShadow Sys_3DFace Sys_BTNFace
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 Sys_3DHilight Sys_3DHighlight Sys_BTNHilight
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 Sys_BTNHighlight Sys_3DLight Sys_3DShadow
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 Sys_BTNShadow Sys_ActiveBorder Sys_ActiveCaption
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 Sys_AppWorkspace Sys_Background Sys_Desktop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 Sys_BTNText Sys_CaptionText Sys_GrayText
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 Sys_Highlight Sys_HighlightText Sys_InactiveBorder
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311 Sys_InactiveCaption Sys_InactiveCaptionText Sys_InfoBK
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 Sys_InfoText Sys_Menu Sys_MenuText
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 Sys_ScrollBar Sys_Window Sys_WindowFrame
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 Sys_WindowText
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316 Probably the most useful values are
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 Sys_Window Normal window background
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 Sys_WindowText Normal window text
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319 Sys_Highlight Highlighted background
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 Sys_HighlightText Highlighted text
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 These extra colors are also available:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 Gray, Grey, LightYellow, SeaGreen, Orange, Purple, SlateBlue, Violet,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 *rgb.txt*
26057
92c424550367 patch 8.2.3562: cannot add color names
Bram Moolenaar <Bram@vim.org>
parents: 24387
diff changeset
326 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
327 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
328 $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
329 $VIMRUNTIME/colors/lists/default.vim.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332 *gui-w32-dialogs* *dialog*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 6. Windows dialogs & browsers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 The Win32 GUI can use familiar Windows components for some operations, as well
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336 as the traditional interface shared with the console version.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339 6.1 Dialogs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 The dialogs displayed by the "confirm" family (i.e. the 'confirm' option,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342 |:confirm| command and |confirm()| function) are GUI-based rather than the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 console-based ones used by other versions. The 'c' flag in 'guioptions'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 changes this.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 6.2 File Browsers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 When prepending ":browse" before file editing commands, a file requester is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 used to allow you to select an existing file. See |:browse|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 6.3 Tearoff Menus
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 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
356 will see a small graphic "rip here" sign. Selecting it will cause a floating
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 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
358 then be accessed just as if it was the original (including sub-menus), but
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359 without having to go to the menu bar each time.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 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
361 over and over again.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 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
363 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
364 also of course close when you exit Vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366 *:tearoff* *:te*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 :te[aroff] {name} Tear-off the menu {name}. The menu named must have at
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 least one subentry, but need not appear on the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369 menu-bar (see |win32-hidden-menus|).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 Example: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 :tearoff File
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 will make the "File" menu (if there is one) appear as a tearoff menu. >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 :amenu ]Toolbar.Make :make<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 :tearoff ]Toolbar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 This creates a floating menu that doesn't exist on the main menu-bar.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 Note that a menu that starts with ']' will not be displayed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 7. Command line arguments *gui-w32-cmdargs*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383
12756
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 10264
diff changeset
384 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
385 see |win32-cmdargs|.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 8. Various *gui-w32-various*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 *gui-w32-printing*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 The "File/Print" menu prints the text with syntax highlighting, see
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 |:hardcopy|. If you just want to print the raw text and have a default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 printer installed this should also work: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 :w >>prn
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395
24387
5c98ea5f5d6e Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 21676
diff changeset
396 Vim supports a number of standard MS-Windows features. Some of these are
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 *drag-n-drop-win32*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400 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
401 be opened as normal. See |drag-n-drop|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5294
diff changeset
403 *:simalt* *:sim*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404 :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
405 {only for Win32 versions}
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5294
diff changeset
406 Note: ":si" means ":s" with the "i" flag.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 Normally, Vim takes control of all Alt-<Key> combinations, to increase the
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
409 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
410 key for accessing menus.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 The quick way of getting standard behavior is to set the 'winaltkeys' option
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 to "yes". This however prevents you from mapping Alt keys at all.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 Another way is to set 'winaltkeys' to "menu". Menu shortcut keys are then
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 handled by windows, other ALT keys can be mapped. This doesn't allow a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 dependency on the current state though.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 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
417 "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
418 combinations (or anything else for that matter) to produce standard Windows
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
419 actions. Here are some examples: >
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421 :map <M-f> :simalt f<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 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
423 simulating the keystrokes Alt, F. >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 :map <M-Space> :simalt ~<CR>
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
425 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
426 ~ is used by simalt to represent the <Space> character. >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 :map <C-n> :simalt ~n<CR>
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 167
diff changeset
428 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
429 Vim window via the system menu.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 874
diff changeset
431 Note that the key changes depending on the language you are using.
e63691e7c504 updated for version 7.1a
vimboss
parents: 874
diff changeset
432
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 *intellimouse-wheel-problems*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 When using the Intellimouse mouse wheel causes Vim to stop accepting input, go
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 to:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 ControlPanel - Mouse - Wheel - UniversalScrolling - Exceptions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 And add gvim to the list of applications. This problem only appears to happen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 with the Intellimouse driver 2.2 and when "Universal Scrolling" is turned on.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440
3750
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
441
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
442 XPM support *w32-xpm-support*
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
443
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 19968
diff changeset
444 GVim can be built on MS-Windows with support for XPM files. |+xpm_w32|
3750
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
445 See the Make_mvc.mak file for instructions, search for XPM.
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
446
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
447 To try out if XPM support works do this: >
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
448 :help
19813
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19116
diff changeset
449 :let runtime = escape($VIMRUNTIME, ' \')
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19116
diff changeset
450 :exe 'sign define vimxpm icon=' .. runtime .. '\\vim16x16.xpm'
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19116
diff changeset
451 :exe 'sign place 1 line=1 name=vimxpm file=' .. expand('%:p')
3750
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
452 <
19813
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19116
diff changeset
453 You may need to get the vim16x16.xpm file from github:
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19116
diff changeset
454 https://github.com/vim/vim/blob/master/runtime/vim16x16.xpm
350e1d3131d8 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19116
diff changeset
455
3750
536aa8b0c934 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
456
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14347
diff changeset
457 vim:tw=78:sw=4:ts=8:noet:ft=help:norl: