Vim’s Graphical User Interface :help gui
- Starting the GUI gui-start
- Scrollbars gui-scrollbars
- Mouse Control gui-mouse 4. Making GUI Selections gui-selections
- Menus menus
- Font gui-font
- Extras gui-extras
- 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.
4. Making GUI Selections
clipboard
There is a special register for storing this selection, it is the "* register. Nothing is put in here unless the information about what text is selected is about to change (e.g. with a left mouse click somewhere), or when another application wants to paste the selected text. Then the text is put in the "* register. For example, to cut a line and make it the current selection/put it on the clipboard:
"*dd
Similary, when you want to paste a selection from another application, e.g., by clicking the middle mouse button, the selection is put in the "* register first, and then put like any other register. For example, to put the selection (contents of the clipboard):
"*p
When using this register under X11, also see x11-selection. This also explains the related "* register.
Note that when pasting text from one Vim into another separate Vim, the type of selections (character, line, or block) will also be copied. For other applications the type is always character. However, if the text gets transferred via the x11-cut-buffer, the selection type is ALWAYS lost.
When the unnamed string is include in the clipboard option, the unnamed register is the same as the "* register. Thus you can yank to and paste the selection without prepending "* to commands.