*gui_x11.txt*   For Vim version 5.7a.  Last change: 2000 Jan 01


		  VIM REFERENCE MANUAL    by Bram Moolenaar


Vim's Graphical User Interface				*gui-x11* *GUI-X11*
							*Athena* *Motif*
1. Starting the X11 GUI		|gui-x11-start|
2. GUI Resources		|gui-resources|
3. Shell Commands		|gui-pty|
4. Various			|gui-x11-various|
5. GTK version			|gui-gtk|
6. Compiling			|gui-x11-compiling|

Other relevant documentation:
|gui.txt|	For generic items of the GUI.

{Vi does not have any of these commands}

==============================================================================
1. Starting the X11 GUI					*gui-x11-start*

Then you can run the GUI version of Vim in either of these ways:
    gvim [options] [files...]
    vim -g [options] [files...]

So if you call the executable "gvim", or make "gvim" a link to the executable,
then the GUI version will automatically be used.  Additional characters may be
added after "gvim", for example "gvim-5".

You may also start up the GUI from within the terminal version by using one of
these commands:
	:gui [+cmd] [-f|-b] [files...]			*:gu* *:gui*
	:gvim [+cmd] [-f|-b] [files...]			*:gv* *:gvim*
The "-f" option runs Vim in the foreground.
The "-b" option runs Vim in the background (this is the default).

							*gui-fork*
When the GUI is started, it does a fork() and exits the current process.
When gvim was started from a shell this makes the shell accept further
commands.  If you don't want this (e.g. when using gvim for a mail program
that waits for gvim to exit), start gvim with "gvim -f", "vim -gf" or use
":gui -f".  Don't use "vim -fg", because "-fg" specifies the foreground
color.

When using "gvim -f" and then ":gui", Vim will run in the foreground.  The
"-f" argument will be remembered.  To force running Vim in the background use
":gui -b".

If you want the GUI to run in the foreground always, include the 'f'
flag in 'guioptions'.  |-f|.

==============================================================================
2. GUI Resources			*gui-resources* *.Xdefaults*

If using the Motif or Athena version of the GUI (not for the GTK+ or Win32
version), a number of X resources are available.  You should use Vim's class
"Vim" when setting these.  They are as follows:

    Resource name	Meaning		~

    reverseVideo	Boolean: should reverse video be used?
    background		Color of background.
    foreground		Color of normal text.
    scrollBackground	Color of trough portion of scrollbars.
    scrollForeground	Color of slider and arrow portions of scrollbars.
    menuBackground	Color of menu backgrounds.
    menuForeground	Color of menu foregrounds.
    font		Name of font used for normal text.
    boldFont		Name of font used for bold text.
    italicFont		Name of font used for italic text.
    boldItalicFont	Name of font used for bold, italic text.
    geometry		Initial geometry to use for gvim's window (default
			is same size as terminal that started it).
    scrollbarWidth	Thickness of scrollbars.
    menuHeight		Height of the menu bar.
    borderWidth		Thickness of border around text area.

A special font for italic, bold, and italic-bold text will only be used if
the user has specified one via a resource.  No attempt is made to guess what
fonts should be used for these based on the normal text font at the moment.

Note that the colors can also be set with the ":highlight" command, using the
"Normal", "Menu" and "Scrollbar" groups.

							*font-sizes*
Note: All fonts must be of the same size!!!  If you don't do this, text will
disappear or mess up the display.  Vim does not check the font sizes.  It's
the size in screen pixels that must be the same.  Note that some fonts that
have the same point size don't have the same pixel size!  Additionally, the
positioning of the fonts must be the same (ascent and descent).  You can check
this with "xlsfonts -l {fontname}".

If any of these things are also set with Vim commands, eg with
":set guifont=Screen15", then this will override the X resources (currently
'guifont' is the only option that is supported).

Here is an example of what you might put in your ~/.Xdefaults file:

>	Vim*useSchemes:			all
>	Vim*sgiMode:			true
>	Vim*useEnhancedFSB:		true
>	Vim.foreground:			Black
>	Vim.background:			Wheat
>	Vim*fontList:			7x13

The first three of these are standard resources on Silicon Graphics machines
which make Motif applications look even better, highly recommended!

The "Vim*fontList" is to set the menu font for Motif.  Example:
>	Vim*menuBar*fontList:        -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
With Athena:
>	Vim*menuBar*SmeBSB*font:     -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
>	Vim*menuBar*MenuButton*font: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*

Don't use "Vim*geometry" in the defaults.  This will break the menus.  Use
"Vim.geometry" instead.

If you get an error message "Cannot allocate colormap entry for "gray60",
try adding this to your Vim resources (change the colors to your liking):

>	Vim*scrollBackground:		Black
>	Vim*scrollForeground:		Blue

The resources can also be set with arguments to vim:

    argument		meaning	~
							*-gui*
   -display {display}	Run vim on {display}		*-display*
   -iconic		Start vim iconified		*-iconic*
   -background {color}	Use {color} for the background	*-background*
   -bg {color}		idem				*-bg*
   -foreground {color}	Use {color} for normal text	*-foreground*
   -fg {color}		idem				*-fg*
   -ul {color}		idem				*-ul*
   -font {font}		Use {font} for normal text	*-font*
   -fn {font}		idem				*-fn*
   -boldfont {font}	Use {font} for bold text	*-boldfont*
   -italicfont {font}	Use {font} for italic text	*-italicfont*
   -geometry {geom}	Use {geom} for initial geometry	*-geometry*
   -geom {geom}		idem				*-geom*
   -borderwidth {width}	Use a border width of {width}	*-borderwidth*
   -bw {width}		idem				*-bw*
							*-scrollbarwidth*
   -scrollbarwidth {width}	Use a scrollbar width of {width}
   -sw {width}		idem				*-sw*
   -menuheight {height}	Use a menu bar height of {height} *-menuheight*
   -mh {height}		idem				*-mh*
   -reverse		Use reverse video		*-reverse*
   -rv			idem				*-rv*
   +reverse		Don't us                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              