Vim's Graphical User Interface | | |
*gui.txt* For Vim version 7.2. Last change: 2008 Jun 14 | | |
VIM REFERENCE MANUAL by Bram Moolenaar | | |
Vim's Graphical User Interface *gui* *GUI* | | |
1. Starting the GUI |gui-start| 2. Scrollbars |gui-scrollbars| 3. Mouse Control |gui-mouse| 4. Making GUI Selections |gui-selections| 5. Menus |menus| 6. Extras |gui-extras| 7. Shell Commands |gui-shell| | | |
Other GUI documentation: |gui_x11.txt| For specific items of the X11 GUI. |gui_w32.txt| For specific items of the Win32 GUI. | | |
{Vi does not have any of these commands} | | |
============================================================================== 1. Starting the GUI *gui-start* *E229* *E233* | | |
First you must make sure you actually have a version of Vim with the GUI code included. You can check this with the ":version" command, it says "with xxx GUI", where "xxx" is X11-Motif, X11-Athena, Photon, GTK, GTK2, etc., or "MS-Windows 32 bit GUI version". | | |
How to start the GUI depends on the system used. Mostly you can run the GUI version of Vim with: gvim [options] [files...] | | |
The X11 version of Vim can run both in GUI and in non-GUI mode. See |gui-x11-start|. | | |
*gui-init* *gvimrc* *.gvimrc* *_gvimrc* The gvimrc file is where GUI-specific startup commands should be placed. It is always sourced after the |vimrc| file. If you have one then the $MYGVIMRC environment variable has its name. | | |
When the GUI starts up initializations are carried out, in this order: - The 'term' option is set to "builgin_gui" and terminal options are reset to their default value for the GUI |terminal-options|. - If the system menu file exists, it is sourced. The name of this file is normally "$VIMRUNTIME/menu.vim". You can check this with ":version". Also see |$VIMRUNTIME|. To skip loading the system menu include 'M' in 'guioptions'. *buffers-menu* *no_buffers_menu* The system menu file includes a "Buffers" menu. If you don't want this, set the "no_buffers_menu" variable in your .vimrc (not .gvimrc!): > :let no_buffers_menu = 1 < NOTE: Switching on syntax highlighting also loads the menu file, thus disabling the Buffers menu must be done before ":syntax on". The path names are truncated to 35 characters. You can truncate them at a different length, for example 50, like this: > :let bmenu_max_pathlen = 50 - If the "-U {gvimrc}" command-line option has been used when starting Vim, the {gvimrc} file will be read for initializations. The following initializations are skipped. When {gvimrc} is "NONE" no file will be read for initializations. - For Unix and MS-Windows, if the system gvimrc exists, it is sourced. The name of this file is normally "$VIM/gvimrc". You can check this with ":version". Also see |$VIM|. - The following are tried, and only the first one that exists is used: - If the GVIMINIT environment variable exists and is not empty, it is executed as an Ex command. - If the user gvimrc file exists, it is sourced. The name of this file is normally "$HOME/.gvimrc". You can check this with ":version". - For Win32, when $HOME is not set, "$VIM\_gvimrc" is used. - When a "_gvimrc" file is not found, ".gvimrc" is tried too. And vice versa. The name of the first file found is stored in $MYGVIMRC, unless it was already set. - If the 'exrc' option is set (which is NOT the default) the file ./.gvimrc is sourced, if it exists and isn't the same file as the system or user gvimrc file. If this file is not owned by you, some security restrictions apply. When ".gvimrc" is not found, "_gvimrc" is tried too. For Macintosh and DOS/Win32 "_gvimrc" is tried first. | | |