summaryrefslogtreecommitdiff
path: root/plugins/copyfile
diff options
context:
space:
mode:
authorAndrew Janke <andrew@apjanke.net>2015-08-17 22:53:45 -0400
committerAndrew Janke <andrew@apjanke.net>2015-08-18 03:49:51 -0400
commit5c8b0cc0c1782b34790548498018fb9e0300992b (patch)
treefe9f02d629f970470369ef7f2f6938589277db16 /plugins/copyfile
parent192de6bcffb0294e19f4203f6f7dc1a7f3e427be (diff)
downloadzsh-5c8b0cc0c1782b34790548498018fb9e0300992b.tar.gz
zsh-5c8b0cc0c1782b34790548498018fb9e0300992b.tar.bz2
zsh-5c8b0cc0c1782b34790548498018fb9e0300992b.zip
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.
Diffstat (limited to 'plugins/copyfile')
-rw-r--r--plugins/copyfile/copyfile.plugin.zsh8
1 files changed, 5 insertions, 3 deletions
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 <file>
function copyfile {
- [[ "$#" != 1 ]] && return 1
- local file_to_copy=$1
- cat $file_to_copy | pbcopy
+ emulate -L zsh
+ clipcopy $1
}