Current wasavi behavior (on Chrome on Ubuntu): "+
pastes from somewhere that I don't understand, and "*
pastes from the CLIPBOARD. This is confusing and different than Vim's behavior:
There are three documented X selections: PRIMARY (which is expected to represent the current visual selection - as in Vim's Visual mode), SECONDARY (which is ill-defined) and CLIPBOARD (which is expected to be used for cut, copy and paste operations).
Of these three, Vim uses PRIMARY when reading and writing the "* register (hence when the X11 selections are available, Vim sets a default value for |'clipboard'| of "autoselect"), and CLIPBOARD when reading and writing the "+ register. Vim does not access the SECONDARY selection.
http://vimdoc.sourceforge.net/htmldoc/gui_x11.html#x11-selection
Quick glossary: PRIMARY contains the currently selected text (from any X11 application) and can be pasted anywhere using middle-click; while CLIPBOARD contains the Ctrl+C text (also from right-click → Copy) and can be pasted with Ctrl+V text (also from right-click → Paste).
So, I'd suggest mapping the star register to the currently selected text, and the + register to the CLIPBOARD. See also: http://vimdoc.sourceforge.net/htmldoc/gui.html#quotestar
Alternatively, some people might prefer to map both star and plus to the clipboard.
Ideally, wasavi should map star and plus to PRIMARY and CLIPBOARD, but I guess that a browser extension can only access the CLIPBOARD.
Still confused? Read this: http://www.jwz.org/doc/x-cut-and-paste.html
It will explain X11 CLIPBOARD and PRIMARY in a easy-to-understand way.
How to reproduce:
- Select some text anywhere. (the text is now in PRIMARY)
- Ctrl+C to copy the text to the CLIPBOARD.
- Select other text anywhere. (the text now replaces PRIMARY)
- Now, PRIMARY and CLIPBOARD are different.
- Try using
"+p
and "*p
in wasavi and in vim/gvim. Notice the different behavior.