Mercurial > vim
annotate runtime/doc/gui_x11.txt @ 13476:d130044d4f1f v8.0.1612
patch 8.0.1612: need to close terminal after shell stopped
commit https://github.com/vim/vim/commit/1dd98334d6daee8abefcd640291d4b777d9f0f96
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Mar 16 22:54:53 2018 +0100
patch 8.0.1612: need to close terminal after shell stopped
Problem: Need to close terminal after shell stopped.
Solution: Make :terminal without argument close the window by default.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 16 Mar 2018 23:00:07 +0100 |
parents | 4f7081eb1e26 |
children | e751b5c9dff3 |
rev | line source |
---|---|
11914 | 1 *gui_x11.txt* For Vim version 8.0. Last change: 2017 Jul 28 |
7 | 2 |
3 | |
4 VIM REFERENCE MANUAL by Bram Moolenaar | |
5 | |
6 | |
7 Vim's Graphical User Interface *gui-x11* *GUI-X11* | |
8 *Athena* *Motif* | |
9 1. Starting the X11 GUI |gui-x11-start| | |
10 2. GUI Resources |gui-resources| | |
11 3. Shell Commands |gui-pty| | |
12 4. Various |gui-x11-various| | |
13 5. GTK version |gui-gtk| | |
14 6. GNOME version |gui-gnome| | |
856 | 15 7. KDE version |gui-kde| |
11 | 16 8. Compiling |gui-x11-compiling| |
17 9. X11 selection mechanism |x11-selection| | |
7 | 18 |
19 Other relevant documentation: | |
20 |gui.txt| For generic items of the GUI. | |
21 | |
22 {Vi does not have any of these commands} | |
23 | |
24 ============================================================================== | |
25 1. Starting the X11 GUI *gui-x11-start* *E665* | |
26 | |
27 Then you can run the GUI version of Vim in either of these ways: | |
28 gvim [options] [files...] | |
29 vim -g [options] [files...] | |
30 | |
31 So if you call the executable "gvim", or make "gvim" a link to the executable, | |
32 then the GUI version will automatically be used. Additional characters may be | |
33 added after "gvim", for example "gvim-5". | |
34 | |
35 You may also start up the GUI from within the terminal version by using one of | |
36 these commands: | |
37 :gui [++opt] [+cmd] [-f|-b] [files...] *:gu* *:gui* | |
38 :gvim [++opt] [+cmd] [-f|-b] [files...] *:gv* *:gvim* | |
39 The "-f" option runs Vim in the foreground. | |
40 The "-b" option runs Vim in the background (this is the default). | |
41 Also see |++opt| and |+cmd|. | |
42 | |
43 *gui-fork* | |
44 When the GUI is started, it does a fork() and exits the current process. | |
45 When gvim was started from a shell this makes the shell accept further | |
46 commands. If you don't want this (e.g. when using gvim for a mail program | |
47 that waits for gvim to exit), start gvim with "gvim -f", "vim -gf" or use | |
48 ":gui -f". Don't use "vim -fg", because "-fg" specifies the foreground | |
49 color. | |
50 | |
51 When using "gvim -f" and then ":gui", Vim will run in the foreground. The | |
52 "-f" argument will be remembered. To force running Vim in the background use | |
53 ":gui -b". | |
54 | |
55 "gvim --nofork" does the same as "gvim -f". | |
3082 | 56 *E851* *E852* |
57 When starting the GUI fails Vim will try to continue running in the terminal. | |
7 | 58 |
59 If you want the GUI to run in the foreground always, include the 'f' | |
60 flag in 'guioptions'. |-f|. | |
61 | |
62 ============================================================================== | |
63 2. GUI Resources *gui-resources* *.Xdefaults* | |
64 | |
11 | 65 If using the Motif or Athena version of the GUI (not for the KDE, GTK+ or Win32 |
7 | 66 version), a number of X resources are available. You should use Vim's class |
67 "Vim" when setting these. They are as follows: | |
68 | |
69 Resource name Meaning ~ | |
70 | |
71 reverseVideo Boolean: should reverse video be used? | |
72 background Color of background. | |
73 foreground Color of normal text. | |
74 scrollBackground Color of trough portion of scrollbars. | |
75 scrollForeground Color of slider and arrow portions of scrollbars. | |
76 menuBackground Color of menu backgrounds. | |
77 menuForeground Color of menu foregrounds. | |
78 tooltipForeground Color of tooltip and balloon foreground. | |
79 tooltipBackground Color of tooltip and balloon background. | |
80 | |
81 font Name of font used for normal text. | |
82 boldFont Name of font used for bold text. | |
83 italicFont Name of font used for italic text. | |
84 boldItalicFont Name of font used for bold, italic text. | |
85 menuFont Name of font used for the menus, used when compiled | |
86 without the |+xfontset| feature | |
87 menuFontSet Name of fontset used for the menus, used when compiled | |
88 with the |+xfontset| feature | |
89 tooltipFont Name of the font used for the tooltip and balloons. | |
90 When compiled with the |+xfontset| feature this is a | |
91 fontset name. | |
92 | |
93 geometry Initial geometry to use for gvim's window (default | |
94 is same size as terminal that started it). | |
95 scrollbarWidth Thickness of scrollbars. | |
96 borderWidth Thickness of border around text area. | |
97 menuHeight Height of the menu bar (only for Athena). | |
98 | |
99 A special font for italic, bold, and italic-bold text will only be used if | |
100 the user has specified one via a resource. No attempt is made to guess what | |
101 fonts should be used for these based on the normal text font. | |
102 | |
103 Note that the colors can also be set with the ":highlight" command, using the | |
104 "Normal", "Menu", "Tooltip", and "Scrollbar" groups. Example: > | |
105 :highlight Menu guibg=lightblue | |
106 :highlight Tooltip guibg=yellow | |
107 :highlight Scrollbar guibg=lightblue guifg=blue | |
108 :highlight Normal guibg=grey90 | |
109 < | |
110 *font-sizes* | |
111 Note: All fonts (except for the menu and tooltip) must be of the same size!!! | |
112 If you don't do this, text will disappear or mess up the display. Vim does | |
113 not check the font sizes. It's the size in screen pixels that must be the | |
114 same. Note that some fonts that have the same point size don't have the same | |
115 pixel size! Additionally, the positioning of the fonts must be the same | |
116 (ascent and descent). You can check this with "xlsfonts -l {fontname}". | |
117 | |
236 | 118 If any of these things are also set with Vim commands, e.g. with |
7 | 119 ":set guifont=Screen15", then this will override the X resources (currently |
120 'guifont' is the only option that is supported). | |
121 | |
122 Here is an example of what you might put in your ~/.Xdefaults file: > | |
123 | |
124 Vim*useSchemes: all | |
125 Vim*sgiMode: true | |
126 Vim*useEnhancedFSB: true | |
127 Vim.foreground: Black | |
128 Vim.background: Wheat | |
129 Vim*fontList: 7x13 | |
130 | |
131 The first three of these are standard resources on Silicon Graphics machines | |
132 which make Motif applications look even better, highly recommended! | |
133 | |
134 The "Vim*fontList" is to set the menu font for Motif. Example: > | |
135 Vim*menuBar*fontList: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-* | |
136 With Athena: > | |
137 Vim*menuBar*SmeBSB*font: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-* | |
138 Vim*menuBar*MenuButton*font: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-* | |
139 | |
140 NOTE: A more portable, and indeed more correct, way to specify the menu font | |
141 in either Motif or Athena is through the resource: > | |
142 Vim.menuFont: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-* | |
143 Or, when compiled with the |+xfontset| feature: > | |
144 Vim.menuFontSet: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-* | |
145 | |
146 Don't use "Vim*geometry" in the defaults. This will break the menus. Use | |
147 "Vim.geometry" instead. | |
148 | |
149 If you get an error message "Cannot allocate colormap entry for "gray60", | |
150 try adding this to your Vim resources (change the colors to your liking): > | |
151 | |
152 Vim*scrollBackground: Black | |
153 Vim*scrollForeground: Blue | |
154 | |
155 The resources can also be set with arguments to Vim: | |
156 | |
157 argument meaning ~ | |
158 *-gui* | |
159 -display {display} Run vim on {display} *-display* | |
160 -iconic Start vim iconified *-iconic* | |
161 -background {color} Use {color} for the background *-background* | |
162 -bg {color} idem *-bg* | |
163 -foreground {color} Use {color} for normal text *-foreground* | |
164 -fg {color} idem *-fg* | |
165 -ul {color} idem *-ul* | |
166 -font {font} Use {font} for normal text *-font* | |
167 -fn {font} idem *-fn* | |
168 -boldfont {font} Use {font} for bold text *-boldfont* | |
169 -italicfont {font} Use {font} for italic text *-italicfont* | |
170 -menufont {font} Use {font} for menu items *-menufont* | |
171 -menufontset {fontset} Use {fontset} for menu items *-menufontset* | |
172 -mf {font} idem *-mf* | |
173 -geometry {geom} Use {geom} for initial geometry *-geometry* | |
174 -geom {geom} idem, see |-geometry-example| *-geom* | |
175 -borderwidth {width} Use a border width of {width} *-borderwidth* | |
176 -bw {width} idem *-bw* | |
177 *-scrollbarwidth* | |
178 -scrollbarwidth {width} Use a scrollbar width of {width} | |
179 -sw {width} idem *-sw* | |
180 -menuheight {height} Use a menu bar height of {height} *-menuheight* | |
181 -mh {height} idem *-mh* | |
182 NOTE: On Motif the value is ignored, the menu height | |
183 is computed to fit the menus. | |
184 -reverse Use reverse video *-reverse* | |
185 -rv idem *-rv* | |
186 +reverse Don't use reverse video *-+reverse* | |
187 +rv idem *-+rv* | |
188 -xrm {resource} Set the specified resource *-xrm* | |
189 | |
190 Note about reverse video: Vim checks that the result is actually a light text | |
191 on a dark background. The reason is that some X11 versions swap the colors, | |
192 and some don't. These two examples will both give yellow text on a blue | |
193 background: | |
194 gvim -fg Yellow -bg Blue -reverse | |
195 gvim -bg Yellow -fg Blue -reverse | |
196 | |
197 *-geometry-example* | |
198 An example for the geometry argument: > | |
199 gvim -geometry 80x63+8+100 | |
200 This creates a window with 80 columns and 63 lines at position 8 pixels from | |
201 the left and 100 pixels from the top of the screen. | |
202 | |
203 ============================================================================== | |
204 3. Shell Commands *gui-pty* | |
205 | |
206 WARNING: Executing an external command from the GUI will not always work. | |
207 "normal" commands like "ls", "grep" and "make" mostly work fine. Commands | |
208 that require an intelligent terminal like "less" and "ispell" won't work. | |
209 Some may even hang and need to be killed from another terminal. So be | |
210 careful! | |
211 | |
212 There are two ways to do the I/O with a shell command: Pipes and a pseudo-tty. | |
213 The default is to use a pseudo-tty. This should work best on most systems. | |
214 | |
215 Unfortunately, the implementation of the pseudo-tty is different on every Unix | |
216 system. And some systems require root permission. To avoid running into | |
217 problems with a pseudo-tty when you least expect it, test it when not editing | |
218 a file. Be prepared to "kill" the started command or Vim. Commands like | |
219 ":r !cat" may hang! | |
220 | |
221 If using a pseudo-tty does not work for you, reset the 'guipty' option: > | |
222 | |
223 :set noguipty | |
224 | |
225 Using a pipe should work on any Unix system, but there are disadvantages: | |
226 - Some shell commands will notice that a pipe is being used and behave | |
227 differently. E.g., ":!ls" will list the files in one column. | |
228 - The ":sh" command won't show a prompt, although it will sort of work. | |
229 - When using ":make" it's not possible to interrupt with a CTRL-C. | |
230 | |
231 Typeahead while the external command is running is often lost. This happens | |
232 both with a pipe and a pseudo-tty. This is a known problem, but it seems it | |
233 can't be fixed (or at least, it's very difficult). | |
234 | |
235 *gui-pty-erase* | |
236 When your erase character is wrong for an external command, you should fix | |
237 this in your "~/.cshrc" file, or whatever file your shell uses for | |
238 initializations. For example, when you want to use backspace to delete | |
239 characters, but hitting backspaces produces "^H" instead, try adding this to | |
240 your "~/.cshrc": > | |
241 stty erase ^H | |
242 The ^H is a real CTRL-H, type it as CTRL-V CTRL-H. | |
243 | |
244 ============================================================================== | |
245 4. Various *gui-x11-various* | |
246 | |
247 *gui-x11-printing* | |
248 The "File/Print" menu simply sends the current buffer to "lpr". No options or | |
249 whatever. If you want something else, you can define your own print command. | |
250 For example: > | |
251 | |
252 :10amenu File.Print :w !lpr -Php3 | |
253 :10vmenu File.Print :w !lpr -Php3 | |
254 < | |
255 *X11-icon* | |
256 Vim uses a black&white icon by default when compiled with Motif or Athena. A | |
257 colored Vim icon is included as $VIMRUNTIME/vim32x32.xpm. For GTK+, this is | |
258 the builtin icon used. Unfortunately, how you should install it depends on | |
259 your window manager. When you use this, remove the 'i' flag from | |
260 'guioptions', to remove the black&white icon: > | |
261 :set guioptions-=i | |
262 | |
263 If you use one of the fvwm* family of window managers simply add this line to | |
264 your .fvwm2rc configuration file: > | |
265 | |
266 Style "vim" Icon vim32x32.xpm | |
267 | |
268 Make sure the icon file's location is consistent with the window manager's | |
269 ImagePath statement. Either modify the ImagePath from within your .fvwm2rc or | |
270 drop the icon into one the pre-defined directories: > | |
271 | |
272 ImagePath /usr/X11R6/include/X11/pixmaps:/usr/X11R6/include/X11/bitmaps | |
273 | |
274 Note: older versions of fvwm use "IconPath" instead of "ImagePath". | |
275 | |
276 For CDE "dtwm" (a derivative of Motif) add this line in the .Xdefaults: > | |
277 Dtwm*Vim*iconImage: /usr/local/share/vim/vim32x32.xpm | |
278 | |
279 For "mwm" (Motif window manager) the line would be: > | |
280 Mwm*Vim*iconImage: /usr/local/share/vim/vim32x32.xpm | |
281 | |
282 | |
11659
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
283 Mouse Pointers Available in X11 ~ |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
284 *X11_mouse_shapes* |
7 | 285 By using the |'mouseshape'| option, the mouse pointer can be automatically |
286 changed whenever Vim enters one of its various modes (e.g., Insert or | |
287 Command). Currently, the available pointers are: | |
288 | |
289 arrow an arrow pointing northwest | |
290 beam a I-like vertical bar | |
291 size an arrow pointing up and down | |
292 busy a wristwatch | |
293 blank an invisible pointer | |
294 crosshair a thin "+" sign | |
295 hand1 a dark hand pointing northeast | |
296 hand2 a light hand pointing northwest | |
297 pencil a pencil pointing southeast | |
298 question question_arrow | |
299 right_arrow an arrow pointing northeast | |
300 up_arrow an arrow pointing upwards | |
301 | |
302 Additionally, any of the mouse pointers that are built into X11 may be | |
303 used by specifying an integer from the X11/cursorfont.h include file. | |
304 | |
305 If a name is used that exists on other systems, but not in X11, the default | |
306 "arrow" pointer is used. | |
307 | |
308 ============================================================================== | |
8876
47f17f66da3d
commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Christian Brabandt <cb@256bit.org>
parents:
8218
diff
changeset
|
309 5. GTK version *gui-gtk* *GTK+* *GTK* *GTK3* |
7 | 310 |
311 The GTK version of the GUI works a little bit different. | |
312 | |
313 GTK does _not_ use the traditional X resource settings. Thus items in your | |
314 ~/.Xdefaults or app-defaults files are not used. | |
315 Many of the traditional X command line arguments are not supported. (e.g., | |
316 stuff like -bg, -fg, etc). The ones that are supported are: | |
317 | |
318 command line argument resource name meaning ~ | |
319 -fn or -font .font font name for the text | |
320 -geom or -geometry .geometry size of the gvim window | |
321 -rv or -reverse *reverseVideo white text on black background | |
322 -display display to be used | |
323 -fg -foreground {color} foreground color | |
324 -bg -background {color} background color | |
325 | |
326 To set the font, see |'guifont'|. For GTK, there's also a menu option that | |
327 does this. | |
328 | |
329 Additionally, there are these command line arguments, which are handled by GTK | |
330 internally. Look in the GTK documentation for how they are used: | |
331 --sync | |
332 --gdk-debug | |
333 --gdk-no-debug | |
334 --no-xshm (not in GTK+ 2) | |
335 --xim-preedit (not in GTK+ 2) | |
336 --xim-status (not in GTK+ 2) | |
337 --gtk-debug | |
338 --gtk-no-debug | |
339 --g-fatal-warnings | |
340 --gtk-module | |
341 --display (GTK+ counterpart of -display; works the same way.) | |
342 --screen (The screen number; for GTK+ 2.2 multihead support.) | |
343 | |
344 These arguments are ignored when the |+netbeans_intg| feature is used: | |
345 -xrm | |
346 -mf | |
347 | |
348 As for colors, Vim's color settings (for syntax highlighting) is still | |
349 done the traditional Vim way. See |:highlight| for more help. | |
350 | |
351 If you want to set the colors of remaining gui components (e.g., the | |
352 menubar, scrollbar, whatever), those are GTK specific settings and you | |
353 need to set those up in some sort of gtkrc file. You'll have to refer | |
354 to the GTK documentation, however little there is, on how to do this. | |
355 See http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html | |
356 for more information. | |
357 | |
11659
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
358 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
359 Tooltip Colors ~ |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
360 *gtk-tooltip-colors* |
7 | 361 Example, which sets the tooltip colors to black on light-yellow: > |
362 | |
363 style "tooltips" | |
364 { | |
365 bg[NORMAL] = "#ffffcc" | |
366 fg[NORMAL] = "#000000" | |
367 } | |
368 | |
369 widget "gtk-tooltips*" style "tooltips" | |
370 | |
371 Write this in the file ~/.gtkrc and it will be used by GTK+. For GTK+ 2 | |
372 you might have to use the file ~/.gtkrc-2.0 instead, depending on your | |
373 distribution. | |
374 | |
8218
3456e2ebebd4
commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents:
5697
diff
changeset
|
375 For GTK+ 3, an effect similar to the above can be obtained by adding the |
3456e2ebebd4
commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents:
5697
diff
changeset
|
376 following snippet of CSS code to $XDG_HOME_DIR/gtk-3.0/gtk.css (usually, |
3456e2ebebd4
commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents:
5697
diff
changeset
|
377 $HOME/.config/gtk-3.0/gtk.css): |
11659
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
378 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
379 For GTK+ 3 < 3.20: > |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
380 |
8218
3456e2ebebd4
commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents:
5697
diff
changeset
|
381 .tooltip { |
3456e2ebebd4
commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents:
5697
diff
changeset
|
382 background-color: #ffffcc; |
3456e2ebebd4
commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents:
5697
diff
changeset
|
383 color: #000000; |
3456e2ebebd4
commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents:
5697
diff
changeset
|
384 } |
3456e2ebebd4
commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents:
5697
diff
changeset
|
385 < |
11659
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
386 For GTK+ 3 >= 3.20: > |
8218
3456e2ebebd4
commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents:
5697
diff
changeset
|
387 |
11659
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
388 tooltip { |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
389 background-color: #ffffcc; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
390 text-shadow: none; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
391 } |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
392 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
393 tooltip label { |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
394 color: #2e3436; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
395 } |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
396 < |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
397 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
398 A Quick Look at GTK+ CSS ~ |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
399 *gtk-css* |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
400 The contents of this subsection apply to GTK+ 3.20 or later which provides |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
401 stable support for GTK+ CSS: |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
402 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
403 https://developer.gnome.org/gtk3/stable/theming.html |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
404 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
405 GTK+ uses CSS for styling and layout of widgets. In this subsection, we'll |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
406 have a quick look at GTK+ CSS through simple, illustrative examples. |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
407 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
408 Example 1. Empty Space Adjustment ~ |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
409 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
410 By default, the toolbar and the tabline of the GTK+ 3 GUI are somewhat larger |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
411 than those of the GTK+ 2 GUI. Some people may want to make them look similar |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
412 to the GTK+ 2 GUI in size. |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
413 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
414 To do that, we'll try reducing empty space around icons and labels that looks |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
415 apparently superfluous. |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
416 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
417 Add the following lines to $XDG_HOME_DIR/gtk-3.0/gtk.css (usually, |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
418 $HOME/.config/gtk-3.0/gtk.css): > |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
419 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
420 toolbar button { |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
421 margin-top: -2px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
422 margin-right: 0px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
423 margin-bottom: -2px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
424 margin-left: 0px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
425 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
426 padding-top: 0px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
427 padding-right: 0px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
428 padding-bottom: 0px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
429 padding-left: 0px |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
430 } |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
431 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
432 notebook tab { |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
433 margin-top: -1px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
434 margin-right: 3px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
435 margin-bottom: -1px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
436 margin-left: 3px; |
7 | 437 |
11659
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
438 padding-top: 0px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
439 padding-right: 0px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
440 padding-bottom: 0px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
441 padding-left: 0px |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
442 } |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
443 < |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
444 Since it's a CSS, they can be rewritten using shorthand: > |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
445 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
446 toolbar button { |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
447 margin: -2px 0px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
448 padding: 0px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
449 } |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
450 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
451 notebook tab { |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
452 margin: -1px 3px; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
453 padding: 0px |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
454 } |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
455 < |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
456 Note: You might want to use 'toolbariconsize' to adjust the icon size, too. |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
457 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
458 Note: Depending on the icon theme and/or the font in use, some extra tweaks |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
459 may be needed for a satisfactory result. |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
460 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
461 Note: In addition to margin and padding, you can use border. For details, |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
462 refer to the box model of CSS, e.g., |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
463 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
464 https://www.w3schools.com/css/css_boxmodel.asp |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
465 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
466 Example 2. More Than Just Colors ~ |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
467 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
468 GTK+ CSS supports gradients as well: > |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
469 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
470 tooltip { |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
471 background-image: -gtk-gradient(linear, |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
472 0 0, 0 1, |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
473 color-stop(0, #344752), |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
474 color-stop(0.5, #546772), |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
475 color-stop(1, #243742)); |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
476 } |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
477 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
478 tooltip label { |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
479 color: #f3f3f3; |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
480 } |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
481 < |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
482 Gradients can be used to make a GUI element visually distinguishable from |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
483 others without relying on high contrast. Accordingly, effective use of them is |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
484 a useful technique to give a theme a sense of unity in color and luminance. |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
485 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
486 Note: Theming can be difficult since it must make every application look |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
487 equally good; making a single application more charming often gets others |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
488 unexpectedly less attractive or even deteriorates their usability. Keep this |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
489 in mind always when you try improving a theme. |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
490 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
491 |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
492 Using Vim as a GTK+ plugin ~ |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
493 *gui-gtk-socketid* |
7 | 494 When the GTK+ version of Vim starts up normally, it creates its own top level |
495 window (technically, a 'GtkWindow'). GTK+ provides an embedding facility with | |
496 its GtkSocket and GtkPlug widgets. If one GTK+ application creates a | |
497 GtkSocket widget in one of its windows, an entirely different GTK+ application | |
498 may embed itself into the first application by creating a top-level GtkPlug | |
499 widget using the socket's ID. | |
500 | |
501 If you pass Vim the command-line option '--socketid' with a decimal or | |
502 hexadecimal value, Vim will create a GtkPlug widget using that value instead | |
503 of the normal GtkWindow. This enables Vim to act as a GTK+ plugin. | |
504 | |
505 This really is a programmer's interface, and is of no use without a supporting | |
506 application to spawn the Vim correctly. For more details on GTK+ sockets, see | |
507 http://www.gtk.org/api/ | |
508 | |
509 Note that this feature requires the latest GTK version. GTK 1.2.10 still has | |
510 a small problem. The socket feature has not yet been tested with GTK+ 2 -- | |
511 feel free to volunteer. | |
512 | |
513 ============================================================================== | |
514 6. GNOME version *gui-gnome* *Gnome* *GNOME* | |
515 | |
516 The GNOME GUI works just like the GTK+ version. See |GTK+| above for how it | |
517 works. It looks a bit different though, and implements one important feature | |
518 that's not available in the plain GTK+ GUI: Interaction with the session | |
519 manager. |gui-gnome-session| | |
520 | |
521 These are the different looks: | |
522 - Uses GNOME dialogs (GNOME 1 only). The GNOME 2 GUI uses the same nice | |
523 dialogs as the GTK+ 2 version. | |
524 - Uses the GNOME dock, so that the toolbar and menubar can be moved to | |
525 different locations other than the top (e.g., the toolbar can be placed on | |
526 the left, right, top, or bottom). The placement of the menubar and | |
527 toolbar is only saved in the GNOME 2 version. | |
528 - That means the menubar and toolbar handles are back! Yeah! And the | |
529 resizing grid still works too. | |
530 | |
1121 | 531 GNOME is compiled with if it was found by configure and the |
532 --enable-gnome-check argument was used. | |
533 | |
9975
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
534 Note: Avoid use of --enable-gnome-check with GTK+ 3 GUI build. The |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
535 functionality mentioned above is consolidated in GTK+ 3. |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
536 |
7 | 537 |
11659
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
538 GNOME session support ~ |
49c12c93abf3
Updated runtime files and translations.
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
539 *gui-gnome-session* *gnome-session* |
7 | 540 On logout, Vim shows the well-known exit confirmation dialog if any buffers |
541 are modified. Clicking [Cancel] will stop the logout process. Otherwise the | |
542 current session is stored to disk by using the |:mksession| command, and | |
543 restored the next time you log in. | |
544 | |
545 The GNOME session support should also work with the KDE session manager. | |
546 If you are experiencing any problems please report them as bugs. | |
547 | |
548 Note: The automatic session save works entirely transparent, in order to | |
549 avoid conflicts with your own session files, scripts and autocommands. That | |
550 means in detail: | |
551 - The session file is stored to a separate directory (usually $HOME/.gnome2). | |
552 - 'sessionoptions' is ignored, and a hardcoded set of appropriate flags is | |
553 used instead: > | |
1621 | 554 blank,curdir,folds,globals,help,options,tabpages,winsize |
7 | 555 - The internal variable |v:this_session| is not changed when storing the |
556 session. Also, it is restored to its old value when logging in again. | |
557 | |
558 The position and size of the GUI window is not saved by Vim since doing so | |
559 is the window manager's job. But if compiled with GTK+ 2 support, Vim helps | |
560 the WM to identify the window by restoring the window role (using the |--role| | |
561 command line argument). | |
562 | |
563 ============================================================================== | |
12 | 564 7. KDE version *gui-kde* *kde* *KDE* *KVim* |
1121 | 565 *gui-x11-kde* |
574 | 566 There is no KDE version of Vim. There has been some work on a port using the |
567 Qt toolkit, but it never worked properly and it has been abandoned. Work | |
5697 | 568 continues on Yzis: https://github.com/chrizel/Yzis. |
11 | 569 |
570 ============================================================================== | |
571 8. Compiling *gui-x11-compiling* | |
7 | 572 |
9975
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
573 If using X11, Vim's configure will by default first try to find the necessary |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
574 GTK+ files on your system. When both GTK+ 2 and GTK+ 3 are available, GTK+ 2 |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
575 will be chosen unless --enable-gui=gtk3 is passed explicitly to configure. |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
576 |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
577 If the GTK+ files cannot be found, then the Motif files will be searched for. |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
578 Finally, if this fails, the Athena files will be searched for. If all three |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
579 fail, the GUI will be disabled. |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
580 |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
581 For GTK+, Vim's configuration process uses pkg-config(1) to check if the |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
582 GTK+ required for a specified build is properly installed and usable. |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
583 Accordingly, it is a good idea to make sure before running configure that |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
584 your system has a working pkg-config together with the .pc file of the |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
585 required GTK+. For that, say, run the following on the command line to see if |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
586 your pkg-config works with your GTK+ 2: > |
7 | 587 |
10211
b7da8d4c594c
commit https://github.com/vim/vim/commit/d07969093a9b3051511c478d71c36de6fc33c0d6
Christian Brabandt <cb@256bit.org>
parents:
10198
diff
changeset
|
588 $ pkg-config --modversion gtk+-2.0 |
9975
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
589 |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
590 Replace gtk+-2.0 with gtk+-3.0 for GTK+ 3. If you get the correct version |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
591 number of your GTK+, you can proceed; if not, you probably need to do some |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
592 system administration chores to set up pkg-config and GTK+ correctly. |
7 | 593 |
9975
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
594 The GTK+ 2 GUI is built by default. Therefore, you usually don't need to pass |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
595 any options such as --enable-gui=gtk2 to configure and build that. |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
596 |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
597 Optionally, the GTK+ 2 GUI can consolidate the GNOME 2 support. This support |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
598 is enabled by passing --enable-gnome-check to configure. |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
599 |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
600 If you want to build the GTK+ 3 GUI, you have to pass --enable-gui=gtk3 |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
601 explicitly to configure, and avoid passing --enable-gnome-check to that, as |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
602 the functionality of the GNOME 2 support has already been consolidated in |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
603 GTK+ 3. |
7 | 604 |
605 Otherwise, if you are using Motif or Athena, when you have the Motif or Athena | |
606 files in a directory where configure doesn't look, edit the Makefile to enter | |
607 the names of the directories. Search for "GUI_INC_LOC" for an example to set | |
608 the Motif directories, "CONF_OPT_X" for Athena. | |
609 | |
610 *gui-x11-gtk* | |
9975
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
611 Currently, Vim supports both GTK+ 2 and GTK+ 3. |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
612 |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
613 The GTK+ 2 GUI requires GTK+ 2.2 or later. |
7 | 614 |
9975
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
615 Although the GTK+ 3 GUI is written in such a way that the source code can be |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
616 compiled against all versions of the 3.x series, we recommend GTK+ 3.10 or |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
617 later because of its substantial implementation changes in redraw done at |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
8876
diff
changeset
|
618 that version. |
7 | 619 |
620 *gui-x11-motif* | |
621 For Motif, you need at least Motif version 1.2 and/or X11R5. Motif 2.0 and | |
622 X11R6 are OK. Motif 1.1 and X11R4 might work, no guarantee (there may be a | |
623 few problems, but you might make it compile and run with a bit of work, please | |
624 send me the patches if you do). The newest releases of LessTif have been | |
625 reported to work fine too. | |
626 | |
627 *gui-x11-athena* | |
628 The Athena version uses the Xaw widget set by default. If you have the 3D | |
629 version, you might want to link with Xaw3d instead. This will make the | |
630 menus look a bit better. Edit the Makefile and look for "XAW_LIB". The | |
631 scrollbars will remain the same, because Vim has its own, which are already | |
632 3D (in fact, they look more like Motif). | |
633 | |
634 *gui-x11-neXtaw* | |
635 The neXtaw version is mostly like Athena, but uses different widgets. | |
636 | |
637 *gui-x11-misc* | |
638 In general, do not try to mix files from different GTK+, Motif, Athena and X11 | |
639 versions. This will cause problems. For example, using header files for | |
640 X11R5 with a library for X11R6 probably doesn't work (although the linking | |
641 won't give an error message, Vim will crash later). | |
642 | |
643 ============================================================================== | |
11 | 644 9. X11 selection mechanism *x11-selection* |
7 | 645 |
646 If using X11, in either the GUI or an xterm with an X11-aware Vim, then Vim | |
647 provides varied access to the X11 selection and clipboard. These are accessed | |
648 by using the two selection registers "* and "+. | |
649 | |
650 X11 provides two basic types of global store, selections and cut-buffers, | |
651 which differ in one important aspect: selections are "owned" by an | |
652 application, and disappear when that application (e.g., Vim) exits, thus | |
653 losing the data, whereas cut-buffers, are stored within the X-server itself | |
654 and remain until written over or the X-server exits (e.g., upon logging out). | |
655 | |
656 The contents of selections are held by the originating application (e.g., upon | |
657 a copy), and only passed on to another application when that other application | |
658 asks for them (e.g., upon a paste). | |
659 | |
660 The contents of cut-buffers are immediately written to, and are then | |
661 accessible directly from the X-server, without contacting the originating | |
662 application. | |
663 | |
664 *quoteplus* *quote+* | |
665 There are three documented X selections: PRIMARY (which is expected to | |
666 represent the current visual selection - as in Vim's Visual mode), SECONDARY | |
667 (which is ill-defined) and CLIPBOARD (which is expected to be used for | |
668 cut, copy and paste operations). | |
669 | |
670 Of these three, Vim uses PRIMARY when reading and writing the "* register | |
671 (hence when the X11 selections are available, Vim sets a default value for | |
672 |'clipboard'| of "autoselect"), and CLIPBOARD when reading and writing the "+ | |
673 register. Vim does not access the SECONDARY selection. | |
674 | |
675 Examples: (assuming the default option values) | |
11914 | 676 - Select a URL in Visual mode in Vim. Go to your browser and click the |
2033
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
677 middle mouse button in the URL text field. The selected text will be |
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
678 inserted (hopefully!). Note: in Firefox you can set the |
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
679 middlemouse.contentLoadURL preference to true in about:config, then the |
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
680 selected URL will be used when pressing middle mouse button in most places |
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
681 in the window. |
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
682 - Select some text in your browser by dragging with the mouse. Go to Vim and |
7 | 683 press the middle mouse button: The selected text is inserted. |
2033
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
684 - Select some text in Vim and do "+y. Go to your browser, select some text in |
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
685 a textfield by dragging with the mouse. Now use the right mouse button and |
7 | 686 select "Paste" from the popup menu. The selected text is overwritten by the |
687 text from Vim. | |
688 Note that the text in the "+ register remains available when making a Visual | |
689 selection, which makes other text available in the "* register. That allows | |
690 overwriting selected text. | |
691 *x11-cut-buffer* | |
692 There are, by default, 8 cut-buffers: CUT_BUFFER0 to CUT_BUFFER7. Vim only | |
693 uses CUT_BUFFER0, which is the one that xterm uses by default. | |
694 | |
695 Whenever Vim is about to become unavailable (either via exiting or becoming | |
696 suspended), and thus unable to respond to another application's selection | |
697 request, it writes the contents of any owned selection to CUT_BUFFER0. If the | |
698 "+ CLIPBOARD selection is owned by Vim, then this is written in preference, | |
699 otherwise if the "* PRIMARY selection is owned by Vim, then that is written. | |
700 | |
701 Similarly, when Vim tries to paste from "* or "+ (either explicitly, or, in | |
702 the case of the "* register, when the middle mouse button is clicked), if the | |
703 requested X selection is empty or unavailable, Vim reverts to reading the | |
704 current value of the CUT_BUFFER0. | |
705 | |
706 Note that when text is copied to CUT_BUFFER0 in this way, the type of | |
707 selection (character, line or block) is always lost, even if it is a Vim which | |
708 later pastes it. | |
709 | |
710 Xterm, by default, always writes visible selections to both PRIMARY and | |
711 CUT_BUFFER0. When it pastes, it uses PRIMARY if this is available, or else | |
712 falls back upon CUT_BUFFER0. For this reason, when cutting and pasting | |
713 between Vim and an xterm, you should use the "* register. Xterm doesn't use | |
714 CLIPBOARD, thus the "+ doesn't work with xterm. | |
715 | |
716 Most newer applications will provide their current selection via PRIMARY ("*) | |
717 and use CLIPBOARD ("+) for cut/copy/paste operations. You thus have access to | |
718 both by choosing to use either of the "* or "+ registers. | |
719 | |
720 | |
721 vim:tw=78:sw=4:ts=8:ft=help:norl: |