Mac下iTerm2配置

  • 安装
    首先我们下载的 iTem2 这个软件,比Mac自带的终端更加强大。直接官网 http://iterm2.com/ 下载并安装即可。

  • 配置
    选择 Make iTerm2 Default Term 设置为默认的终端

    iTerms配置页面

  • 添加配色方案

    1. 本文选用的是 solarized

    2. 打开 iTerm2 下的偏好设置 preference ,点开 profiles 下的colors 选项,点击右下角的 Color Presets 选项,选择import ,导入解压到的 solarized 文件下的Solarized Dark.itermcolors

    3. 修改配色方案。在 Color Presets下面可以看到可供选择的主题。


      添加配色方案

      导入两种配色方案

      修改配色
  • 安装oh-my-zsh

  1. 使用 crul 安装
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

如果安装过程中出现需要安装git,则等git安装完成后重新执行上面指令,最后执行的结果如图所示,需要输入一次密码


安装omz
  • 设置主题
  1. 输入指令
➜  Documents vi ~/.zshrc
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"

不同的主题:https://github.com/robbyrussell/oh-my-zsh/wiki/Themes

ZSH_THEME="agnoster"
  • 重新打开发现出现字体乱码


    字体乱码

    这个时候需要重新下载字体解决,具体步骤如下

  1. [字体下载页面]
    (https://github.com/powerline/fonts/blob/master/Meslo%20Slashed/Meslo%20LG%20M%20Regular%20for%20Powerline.ttf)

  2. 点击当前git页面的View Raw下载文件


    点击View Raw就可以下载字体
  3. 双击下载的文件直接安装成功

  4. 重新打开iTerm2,然后导入字体设置


    设置字体页面
  • 安装完成后界面示意图


    效果图
  • 语法高亮配置

1 . 安装指令 : brew install zsh-syntax-highlighting

  1. 配置.zshrc文件,最后一行插入
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  1. 激活配置文件
source ~/.zshrc

你可能感兴趣的:(Mac下iTerm2配置)