summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/correction.zsh1
-rw-r--r--lib/functions.zsh17
2 files changed, 8 insertions, 10 deletions
diff --git a/lib/correction.zsh b/lib/correction.zsh
index 3e1415a0b..c635236b5 100644
--- a/lib/correction.zsh
+++ b/lib/correction.zsh
@@ -1,4 +1,5 @@
if [[ "$ENABLE_CORRECTION" == "true" ]]; then
+ alias cp='nocorrect cp'
alias ebuild='nocorrect ebuild'
alias gist='nocorrect gist'
alias heroku='nocorrect heroku'
diff --git a/lib/functions.zsh b/lib/functions.zsh
index 7410ae645..1066fed57 100644
--- a/lib/functions.zsh
+++ b/lib/functions.zsh
@@ -11,23 +11,20 @@ function upgrade_oh_my_zsh() {
}
function take() {
- mkdir -p $1
- cd $1
+ mkdir -p $@ && cd ${@:$#}
}
function open_command() {
- emulate -L zsh
- setopt shwordsplit
-
local open_cmd
# define the open command
case "$OSTYPE" in
darwin*) open_cmd='open' ;;
cygwin*) open_cmd='cygstart' ;;
- linux*) [[ $(uname -a) =~ "Microsoft" ]] && \
- open_cmd='cmd.exe /c start' || \
- open_cmd='xdg-open' ;;
+ linux*) ! [[ $(uname -a) =~ "Microsoft" ]] && open_cmd='xdg-open' || {
+ open_cmd='cmd.exe /c start ""'
+ [[ -e "$1" ]] && { 1="$(wslpath -w "${1:a}")" || return 1 }
+ } ;;
msys*) open_cmd='start ""' ;;
*) echo "Platform $OSTYPE not supported"
return 1
@@ -36,9 +33,9 @@ function open_command() {
# don't use nohup on OSX
if [[ "$OSTYPE" == darwin* ]]; then
- $open_cmd "$@" &>/dev/null
+ ${=open_cmd} "$@" &>/dev/null
else
- nohup $open_cmd "$@" &>/dev/null
+ nohup ${=open_cmd} "$@" &>/dev/null
fi
}