Having a chunk of text selected in Vim's visual mode, I'd like to copy that to the system's clipboard (be it the primary or X11's). Is there an easy solution for this? Obviously, a simple
y doesn't do the trick.
you have to yank it to the clipboard register
The visual selection (v, V, or CTRL-V) can automatically be copied to the X11 selection (* buffer).
In non-gui mode the clipboard option controls this (only supported if +xterm_clipboard appears when you type vim --version). In gui mode guioptions controls it.
This makes all Visual mode selections automatically go to the X11 primary selection:
This turns it off:
See help 'clipboard' (single quotes required)