2021-06-27 16:27:40 +00:00
|
|
|
|
# Rename existing tools
|
|
|
|
|
alias _cat=`which cat`
|
|
|
|
|
alias _curl=`which curl`
|
|
|
|
|
alias _ls="/bin/ls"
|
|
|
|
|
alias _grep="/bin/grep"
|
2021-11-29 08:07:17 +00:00
|
|
|
|
alias _diff="/usr/bin/diff"
|
2021-06-27 16:27:40 +00:00
|
|
|
|
alias _du=`which du`
|
|
|
|
|
alias _df=`which df`
|
|
|
|
|
alias _find=`which find`
|
|
|
|
|
alias _top=`which top`
|
|
|
|
|
alias _ps="/bin/ps"
|
|
|
|
|
alias _dig=`which dig`
|
2021-12-03 17:12:52 +00:00
|
|
|
|
alias _readlink=`which readlink`
|
2022-09-10 18:44:22 +00:00
|
|
|
|
alias _git=`which git`
|
|
|
|
|
if command -v $(brew --prefix)/bin/git &>/dev/null; then
|
|
|
|
|
alias _git=$(brew --prefix)/bin/git
|
|
|
|
|
fi
|
2021-06-27 16:27:40 +00:00
|
|
|
|
|
2020-09-07 08:30:43 +00:00
|
|
|
|
# Aliases
|
2021-11-29 08:07:17 +00:00
|
|
|
|
alias cat='bat '
|
2020-09-07 08:30:43 +00:00
|
|
|
|
alias curl='curlie'
|
2021-11-29 08:07:17 +00:00
|
|
|
|
alias ls='exa --group-directories-first --icons --header --git --ignore-glob=.git'
|
2021-06-27 16:27:40 +00:00
|
|
|
|
alias grep='rg'
|
|
|
|
|
alias diff='delta'
|
|
|
|
|
alias du='dust'
|
|
|
|
|
alias df='duf -hide special'
|
|
|
|
|
alias find='fd'
|
2022-09-18 10:25:31 +00:00
|
|
|
|
alias find-empty-dirs='fd --type empty --type directory'
|
2021-06-27 16:27:40 +00:00
|
|
|
|
alias bandwhich='sudo bandwhich'
|
|
|
|
|
alias top='btm'
|
|
|
|
|
alias ps='procs'
|
2022-09-08 16:56:38 +00:00
|
|
|
|
alias dig='doggo'
|
2021-10-14 09:11:17 +00:00
|
|
|
|
alias kubectx='switch'
|
|
|
|
|
alias kctx='switch'
|
2021-06-27 16:27:40 +00:00
|
|
|
|
alias machine-info='macchina -t Boron --bar'
|
|
|
|
|
alias watch='watch '
|
|
|
|
|
alias tmp='cd $(mktemp -d)'
|
2021-12-03 17:12:52 +00:00
|
|
|
|
which greadlink &>/dev/null && alias readlink=`which greadlink`
|
2021-11-29 08:07:17 +00:00
|
|
|
|
|
2020-09-07 08:30:43 +00:00
|
|
|
|
lt() {
|
|
|
|
|
DEPTH=$(echo $1 | grep "^[0-9]*$")
|
2020-09-27 18:58:44 +00:00
|
|
|
|
if [ "$DEPTH" = "" ]; then
|
2020-09-07 08:30:43 +00:00
|
|
|
|
DEPTH=2
|
|
|
|
|
else
|
|
|
|
|
shift
|
|
|
|
|
fi
|
2020-09-27 18:58:44 +00:00
|
|
|
|
ls -l --tree -L $DEPTH -I ".git|cache|log|logs|node_modules|vendor" $@
|
2020-09-07 08:30:43 +00:00
|
|
|
|
}
|
2021-05-16 11:01:32 +00:00
|
|
|
|
|
2021-10-14 09:11:17 +00:00
|
|
|
|
git() {
|
2021-11-29 08:07:17 +00:00
|
|
|
|
if [ "$1" = "take" ]; then # Git clone then cd into new directory
|
2021-12-03 18:42:46 +00:00
|
|
|
|
if [ $# -gt 2 ]; then
|
|
|
|
|
_git clone ${@:2}
|
|
|
|
|
cd $3
|
|
|
|
|
else
|
|
|
|
|
ORG=$(echo $2 | sed -e 's|https://||' -e 's|/| |g' -e 's|:| |g' | cut -f 2 -d ' ')
|
|
|
|
|
REPO=$(echo $2 | sed -e 's|https://||' -e 's|/| |g' -e 's|:| |g' | cut -f 3 -d ' ' | xargs basename -s .git)
|
|
|
|
|
|
|
|
|
|
DST="${HOME}/Code/${ORG}/${REPO}"
|
|
|
|
|
mkdir -p ${DST}
|
|
|
|
|
|
|
|
|
|
_git clone $2 ${DST}
|
|
|
|
|
cd ${DST}
|
|
|
|
|
fi
|
2021-11-29 08:07:17 +00:00
|
|
|
|
elif [ "$1" = "commit" ]; then # Sign all commits
|
2021-10-14 15:30:23 +00:00
|
|
|
|
shift
|
2021-11-29 08:07:17 +00:00
|
|
|
|
_git commit -s $@
|
2022-03-28 09:51:53 +00:00
|
|
|
|
elif [ "$1" = "co" ]; then # Sign all commits
|
|
|
|
|
shift
|
|
|
|
|
_git checkout -b $@
|
2021-10-14 09:11:17 +00:00
|
|
|
|
else
|
2021-11-29 08:07:17 +00:00
|
|
|
|
_git $@
|
2021-10-14 09:11:17 +00:00
|
|
|
|
fi
|
2021-05-16 11:01:32 +00:00
|
|
|
|
}
|
2021-11-29 08:07:17 +00:00
|
|
|
|
|