mac系統iTerm2+oh-my-zsh+solarized配色方案

1 下载并安装iTerm2

brew install iterm2

安装成功后

brew -v

2 安装solarized主题

  1. 下载安装包

    git clone https://github.com/altercation/solarized.git
    
  2. 安装
    下载解压Solarized Dark,点击目录solarized\iterm2-colors-solarized的Solarized Dark.itermcolors和 Solarized Light.itermcolors进行安装。

  3. iterm2的settings中设置
    在这里插入图片描述

3 安装oh-my-zsh并配置agnoster主题

  1. 从github中下载
    “使用 Homebrew 完成 zsh 和 zsh completions 的安装”
brew install zsh zsh-completions
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
  1. 修改主题
vim ~/.zshrc    //进入.zshrc文件,将ZSH_THEME后面字段改为agnoster

在这里插入图片描述

4 设置powerline

iterm2勾选上
在这里插入图片描述

5 隐藏用户名信息

一般终端每一行前都会有xxx@xxxdeMacbook-Pro:我们可以将其隐藏掉。
进入oh-my-zsh的agnoster主题,编辑agnoster.zsh-theme文件:

 vim ~/.oh-my-zsh/themes/agnoster.zsh-theme

在这里插入图片描述
注释掉这一行,效果如下
在这里插入图片描述

6 设置语法高亮和代码自动补全

在oh-my-zsh存储库中克隆存储库:

  git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions

在.zshrc中插入下面内容:

plugins=(
  git
  zsh-completions
)
autoload -U compinit && compinit

直接使用homebrew安装zsh-syntax-highlighting插件

brew install zsh-syntax-highlighting

然后在根目录下.zshrc中插入下面内容:

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

在.zshrc中插入下面内容:

plugins=(
  git
  zsh-completions
  zsh-syntax-highlighting
)

zsh-autosuggestions:补全的是历史输入的命令,点击方向键->即可补全

brew install zsh-autosuggestions

在.zshrc中插入下面内容:

plugins=(
  git
  zsh-completions
  zsh-autosuggestions
  zsh-syntax-highlighting
)

7 (可选)如果出现plugin ‘zsh-autosuggestions’ not found

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

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

source ~/.zshrc
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值