最终效果
1.下载iTerm2
可以直接去官网下载:https://www.iterm2.com/
2.安装Oh my zsh
安装方法有两种,可以使用curl或wget,看自己环境或喜好:
1 | // curl 安装方式 |
或者
1 | // wget 安装方式 |
3. 安装PowerLine
安装powerline的方式依然简单,也只需要一条命令:
1 | pip install powerline-status --user |
没有安装pip的会有提示 zsh: command not found: pip
使用命令安装pip即可:
1 | sudo easy_install pip |
4. 下载主题及配色
这里用的是Dracula, 主题官网: https://draculatheme.com
1 | // github下载地址 |
配色可以在iTerm2 > Preferences > Profiles > Colors
右下角Color Presets
导入即可
5. 修改zsh主题。编辑~(用户名)下.zshrc文件,修改ZSH_THEME为”dracula”
1 | $ vim ~/.zshrc |
6. 创建一个指向Oh my zsh主题文件夹的符号链接
1 | // DRACULA_THEME是你刚才下载主题的目录 |
或者
可以移动主题文件dracula.zsh-theme
到 ~/.oh-my-zsh/themes/
下
注意 主题的安装说明, Dracula 要求lib文件夹也要移到~/.oh-my-zsh/themes/
下面, 否则每次打开终端会有一个脚本报警告
7. 终端(非编辑器中)输入以下查看可用的主题
1 | cd ~/.oh-my-zsh/themes && ls |
8. 参考文章
利用iTerm2+oh-my-zsh+Dracula主题打造我的Mac终端利器
- 本文作者: 醉疏狂
- 本文链接: https://hubin97.github.io/2020/05/11/Mac终端美化/
- 版权声明: 本博客所有文章除特别声明外,均采用 MIT 许可协议。转载请注明出处!