From 5c8b0cc0c1782b34790548498018fb9e0300992b Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Mon, 17 Aug 2015 22:53:45 -0400 Subject: 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. --- plugins/copyfile/copyfile.plugin.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins/copyfile') diff --git a/plugins/copyfile/copyfile.plugin.zsh b/plugins/copyfile/copyfile.plugin.zsh index 944a903c6..f4eca5acf 100644 --- a/plugins/copyfile/copyfile.plugin.zsh +++ b/plugins/copyfile/copyfile.plugin.zsh @@ -1,5 +1,7 @@ +# Copies the contents of a given file to the system or X Windows clipboard +# +# copyfile function copyfile { - [[ "$#" != 1 ]] && return 1 - local file_to_copy=$1 - cat $file_to_copy | pbcopy + emulate -L zsh + clipcopy $1 } -- cgit v1.2.3-70-g09d2