From a389a92a785d97bc25dad3104e9c287df4bcd9b5 Mon Sep 17 00:00:00 2001 From: Rack Lin Date: Tue, 10 May 2022 18:38:39 +0800 Subject: [PATCH] feat(zsh): add homebrew shellenv to zsh --- README.md | 6 ++++++ zsh/dot-zshrc | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 381aa38..0259dc9 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,13 @@ Make sure you have installed all of the following prerequisites on your developm - git config - zsh config - [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh) + ``` + sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + ``` - [powerlevel10k theme](https://github.com/romkatv/powerlevel10k) + ``` + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + ``` - tmux config - MacOSX config diff --git a/zsh/dot-zshrc b/zsh/dot-zshrc index dd26bf2..a1e73b5 100644 --- a/zsh/dot-zshrc +++ b/zsh/dot-zshrc @@ -1,3 +1,7 @@ + +# Setting homebrew shellenv +[[ ("$(uname)" = "Darwin") && -d "/opt/homebrew" ]] && eval "$(/opt/homebrew/bin/brew shellenv)" + # 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. @@ -114,6 +118,9 @@ source $ZSH/oh-my-zsh.sh # GHQ and FZF alias ghqcd="cd \$(ghq list --full-path | fzf)" +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh + # OS SPECIFIC SETTINGS case "$(uname)" in Darwin) @@ -121,5 +128,3 @@ Darwin) ;; esac -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh