dotfiles/zsh/func/init_rc_darwin

51 lines
1.2 KiB
Text
Raw Normal View History

2021-12-31 11:54:55 -08:00
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
autoload -Uz binary_exists
2021-12-31 11:54:55 -08:00
alias acls='command ls -le'
2021-12-31 11:54:55 -08:00
# These things might have been installed by Homebrew, and I like the GNU
# versions better.
binary_exists gdircolors && alias dircolors='gdircolors'
binary_exists gfind && alias find='gfind'
binary_exists gnuindent && alias indent='gnuindent'
2021-12-31 11:54:55 -08:00
binary_exists gls && init_rc_configure_ls `which gls`
2021-12-31 11:54:55 -08:00
# ldd doesn't exist on OS X, but otool -L does the same thing.
alias ldd='otool -L'
2021-12-31 11:54:55 -08:00
# From macOS's system zshrc.
# Disable the log builtin, so we don't conflict with /usr/bin/log
disable log
local sounds=/System/Library/Sounds
alias glass="afplay $sounds/Glass.aiff"
alias funk="afplay $sounds/Funk.aiff"
2021-12-31 11:54:55 -08:00
autoload -Uz darwin_init_once
autoload -Uz darwin_icloud_drive_path
autoload -Uz darwin_configure_screenshots_directory
2021-12-31 11:54:55 -08:00
# Open a file or folder in Finder.
function finder {
if [[ -z "$1" ]]; then
open -R .
fi
2021-12-31 11:54:55 -08:00
open -R "$1"
2021-12-31 11:54:55 -08:00
}
function open-xcode {
local selectedXcode=`xcode-select -p`
while [[ ! `basename $selectedXcode` =~ ".app$" ]]; do
selectedXcode=`dirname "$selectedXcode"`
done
open -a "$selectedXcode" $@
}
alias -s app='open'
alias -s xcodeproj='open-xcode'
alias -s xcworkspace='open-xcode'