Mac配置oh my zsh,并使用ITerm2

Mac配置oh my zsh,并使用ITerm2

先看看最终效果

image-20191115151234824

  1. 第一步安装on my zsh

    sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
    
  2. 切换为zsh

     sudo chsh -s /bin/zsh
    
  3. 更换主题

    在命令行用vim打开用户根目录下.zshrc,我的修改为agnoster:

    ZSH_THEME="agnoster"
    
  4. 安装power-line字体

    # clone
    git clone https://github.com/powerline/fonts.git --depth=1
    # install
    cd fonts
    ./install.sh
    # clean-up a bit
    cd ..
    rm -rf fonts
    
  5. 设置字体高亮

    brew install zsh-syntax-highlighting
    

    打开zshrc配置文件追加

    open ~/.zshrc
    
    ##关键字高亮
    source $ZSH/oh-my-zsh.sh
    source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
    #很多教程只有上边那两行,但是我们设置好编译后发现关键字还是没有高亮,这是因为iTerm终端自身的原因,加上后面两行代码就可以将zsh中主题的颜色加载出来了
    export CLICOLOR=1
    export TERM=xterm-256color
    
  6. 下载ITeam2

    自己去官网下载

  7. 更换颜色

    打开ITerm2的设置页面-Profiles-colors

    选择Solarized-Dark

    image-20191115152142935

  8. 更换字体

    打开ITerm2的设置页面-Profiles-Text

    选择Meslo Lg L for PowerLine

    image-20191115152304240

  9. 隐藏用户名和主机名
    修改 ~/.zshrc文件,在文件底部增加

    prompt_context() {}
    

OVER

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值