[zsh] Do a bunch of profiling and clean up all my init functions -- shell init is so much faster now!

This commit is contained in:
Eryn Wells 2022-01-22 10:13:05 -08:00
parent 7e126fe703
commit 1c2e9025cf
11 changed files with 135 additions and 185 deletions

View file

@ -1,36 +1,37 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
autoload binary_exists
autoload -Uz binary_exists
function init_rc_darwin
{
alias acls='command ls -le'
alias acls='command ls -le'
# 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'
# 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'
binary_exists gls && init_rc_configure_ls `which gls`
binary_exists gls && init_rc_configure_ls `which gls`
# ldd doesn't exist on OS X, but otool -L does the same thing.
alias ldd='otool -L'
# ldd doesn't exist on OS X, but otool -L does the same thing.
alias ldd='otool -L'
local sounds=/System/Library/Sounds
alias glass="afplay $sounds/Glass.aiff"
alias funk="afplay $sounds/Funk.aiff"
local sounds=/System/Library/Sounds
alias glass="afplay $sounds/Glass.aiff"
alias funk="afplay $sounds/Funk.aiff"
autoload +X darwin_init_once
autoload +X darwin_icloud_drive_path
autoload +X darwin_configure_screenshots_directory
autoload -Uz darwin_init_once
autoload -Uz darwin_icloud_drive_path
autoload -Uz darwin_configure_screenshots_directory
# Open a file/folder in Finder
alias reveal='open -R'
# Open a file or folder in Finder.
function finder {
if [[ -z "$1" ]]; then
open -R .
fi
alias -s app='open'
alias -s xcodeproj='open -a Xcode'
open -R "$1"
}
init_rc_darwin "$@"
alias -s app='open'
alias -s xcodeproj='open -a Xcode'