mac系统下iTerms 的优化(oh-my-zsh 和 语法高亮)


参考资料 [https://www.v2ex.com/t/608399#reply136](前两天答应的--打造高颜值的 iTerm2)
[https://cloud.tencent.com/developer/article/1684785](使用item2+oh my zsh优化终端体验)

1.将 iTerm2 自带 theme 修改为 Minimal ( Preferences-Appearance-General-Theme ) 以达到顶栏沉浸式的效果

2.下载主题 Dracula https://draculatheme.com/iterm/ 解压后更换 Preferences-Profiles-Color-Color Presets-Import

3.打开 Status bar

( Preferences-Profiles-Session-Status bar-Configure Status Bar ) 并根据自己的需求选择要显示的插件

4.配置 ZSH 主题 Spaceship ZSH

Oh My ZSH 默认有很多主题,但今天要说的是可以跟 Powerlevel9k 相媲美的主题 Spaceship ZSH 按照官方文档进行安装

oh-my-zsh
Clone this repo:

git clone https://github.com/spaceship-prompt/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
Symlink spaceship.zsh-theme to your oh-my-zsh custom themes directory:

ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme" Set ZSH_THEME="spaceship" in your .zshrc.

5.安装 neofetch

6.声明高亮插件

安装zsh-syntax-highlighting插件,当遇到特殊命令和错误命令时会有高亮,需要使用Homebrew安装:

brew install zsh-syntax-highlighting
安装成功之后,使用命令vim ~/.zshrc进入编辑,找到plugins增加zsh-syntax-highlighting,并在最后一行增加下面配置:

source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

如果出现下面这种情况zsh-syntax-highlighting not found,我们使用git方法下载文件,重新启动item2就好了

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM