universal open plugin

This commit is contained in:
Antonio 2011-01-14 07:42:51 +01:00
commit 104eb8c796

24
open/open.plugin.zsh Normal file
View file

@ -0,0 +1,24 @@
# Universal file opener
case "$OSTYPE" in
cygwin)
opener="cygstart"
;;
linux*)
opener="xdg-open"
;;
darwin*)
opener="open"
;;
*)
opener=""
;;
esac
function o {
for i in $*; do
if [ "$opener" != "" ]; then
$opener "$i"
fi
done
}