Copy all the lines to clipboard
Use:
:%y+
to yank all lines.
Explanation:
%
to refer the next command to work on all the linesy
to yank those lines+
to copy to the system clipboard
NB: In Windows, +
and *
are equivalent see this answer.
You should yank the text to the *
or +
registers:
gg"*yG
Explanation:
gg
to get the cursor to the first character of the file"*y
to start a yank command to the register*
from the first line, until...G
to go the end of the file