1、 首先安装iterm2
- 地址:官方网址
- 下载完成后直接复制iterm.app至应用程序文件夹
- 安装完成
2、安装oh-my-zsh
- 地址官方网址
- 在iterm中执行
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
- 为 oh-my-zsh 安装 zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
这个插件是记录之前执行过的命令。
- 为 oh-my-zsh 安装 zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
这个插件是用来高亮输入的命令
- 配置oh-my-zsh
vim ~/.zshrc
plugins=(
git
z
extract
zsh-autosuggestions # 需要自己安装
zsh-syntax-highlighting # 需要自己安装
)
3、安装字体
- 安装 Powerline 字体,参照 https://github.com/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
如果后续使用的主题要显示图形符号,则需要 Awesome-Terminal Fonts。推荐安装 Patched 类型,虽然只有三个字体,不过有 Droid+Sans+Mono+Awesome.ttf 已经足够了Patched 字体下载: https://github.com/gabrielelana/awesome-terminal-fonts/tree/patching-strategy/patched
# 把下载的三个 Patched 字体放到个人字体目录中
mv *.ttf ~/.local/share/fonts/
# 更新字体缓存
fc-cache -vf ~/.local/share/fonts/
4、安装主题
看网友有在用powerlevel9k,就去官网上看了看,才发现这是一个很强大的主题,有很多配色方案以及自定义的配置。
- 安装:
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
#clone完毕后
vim ~/.zshrc
ZSH_THEME="powerlevel9k/powerlevel9k"
具体的配置可以参考:https://github.com/bhilburn/powerlevel9k/wiki/Show-Off-Your-Config
安装完毕了,重启iterm
关于隐藏 user@hostname 的问题,之需要在.zshrc里面的ZSH_THEME=‘’
下面一行添加DEFAULT_USER="$USER"
即可
暂时无法评论哦~
暂无评论