Skip to content

Instantly share code, notes, and snippets.

@Johnytran
Last active June 13, 2016 02:20
Show Gist options
  • Save Johnytran/9b20f013f01f14678ae90502b753aaac to your computer and use it in GitHub Desktop.
Save Johnytran/9b20f013f01f14678ae90502b753aaac to your computer and use it in GitHub Desktop.
copy paste text 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
On builds that support it, the register named * is the system clipboard. To copy text from Vim to the system clipboard, you can select the text using visual mode, then press "*y to copy it to the system clipboard.
Conversely, use "*p to paste text from the system clipboard into Vim.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment