2020-05-23 10:10:24 +02:00
|
|
|
_exists() { (( $+commands[$1] )) }
|
|
|
|
|
2024-10-28 12:31:50 +01:00
|
|
|
_exists less && export PAGER=less
|
2020-05-23 10:10:24 +02:00
|
|
|
|
2024-10-28 18:30:37 +01:00
|
|
|
# vim
|
2020-05-23 10:10:24 +02:00
|
|
|
if _exists vim; then
|
2020-06-09 21:17:38 +02:00
|
|
|
export EDITOR=vim
|
|
|
|
alias vim="vim -p"
|
2020-05-23 10:10:24 +02:00
|
|
|
fi
|
|
|
|
|
2024-10-28 18:30:37 +01:00
|
|
|
# ls/eza
|
2024-10-28 12:31:50 +01:00
|
|
|
if _exists eza; then
|
|
|
|
alias eza="eza --color --icons --git"
|
|
|
|
alias ls="eza"
|
|
|
|
fi
|
|
|
|
|
2024-10-28 18:30:37 +01:00
|
|
|
# fetch
|
|
|
|
if ! _exists fetch; then
|
|
|
|
if _exists curl; then
|
|
|
|
alias fetch="curl -O"
|
|
|
|
elif _exists curl; then
|
|
|
|
alias fetch="wget"
|
|
|
|
else
|
|
|
|
echo "fetch not found."
|
|
|
|
fi
|
|
|
|
fi
|
2020-05-23 10:10:24 +02:00
|
|
|
|
2024-10-28 18:30:37 +01:00
|
|
|
# htop
|
|
|
|
if _exists htop; then
|
|
|
|
alias htop="sudo htop"
|
|
|
|
fi
|
|
|
|
|
|
|
|
unfunction _exists
|
2024-10-28 12:31:50 +01:00
|
|
|
|
2020-10-11 16:06:46 +02:00
|
|
|
alias mkdir="mkdir -p"
|
2024-10-28 12:31:50 +01:00
|
|
|
alias ..="cd .."
|
2020-10-11 16:06:46 +02:00
|
|
|
alias ...="cd ../.."
|
2024-10-28 12:31:50 +01:00
|
|
|
alias ....="cd ../../.."
|
2020-10-11 16:06:46 +02:00
|
|
|
alias google="ping -c 10240000 google.com"
|
|
|
|
alias history="history -i"
|
2019-02-15 23:10:39 +01:00
|
|
|
|
|
|
|
case `uname` in
|
|
|
|
Darwin)
|
|
|
|
# commands for OS X go here
|
2021-01-23 21:23:44 +01:00
|
|
|
alias flushdns="sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder"
|
2020-10-11 16:06:46 +02:00
|
|
|
alias r="open -a"
|
2019-02-15 23:10:39 +01:00
|
|
|
;;
|
|
|
|
Linux)
|
|
|
|
# commands for Linux go here
|
|
|
|
;;
|
|
|
|
FreeBSD)
|
|
|
|
# commands for FreeBSD go here
|
2020-06-02 15:59:14 +02:00
|
|
|
alias stl="sockstat -l"
|
2021-10-17 22:19:05 +02:00
|
|
|
alias ziostat="cmdwatch -n 1 zpool iostat -vy 1 1"
|
2019-02-15 23:10:39 +01:00
|
|
|
;;
|
|
|
|
esac
|