(.zshrc, install.sh): add Homebrew initialization and eza installation logic for multiple OSes

This commit is contained in:
Frank Qing
2025-05-28 01:54:38 +08:00
parent 4b401aa1cb
commit 4a063ea8d5
2 changed files with 87 additions and 14 deletions

13
.zshrc
View File

@@ -1,3 +1,8 @@
# Homebrew initialization
if [ -d '/opt/homebrew' ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
@@ -137,6 +142,12 @@ plugins=(
fpath+=$ZSH/custom/plugins/zsh-completions/src
# Setup Homebrew completions for macOS
if [[ "$OSTYPE" == "darwin"* ]] && command -v brew &> /dev/null; then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
fi
autoload -U compinit && compinit -C -d ~/.cache/zsh/.zcompdump # zsh-completions
# autoload bashcompinit # bash completions
# bashcompinit
@@ -150,7 +161,7 @@ alias myip="wget -qO- https://wtfismyip.com/text" # quickly show external ip add
alias l="ls --hyperlink=auto -lAhrtF" # show all except . .. , sort by recent, / at the end of folders, clickable
alias e="exit"
alias ip="ip --color=auto"
## Install EZA to use this. The better ls command
## EZA - the better ls command
alias a='eza -la --git --colour-scale all -g --smart-group --icons always --hyperlink' # the new ls; add --hyperlink if you like
alias aa='eza -la --git --colour-scale all -g --smart-group --icons always -s modified -r --hyperlink' # sort by new