Add clipcopy() and clippaste() generic cross-platform CLI clipboard functions.

Change copydir, copyfile, and coffee plugins to use them, instead of the Mac-only `pbcopy` command.
This commit is contained in:
Andrew Janke committed 2015-08-18 03:49:51 -04:00
1 parent 192de6bcff
commit 5c8b0cc0c1
4 files changed
+80 -9

No files matched your search

+5 -3
View File
@@ -1,5 +1,7 @@
# Copies the contents of a given file to the system or X Windows clipboard
#
# copyfile <file>
function copyfile {
[[ "$#" != 1 ]] && return 1
local file_to_copy=$1
cat $file_to_copy | pbcopy
emulate -L zsh
clipcopy $1
}