zsh/.zsh/aliases/macos.zsh

# zsh/.zsh/aliases/macos.zsh
# Only loaded on macOS (guard in .zshrc).

# Clipboard passthrough
alias c='pbcopy'
alias v='pbpaste'

# Finder show/hide hidden files
alias show-hidden='defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder'
alias hide-hidden='defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder'

# Cleanup .DS_Store files
alias ds-clean='find . -type f -name ".DS_Store" -print -delete'

# Eject all mounted disks
alias eject-all='osascript -e "tell application \"Finder\" to eject (every disk whose ejectable is true)"'

# Flush DNS
alias flush-dns='sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder'

# Quicklook a file from the terminal
alias ql='qlmanage -p 2>/dev/null'

# Brew
alias bup='brew update && brew upgrade && brew cleanup'
alias bi='brew install'
alias bs='brew search'
alias bl='brew list'

# Open current dir in Finder / VS Code
alias o='open .'

# Lock screen
alias lock='pmset displaysleepnow'

# IP
alias localip="ipconfig getifaddr en0"
alias publicip="curl -s https://ifconfig.me"