zshrc: refactor: Use new variables for OS-specific section

This commit is contained in:
PorridgePi
2022-09-28 19:30:02 +08:00
parent f4e807c032
commit 29b3e9dea0

37
.zshrc
View File

@@ -67,6 +67,25 @@ zinit light-mode for \
### End of Zinit's installer chunk ### End of Zinit's installer chunk
########## Personal - OS-Specific #############################################
if [[ "$OSNAME" == "Linux" ]]; then
##### Linux
elif [[ "$OSNAME" == "macOS" ]]; then
##### macOS
### Aliases
# Intel (Rosetta 2) Homebrew
alias ibrew='arch -x86_64 /usr/local/bin/brew'
# Homebrew
eval "$(/opt/homebrew/bin/brew shellenv)"
else
##### Unknown
fi
########## Personal ########################################################### ########## Personal ###########################################################
export PATH="$HOME/bin:$PATH" export PATH="$HOME/bin:$PATH"
export TERM=xterm-256color export TERM=xterm-256color
@@ -102,24 +121,6 @@ bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down bindkey '^[[B' history-substring-search-down
export HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=true export HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=true
########## OS-Specific ########################################################
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
##### Linux
elif [[ "$OSTYPE" == "darwin"* ]]; then
##### macOS
### Aliases
# Intel (Rosetta 2) Homebrew
alias ibrew='arch -x86_64 /usr/local/bin/brew'
# Homebrew
eval "$(/opt/homebrew/bin/brew shellenv)"
else
##### Unknown
fi
########## pnpm ############################################################### ########## pnpm ###############################################################
export PNPM_HOME="/Users/porridge/Library/pnpm" export PNPM_HOME="/Users/porridge/Library/pnpm"