71 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			71 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
# shellcheck disable=SC2148
 | 
						|
system_type=$(uname -s)
 | 
						|
 | 
						|
# aliases
 | 
						|
alias less="bat -p"
 | 
						|
alias more=less
 | 
						|
alias mroe=more
 | 
						|
alias tk=take
 | 
						|
alias top10="print -l -- \${(o)history%% *} | uniq -c | sort -nr | head -n 10"
 | 
						|
alias zsh-plugins="ls \$ZPLUGINDIR"
 | 
						|
alias vi=nvim
 | 
						|
 | 
						|
# git aliases
 | 
						|
alias g=git
 | 
						|
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'
 | 
						|
alias gp='g push'
 | 
						|
 | 
						|
# YADM aliases
 | 
						|
alias y="yadm"
 | 
						|
alias ys="y status"
 | 
						|
alias ysu="ys -u"
 | 
						|
alias yg='y grep'
 | 
						|
alias yd='y diff'
 | 
						|
alias ya='y add'
 | 
						|
alias yap='ya -p'
 | 
						|
alias yc='y commit'
 | 
						|
alias yp='y push'
 | 
						|
 | 
						|
# Homebrew aliases
 | 
						|
alias b="brew"
 | 
						|
alias bi="b info"
 | 
						|
alias bin="b install"
 | 
						|
alias bu="b uninstall"
 | 
						|
alias brm="bu"
 | 
						|
alias bs="b search"
 | 
						|
alias bv="brew-visit" # a function defined elsewhere
 | 
						|
 | 
						|
# 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" # unneeded, handled by fdellwing/zsh-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
 | 
						|
 | 
						|
if [ -e "${0:a:h}"/aliases.local ]; then
 | 
						|
	# omg shut up shellcheck
 | 
						|
	# shellcheck source=/dev/null
 | 
						|
	source "${0:a:h}"/aliases.local
 | 
						|
else
 | 
						|
	echo "Couldn't find ${0:a:h}/aliases.local!"
 | 
						|
fi
 |