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