*gui_w16.txt*   For Vim version 6.0c.  Last change: 2000 Jul 07


		  VIM REFERENCE MANUAL    by Bram Moolenaar


Vim's Graphical User Interface				*gui-w16* *win16-gui*

1. Starting the GUI		|gui-w16-start|
2. Vim as default editor	|vim-default-editor|
3. Using the clipboard		|gui-clipboard|
4. Shell Commands		|gui-shell-win16|
5. Special colors		|win16-colors|
6. Windows dialogs & browsers	|gui-w16-dialogs|
7. Various			|gui-w16-various|

Other relevant documentation:
|gui.txt|	For generic items of the GUI.
|os_msdos.txt|  For items common to DOS and Windows.

{Vi does not have a Windows GUI}

==============================================================================
1. Starting the GUI					*gui-w16-start*

The Win16 GUI version of Vim will always start the GUI, no matter how you
start it or what it's called. There is no 'console' version as such, but you
can use one of the DOS versions in a DOS box.

The Win16 GUI has an extra menu item:  "Window/Select Font".  It brings up the
standard Windows font selector. Note that bold and italic fonts are not
supported in an attempt to maximise GDI drawing speed.

Setting the menu height doesn't work for the Win16 GUI.

							*gui-win16-maximized*
If you want Vim to start with a maximized window, add this command to your
vimrc or gvimrc file: >
	au GUIEnter * simalt ~x
<
								*gui-w32s*
There is a specific version of gvim.exe that runs under the Win32s subsystem
of Windows 3.1 or 3.11.  See |win32s|.

==============================================================================
2. Vim as default editor				*vim-default-editor*

To set Vim as the default editor for a file type you can use File Manager's
"Associate" feature.

When you open a file in Vim by double clicking it, Vim changes to that
file's directory.

						*notepad*
You could replace notepad.exe with gvim.exe, but that has a few side effects.
For example, some programs rely on notepad arguments, which are not recognized
by Vim.  And Vim uses notepad for printing.  You could fix that by adjusting
the File/Print menu item, but if other applications also use notepad for
printing, that will fail.  It's better to leave notepad where it is and use
another way to start Vim.


==============================================================================
3. Using the clipboard					*gui-clipboard*

Windows has a clipboard, where you can copy text to, and paste text from.  Vim
supports this in several ways.  For other systems see |gui-selections|.

The "* register reflects the contents of the clipboard.  |quotestar|

When the "unnamed" string is included in the 'clipboard' option, the unnamed
register is the same.  Thus you can yank to and paste from the clipboard
without prepending "* to commands.

The 'a' flag in 'guioptions' is not included by default.  This means that text
is only put on the clipboard when an operation is performed on it.  Just
Visually selecting text doesn't put it on the clipboard.  When the 'a' flag is
included, the text is copied to the clipboard even when it is not operated
upon.

To use the standard MS-Windows way of CTRL-X, CTRL-C and CTRL-V, use the
$VIMRUNTIME/mswin.vim script.  You could add this line to your _vimrc file: >
	source $VIMRUNTIME/mswin.vim

Since CTRL-C is used to copy the text to the clipboard, it can't be used to
cancel an operation.  Use CTRL-Break for that.

							*CTRL-V-alternative*
Since CTRL-V is used to paste, you can't use it to start a blockwise Visual
selection.  You can use CTRL-Q instead.  You can also use CTRL-Q in Insert
mode and Command-line mode to get the old meaning of CTRL-V.

NOTE: The clipboard support still has a number of bugs.  See |todo|.

==============================================================================
4. Shell Commands					*gui-shell-win16*

Vim spawns a DOS window for external commands, to make it possible to run any
DOS command. The window uses the _default.pif settings.

							*win16-!start*
Normally, Vim waits for a command to complete before continuing (this makes
sense for most shell commands which produce output for Vim to use).  If you
want Vim to start a program and return immediately, you can use the following
syntax:
	:!start {command}
This may only work for a Windows program though.
Don't forget that you must tell Windows 3.1x to keep executing a DOS command
in the background while you switch back to Vim.

==============================================================================
5. Special colors					*win16-colors*

On Win16, the normal DOS colors can be used.  See |dos-colors|.

Additionally the system configured colors can also be used.  These are known
by the names Sys_XXX, where XXX is the appropriate system color name, from the
following list (see the Win32 documentation for full descriptions).  Case is
ignored.

Sys_BTNFace		Sys_BTNShadow			Sys_ActiveBorder
Sys_ActiveCaption	Sys_AppWorkspace		Sys_Background		
Sys_BTNText		Sys_CaptionText			Sys_GrayText
Sys_Highlight		Sys_HighlightText		Sys_InactiveBorder
Sys_InactiveCaption	Sys_InactiveCaptionText		Sys_Menu
Sys_MenuText		Sys_ScrollBar			Sys_Window
Sys_WindowFrame		Sys_WindowText

Probably the most useful values are
	Sys_Window	    Normal window background
	Sys_WindowText      Normal window text
	Sys_Highlight       Highlighted background
	Sys_HighlightText   Highlighted text

These extra colors are also available:
Gray, Grey, LightYellow, SeaGreen, Orange, Purple, SlateBlue, Violet,

								*rgb.txt*
Additionally, colors defined by a "rgb.txt" file can be used.  This file is
well known from X11.  A few lines from it: >

  255 218 185		   peach puff
  205 133  63		   peru
  255 181 197		   pink

This shows the layout of the file:  First the R, G and B value as a decimal
number, followed by the name of the color.  The four fields are separated by
spaces.

You can get an rgb.txt file from any X11 distribution.  It is located in a
directory like "/usr/X11R6/lib/X11/".  For Vim it must be located in the
$VIMRUNTIME directory.  Thus the file can be found with "$VIMRUNTIME/rgb.txt".

==============================================================================
						*gui-w16-dialogs* *dialog*
6. Windows dialogs & browsers

The Win16 GUI can use familiar Windows components for some operations, as well
as the traditional interface shared with the console version.


6.1 Dialogs

The dialogs displayed by the "confirm" family (i.e. the 'confirm' option,
|:confirm| command and |confirm()| function are GUI-based rather than the
console-based ones used by other versions.  There is no option to change this.


6.2 File Browsers

When prepending ":browse" before file editing commands, a file requester is
used to allow you to select an existing file.  See |:browse|.


==============================================================================
7. Various						*gui-w16-various*

							*gui-w16-printing*
The "File/Print" menu uses Notepad to print the current buffer.  This is a bit
clumsy, but it's portable.  If you want something else, you can define your
own print command.  For example, you could replace Notepad with Editpad
(www.tornado.be/~johnfg).  See $VIMRUNTIME/menu.vim for how it works by
default.

Using this should also work: >
	:w >>prn

Vim supports a number of standard MS Windows features. Some of these are
detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
Also see |:simalt|

							*drag-n-drop-win16*
You can drag and drop one or more files into the vim window, where they will
be opened as normal.  If you hold down Shift while doing this, Vim changes to
the (first) dropped file's directory.  If you hold Ctrl Vim will always split
a new window for the file.  Otherwise it's only done if the current buffer has
been changed.
You can also drop a directory's icon, but rather than open all files in the
directory (which wouldn't usually be what you want) Vim instead changes to
that directory and begins a new file.
If Vim happens to be editing a command line, the names of the dropped files
and directories will be inserted at the cursor.  This allows you to use these
names with any Ex command.

 vim:tw=78:sw=4
