[工具] Mac 中 终端/iTerm2 配置

iTerm2 is a replacement for Terminal and the successor to iTerm. It works on Macs with macOS 10.14 or newer. iTerm2 brings the terminal into the modern age with features you never knew you always wanted.

  • Terminal 是 Mac 系统自带的终端
  • iTerm2 是 Terminal 的替代品,也是 iTerm 的继任者。

如果你觉得 Terminal 无法满足你的需求, 可以使用 iTerm2, iTerm2 是一个功能强大的终端, 可以完全代替 Terminal

最终效果图

配色

Solarized

使用 Solarized 配色方案 GitHub 地址

  1. 下载后解压到自定义目录
  2. 导入 Solarized Dark 文件
    2.1. iTerm2 - Preferences - Profiles - Colors - 右下角 Color Presets - import 选择下载的 ~/solarized/iterm2-colors-solarized/Solarized Dark.itermcolors
    2.2. 终端 - 偏好设置 - 描述文件 - 左侧列表底部导入 选择下载的 ~/solarized/osx-terminal.app-colors-solarized/ Solarized Dark ansi.terminal
  3. 选择 Solarized Dark 主题

Oh My Zsh

Oh My Zsh

zsh 理论上是 bash 的增强版(概念不同), zsh更加强大
Oh My Zsh 它是基于 zsh 命令行的一个扩展工具集, 简化zsh的配置, 提供了丰富的扩展功能

Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and a few things that make you shout...

  1. 安装
安装方式 命令
curl sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
wget sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fetch sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
installed
  1. 在 主题列表 挑选一个喜欢的主题, 配置到 vim ~ /.zshrc
# 修改主题
ZSH_THEME="agnoster"

配置 Meslo 字体

使用 agnoster 主题, 需要 Meslo 字体 支持, 否则会出现乱码

  1. 字体下载地址
    github/powerline/fonts/Meslo Slashed/Meslo LG M Regular for Powerline.ttf
  2. 安装 Meslo LG M Regular for Powerline.ttf
  3. 终端 / iTerm 中配置 Powerline 字体

代理

  • 查看
git config --global http.proxy
  • 设置代理
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
  • 取消设置代理
git config --global --unset http.proxy
git config --global --unset https.proxy

你可能感兴趣的:([工具] Mac 中 终端/iTerm2 配置)