Commit a9be6836 authored by Ahmed El Gabri's avatar Ahmed El Gabri

zsh: fix hub aliasing & installation

parent e1c0aabd
......@@ -172,6 +172,7 @@ function {
export NODE_VERSIONS="${N_PREFIX}/n/versions/node"
export NODE_VERSION_PREFIX=""
(( $+commands[direnv] )) && eval "$(direnv hook zsh)"
(( $+commands[hub] )) && eval "$(hub alias -s)"
############### Kitty
if [[ ! -z "${KITTY_WINDOW_ID}" ]]; then
......
......@@ -58,13 +58,6 @@ alias r="ranger" # overrides built-in r command
(( $+commands[bat] )) && alias cat='bat '
(( $+commands[python3] )) && alias server="python3 -m http.server 80"
if (( $+commands[hub] )); then
alias git=hub
compdef g=hub
else
compdef g=git
fi
(( $+commands[yarn] )) && alias y=yarn
[[ -x "/Applications/Alacritty.app/Contents/MacOS/alacritty" ]] && alias alacritty='/Applications/Alacritty.app/Contents/MacOS/alacritty'
......@@ -22,13 +22,11 @@ function time_since_last_commit() {
}
function g() {
local __CMD="$(command -v hub || command -v git)"
if [ $# -eq 0 ]; then
printf "%s\n\n" "$(time_since_last_commit)"
"$__CMD" st 2> /dev/null || "$__CMD" status --short --branch
git st 2> /dev/null || git status --short --branch
else
"$__CMD" "$@"
git "$@"
fi
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment