Copy all the lines to clipboard

Use:

:%y+

to yank all lines.

Explanation:

  • % to refer the next command to work on all the lines
  • y to yank those lines
  • + to copy to the system clipboard

NB: In Windows, + and * are equivalent see this answer.

Leave a Comment