Make .zshrc more flexible for arm64 M1 Macs.
This commit is contained in:
@@ -19,7 +19,7 @@ export PS1=$'\n'"%F{green} %*%F %3~ %F{white}"$'\n'"$ "
|
|||||||
plugins=(git brew history kubectl history-substring-search)
|
plugins=(git brew history kubectl history-substring-search)
|
||||||
|
|
||||||
# Custom $PATH with extra locations.
|
# Custom $PATH with extra locations.
|
||||||
export PATH=/usr/local/bin:/usr/local/sbin:$HOME/bin:$HOME/go/bin:/usr/local/git/bin:$HOME/.composer/vendor/bin:$PATH
|
export PATH=$HOME/Library/Python/3.8/bin:/opt/homebrew/bin:/usr/local/bin:/usr/local/sbin:$HOME/bin:$HOME/go/bin:/usr/local/git/bin:$HOME/.composer/vendor/bin:$PATH
|
||||||
|
|
||||||
# Bash-style time output.
|
# Bash-style time output.
|
||||||
export TIMEFMT=$'\nreal\t%*E\nuser\t%*U\nsys\t%*S'
|
export TIMEFMT=$'\nreal\t%*E\nuser\t%*U\nsys\t%*S'
|
||||||
@@ -30,8 +30,18 @@ then
|
|||||||
source ~/.aliases
|
source ~/.aliases
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set architecture-specific brew share path.
|
||||||
|
arch_name="$(uname -m)"
|
||||||
|
if [ "${arch_name}" = "x86_64" ]; then
|
||||||
|
share_path="/usr/local/share"
|
||||||
|
elif [ "${arch_name}" = "arm64" ]; then
|
||||||
|
share_path="/opt/homebrew/share"
|
||||||
|
else
|
||||||
|
echo "Unknown architecture: ${arch_name}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Allow history search via up/down keys.
|
# Allow history search via up/down keys.
|
||||||
source /usr/local/share/zsh-history-substring-search/zsh-history-substring-search.zsh
|
source ${share_path}/zsh-history-substring-search/zsh-history-substring-search.zsh
|
||||||
bindkey "^[[A" history-substring-search-up
|
bindkey "^[[A" history-substring-search-up
|
||||||
bindkey "^[[B" history-substring-search-down
|
bindkey "^[[B" history-substring-search-down
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user