在 Mac-Os 安装 ITerm Zsh 打造有效率的工作环境
参考文章 : https://medium.com/statementdog-engineering/prettify-your-zsh-command-line-prompt-3ca2acc967f
安装 Iterm2
#如果你从来没有用过brew cask的话需要先跑这行
brew tap caskroom/cask
#安装iTerm2
brew cask instal iterm2
安装主题 Iterm
- 我比较喜欢暗黑的主题Draculatheme
- github 里面有需要自定义的主题iTerm2-Color-Schemes
- 导入
安装 Nerd font
nerd font 更多特殊 icon
#先执行这行,才能用homebrew安装字型。曾经执行过的人可以跳过这个指令
brew tap caskroom/fonts
# 安裝指令
brew cask install font-sourcecodepro-nerd-font
设定路径:Preferences > Profiles > Text > Change Font
安装 Zsh 和 oh-my-zsh
brew install zsh
sudo sh -c "echo $(which zsh) >> /etc/shells"
chsh -s $(which zsh)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Oh-my-Zsh 的主题
- 官方的 Oh-my-zsh theme
- 安装 zsh theme Powerlevel9k
powerlevel9k 安装方式:
安装 :
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
编辑 ~/.zshrc
ZSH_THEME="powerlevel9k/powerlevel9k"
#左侧
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir dir_writable vcs)
#右侧
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs time)
#若当前登入的帐号为你的帐号xxx,就不用特别显示出来
DEFAULT_USER="biyongyao"
# 使用 nerd font 時可以顯示更多 icon。詳情請參考 powerlevel9k wiki
POWERLEVEL9K_MODE='nerdfont-complete'