Skip to content

Instantly share code, notes, and snippets.

@mordr
Created September 11, 2024 17:41
Show Gist options
  • Save mordr/67ef6a4ce1b55d2b06863d166336ee70 to your computer and use it in GitHub Desktop.
Save mordr/67ef6a4ce1b55d2b06863d166336ee70 to your computer and use it in GitHub Desktop.
vim: copy file contents to clipboard (OSX)

Copy file contents directly from within vim

:%!tee >(pbcopy)

Alternate options

gg"+yG

VG”+y (assuming cursor at first line, avoids gg)

%y+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment