huntout.me

iTerm2 & oh-my-zsh

Mar 21, 2018

iTerm2 is terminal emulator for macOS that amazing things.

iTerm2

Oh My Zsh is an open source, community-driven framework for managing your zsh configuration.

Oh My Zsh

Download and install

Patch custom font for the special characters

git clone https://github.com/powerline/fontpatcher.git
cd fontpatcher
./setup.py build
sudo ./setup.py install
brew install fontforge
fontforge scripts/powerline-fontpatcher /System/Library/Fonts/Monaco.dfont
cp "Monaco for Powerline.otf" "$HOME/Library/Fonts/"

iTerm2 Preferences

Profiles -> Colors -> Color Presets -> Solarized Dark
         -> Text -> Text Rendering -> Uncheck "Draw bold text in bright colors"
         -> Text -> Font -> 14pt Monaco for Powerline

iTerm2 HotKeys

  • ⌃ + u:清空当前行
  • ⌃ + a:移动到行首
  • ⌃ + e:移动到行尾
  • ⌃ + f:向前移动
  • ⌃ + b:向后移动
  • ⌃ + p:上一条命令
  • ⌃ + n:下一条命令
  • ⌃ + r:搜索历史命令
  • ⌃ + y:召回最近用命令删除的文字
  • ⌃ + h:删除光标之前的字符
  • ⌃ + d:删除光标所指的字符
  • ⌃ + w:删除光标之前的单词
  • ⌃ + k:删除从光标到行尾的内容
  • ⌃ + t:交换光标和之前的字符

oh-my-zsh theme

## ~/.zshrc
ZSH_THEME="agnoster"
DEFAULT_USER="huntout"

oh-my-zsh plugins

brew install autojump
brew install zsh-syntax-highlighting