![](/style/images/good.png)
![](/style/images/bad.png)
使用iTerm2和oh-my-zsh美化Mac终端
source link: http://huanyouchen.github.io/2020/06/26/mac-beautify-terminal-based-on-iTerm2-oh-my-zsh/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
The quieter you become,the more you are able to hear.
使用iTerm2和oh-my-zsh美化Mac终端
最终效果图:
![美化后的终端](https://huanyouchen-1252081928.cos.ap-shanghai.myqcloud.com/2020-06-26-mac-terminal-beautiful.png)
美化后的终端
需要安装的清单有:
- 安装iTerm2,然后依次打开 Preferences-Appearance-General-Theme,选择Minimal。
- 下载安装Dracula主题
$ git clone https://github.com/dracula/iterm.git |
然后按照官网描述的步骤安装即可,完成后:
设置背景图片,依次打开iTerm2-Preferences-Profiles-windows-Background Image,选择enable,然后选择自己喜欢的图片,我选择的是漫画《鬼刀》里的一张高清图片,设置图片的背景透明度可以拖动Blending旁边的滑动条实现。图片资源地址点击这里。
设置显示信息。依次打开iTerm2-Preferences–Session,勾选Status bar enable,Configure Status Bar,把上面的一些功能拖动到下面的框框里即可。我选择了当前文件夹,网速和搜索。打开Preferences-Window-Window custom title,填入想要的标题,我填的是iMac。
将默认shell设为zsh,
chsh -s /bin/zsh
echo $SHELL
# 输出 /bin/zsh然后安装oh my zsh,
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
安装Spaceship 主题,首先按照官网给的步骤下载:
git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt"
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"然后打开
~/.zshrc
,将ZSH_THEME修改为ZSH_THEME="spaceship"
。最后source ~/.zshrc
重新加载配置文件。下载Powerline fonts:
# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
rm -rf fonts设置字体,依次打开iTerm2-Preferences-Text-Font,我选择的是Fira Mono for Powerline字体。
安装插件zsh-syntax-highlighting和zsh-autosuggestions:
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting然后在
~/.zshrc
中,添加插件:# Add wisely, as too many plugins slow down shell startup.
plugins=(git z osx extract zsh-syntax-highlighting zsh-autosuggestions)其中,z,osx,extract是oh-my-zsh自带的插件,可以选择添加。添加完成后,再次执行
source ~/.zshrc
至此,美化过程结束。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK