After enabling set mouse=a
, text copied inside of Vim will not paste outside of Vim. Does anybody know of a way to fix this?
Here, selecting text with t
Use ", +, y after making a visual selection. You shouldn’t be using the terminal’s copy command anyway, because that copies what the terminal sees instead of the actual content. Here is what this does:
+
for the next delete, yank or put. The register named +
is a special register, it is the X11 clipboard register. (On other systems, you would use *
instead, I think, see :help clipboard
and :help x11-selection
)You could map it like this:
:vmap "+y
And then highlight something with the mouse and press Control-C to copy it.
This feature only works when Vim has been compiled with the +xterm_clipboard
option. Run vim --version
to find out if it has.