
VimTip478 uses it in a function for copying the results of a :g search into the * register. VimTip448 also uses it (for converting hex to decimal) but explains it in passing.
Man xclipboard code#
VimTip432 and VimTip600 use the * register in some native Vim code (using without explaining it in general. Note: in vim 7.3.74 and higher you can set clipboard=unnamedplus to alias unnamed register to the + register, which is the X Window clipboard. It also mentions that we can change out settings so the "anonymous" register is aliased to the * register using:
Man xclipboard windows#
VimTip21 is spot on but the title suggests it's for MS Windows only. Using the clipboard as the default register VimTip771 and VimTip964 refer to an extra utility named xclip which is only for X11 and seems to be completely unnecessary for Vim using the * register), and VimTip960 (misses the point but the comments mention it a few times). I searched though the tips and found only a few passing references to this feature: VimTip71 (implies it's a feature of gvim, but I find it works in console Vim just fine under Linux I only use gvim under MS Windows). See also pasting registers for more general information about pasting from registers. In general using + and * is much more reliable than using CTRL-SHIFT-V. One distinction to make is that using + and * is different from using CTRL-SHIFT-V on the terminal (or doing a right-click and then selecting "paste" in the terminal menu), where Vim essentially inserts each character in the clipboard one-by-one. :%y * – copy the entire buffer into * (this one is an ex command)."+p – paste from + after the cursor (works in both normal and visual modes)."*dd – cut the current line into * (normal mode).

gg"+yG – copy the entire buffer into + (normal mode).Here are a few common commands that demonstrate this: We can use these registers like any other register. Generally on Linux, + and * are different: + corresponds to the desktop clipboard ( XA_SECONDARY) that is accessed using CTRL-C, CTRL-X, and CTRL-V, while * corresponds to the X11 primary selection ( XA_PRIMARY), which stores the mouse selection and is pasted using the middle mouse button in most applications.


Note that on some systems, + and * are the same, while on others they are different. Vim offers the + and * registers to reference the system clipboard ( :help quoteplus and :help quotestar). Fortunately, in most cases it is easy to get Vim to work with the system clipboard. Note that this is different from what most modern graphical text editors and other applications like web browsers do these applications interact with the system clipboard when using keybindings like CTRL-C, CTRL-X, and CTRL-V. When performing copy, cut, and paste with commands like y, d, and p, by default Vim uses its own location for this, called the unnamed register ( :help quotequote).
