mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
universal open plugin
This commit is contained in:
parent
7a9cc19819
commit
104eb8c796
1 changed files with 24 additions and 0 deletions
24
open/open.plugin.zsh
Normal file
24
open/open.plugin.zsh
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue