2024-10-29 22:57:09 -05:00
|
|
|
system_type=$(uname -s)
|
|
|
|
|
2024-10-29 18:12:34 -05:00
|
|
|
# aliases
|
|
|
|
alias more=less
|
2024-10-29 22:57:09 -05:00
|
|
|
alias mroe=more
|
2024-10-29 18:12:34 -05:00
|
|
|
alias tk=take
|
|
|
|
alias top10="print -l -- \${(o)history%% *} | uniq -c | sort -nr | head -n 10"
|
|
|
|
alias zsh-plugins="ls \$ZPLUGINDIR"
|
2024-10-29 22:57:09 -05:00
|
|
|
alias vi=nvim
|
2024-10-29 18:12:34 -05:00
|
|
|
|
|
|
|
# git aliases
|
|
|
|
alias g=git
|
2024-10-29 22:57:09 -05:00
|
|
|
alias gi=g
|
|
|
|
alias gg='g grep'
|
|
|
|
alias gs='g status'
|
|
|
|
alias gd='g diff'
|
|
|
|
alias ga='g add'
|
|
|
|
alias gap='ga -p'
|
|
|
|
alias gc='g commit'
|
2024-10-29 23:03:07 -05:00
|
|
|
alias gp='g push'
|
2024-10-29 18:12:34 -05:00
|
|
|
|
|
|
|
# YADM aliases
|
|
|
|
alias y="yadm"
|
|
|
|
alias ys="y status"
|
|
|
|
alias ysu="ys -u"
|
|
|
|
alias yg='y grep'
|
|
|
|
alias yd='y diff'
|
2024-10-29 22:57:09 -05:00
|
|
|
alias ya='y add'
|
|
|
|
alias yap='ya -p'
|
|
|
|
alias yc='y commit'
|
2024-10-29 23:03:07 -05:00
|
|
|
alias yp='y push'
|
2024-10-29 18:12:34 -05:00
|
|
|
|
|
|
|
# Homebrew aliases
|
|
|
|
alias b="brew"
|
|
|
|
alias bi="b info"
|
|
|
|
alias bin="b install"
|
2024-10-29 22:57:09 -05:00
|
|
|
alias bu="b uninstall"
|
|
|
|
alias brm="bu"
|
2024-10-29 18:12:34 -05:00
|
|
|
alias bs="b search"
|
2024-10-29 22:57:09 -05:00
|
|
|
alias bv="brew-visit" # a function defined elsewhere
|
2024-10-29 18:12:34 -05:00
|
|
|
|
|
|
|
# These depend on some installed packages, so just to be safe
|
|
|
|
alias ls="ls -F"
|
|
|
|
[[ "$(command -v lsd)" ]] && alias ls="lsd -F"
|
|
|
|
[[ "$(command -v bat)" ]] && alias cat="bat"
|
|
|
|
[[ "$(command -v htop)" ]] && alias top="htop"
|
|
|
|
[[ "$(command -v duf)" ]] && alias df="duf"
|
|
|
|
|
|
|
|
# Toggle hidden files in Finder
|
|
|
|
alias showhidden='defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder'
|
|
|
|
alias hidehidden='defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder'
|
|
|
|
|
|
|
|
# For passing github token to gh
|
|
|
|
alias gh="op plugin run -- gh"
|
|
|
|
|
|
|
|
if [ "$system_type" = "Darwin" ]; then
|
|
|
|
# Open iTerm from VS Code terminal
|
|
|
|
# May refactor this to make the alias available in all non-iTerm terminals
|
|
|
|
[ ! -v "$IN_VS_CODE_TERMINAL" ] && alias iterm="open -a iTerm"
|
|
|
|
fi
|
|
|
|
|
2024-10-30 13:35:16 -05:00
|
|
|
if [ -e "${0:a:h}"/aliases.local ]; then
|
|
|
|
source "${0:a:h}"/aliases.local
|
|
|
|
else
|
|
|
|
echo "$(pwd): Couldn't find aliases.local!"
|
|
|
|
echo "Maybe: ${0:a:h}/aliases.local"
|
2024-10-29 18:12:34 -05:00
|
|
|
fi
|