annotate runtime/doc/gui_x11.txt @ 20753:661eb972cb22

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