【mac开发环境】第1篇:ITerm2+Oh My Zsh

安装iTerm2

iTerm2官方下载

安装Oh My Bash

  1. 查看当前系统shell

    • 使用命令::cat /etc/shells
    • 命令结果:

      # List of acceptable shells for chpass(1).
      # Ftpd will not allow users to connect who are not using
      # one of these shells.
      
      /bin/bash
      /bin/csh
      /bin/ksh
      /bin/sh
      /bin/tcsh
      /bin/zsh
  2. 使用 echo $SHELL 查看当前系统使用的shell

    (1)一般mac自带的zsh不是最新版的,可以更新到最新版: brew install zsh
    (2) zsh --version 命令查看 zsh 的版本;
    (3)修改默认 Shell,在 /etc/shells 文件中加入如下一行 /usr/local/bin/zsh然后运行命令 chsh -s /usr/local/bin/zsh;或者通过命令 chsh -s $(which zsh)设置;
  3. 安装Oh My Zsh

    (1)项目主页: https://github.com/robbyrussell/oh-my-zsh
    (2)安装oh my zsh: sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
    (3) 为什么使用zsh
  4. 设置agnoster主题

    (1)修改 vim ~/.zshrc,然后把里面 ZSH_THEME 的值改为 ZSH_THEME="agnoster"
    (2)安装这个主题需要额外的font支持 font设置
    (3) 设置配色,在iTerm2的Preferences——>Profiles——>colors——>Load Presets——>Solarized Dark即可设置终端配色
    (4)修改字体,在iTerm2的Preferences——>Profiles——>Change font——> Source code pro for powerline
  5. 引入.bash_profile配置
    找到zsh的配置文件 .zshrc ,在文件的尾部加入

    source .bash_profile
  6. 修改mac系统自带终端字体为:Cousine for Powerline
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值