$ cat ~/projects/foo/somefile.js | xclip
(paste into browser)
$ cat ~/projects/foo/somefile.js | xclipmd
(paste into markdowncompatible website like slackchat etc)
or in console vim, do a visual selection and then press : and type .! xclipmd:
(and paste into slack etc)
$ cd ~/bin
$ wget "https://gist.github.com/coderofsalvation/7ff980326e9f75261eee8f8e0896ac3b/raw/1353c3e57598c1ad6c3b44359d9c8f79a5a6433b/xclip"
$ wget "https://gist.github.com/coderofsalvation/7ff980326e9f75261eee8f8e0896ac3b/raw/68c86602127e14adb58b2fd248608af2df878fae/xclipmd"
$ chmod 755 xclip xclipmd
Hmm... a little elaborate. I just do
echo "alias clip='pbcopy'" >> ~/.bash_profile && . ~/.bash_profileonce on a mac and the I can usecat whatever.txt | clipto copy text from the terminal to the clip-board, always.clipworks the same on Windows for parity and less typing...