0

I want to map vv to paste my highlighted text clipboard as opposed to vim's clipboard or the copy clipboard. Is this possible?

6

Note: This only applies in unix with X11 environments.

The "highlighted text" clipboard is known as the PRIMARY X selection (vs SECONDARY or CLIPBOARD X selections). Vim, when built with X support, provides access to the PRIMARY and CLIPBOARD selections via the registers *, +

(you can find more information in :help quoteplus and :help quotestar)

So, to map pasting highlighted text, you might do something like this:

:nnoremap vv "*p

though, that mapping only saves one keystroke at the expense of toggling visual mode. You could just type "*p or "*P

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.