Loading... # 在 Mac-Os 安装 ITerm Zsh 打造有效率的工作环境 > 参考文章 : https://medium.com/statementdog-engineering/prettify-your-zsh-command-line-prompt-3ca2acc967f ## 安装 Iterm2 ```bash #如果你从来没有用过brew cask的话需要先跑这行 brew tap caskroom/cask #安装iTerm2 brew cask instal iterm2 ``` ## 安装主题 Iterm 1. 我比较喜欢暗黑的主题[Draculatheme](https://draculatheme.com/iterm/) 2. **github** 里面有需要自定义的主题[iTerm2-Color-Schemes](https://github.com/mbadolato/iTerm2-Color-Schemes) 3. 导入 ![iterm-theme-import](http://image-blog-markdown.test.upcdn.net/image/iterm-theme-inport-road.jpg) ## 安装 Nerd font > nerd font 更多特殊 icon ```bash #先执行这行,才能用homebrew安装字型。曾经执行过的人可以跳过这个指令 brew tap caskroom/fonts # 安裝指令 brew cask install font-sourcecodepro-nerd-font ``` **设定路径:Preferences > Profiles > Text > Change Font** ## 安装 Zsh 和 oh-my-zsh ```bash brew install zsh sudo sh -c "echo $(which zsh) >> /etc/shells" chsh -s $(which zsh) ``` [oh-my-zsh--Github](https://github.com/robbyrussell/oh-my-zsh) ```bash sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" ``` ## Oh-my-Zsh 的主题 1. [官方的 Oh-my-zsh theme](https://github.com/robbyrussell/oh-my-zsh/wiki/Themes) 2. 安装 zsh theme [Powerlevel9k](https://github.com/bhilburn/powerlevel9k) *powerlevel9k* 安装方式: 安装 : ```bash git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k ``` 编辑 `~/.zshrc` ```test 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' ``` ## 最后 Iterm 上的一些优化美化的配置 ![iterm-theme-import](http://image-blog-markdown.test.upcdn.net/image/iterm-config.jpg) ![iterm-theme-import](http://image-blog-markdown.test.upcdn.net/image/iterm-window-config.jpg) Last modification:September 3, 2022 © Allow specification reprint Support Appreciate the author AliPayWeChat Like If you think my article is useful to you, please feel free to appreciate