用不慣 macOS 原生的終端機嗎?可以試試 iTerm2,並且搭配 Zsh 的主題套件,讓你在指令模式上操作更為順暢喔!

macOS 開發者必安裝的終端機 - iTerm2

用不慣 macOS 原生的終端機嗎?可以試試 iTerm2,並且搭配 Zsh 的主題套件,讓你在指令模式上操作更為順暢喔!

Youtube 影音教學版

安裝步驟

  • 官網下載 - https://www.iterm2.com/
  • 備用載點 - iTerm2-3_2_0.zip
  • 解壓縮,把它移到應用程式資料夾,並開啟
  • 第一次開啟後,請按 command + q 關閉 iterm2,此時系統會跳出請你去設定權限的東西,就讓它通過就好,記得先解左下方的鎖!

安裝 Homebrew

  • 終端機執行指令 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • 顯示版本,終端機執行指令 brew --version
  • 檢查,終端機執行指令 brew doctor
  • 更新,終端機執行指令 brew update
  • 重開 iTerm

安裝 Zsh

  • 終端機執行指令 brew install zsh
  • 終端機執行指令 sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  • 重開 iTerm

建立 SSH

  • 終端機執行指令 ssh-keygen -t rsa -C "your_email@example.com",your_email@example.com 請改成你的 mail,過程中會要求輸入相關東西,可以直接 Enter 使用預設值跳過
  • 複製公鑰,終端機執行指令 pbcopy < ~/.ssh/id_rsa.pub
    • 貼到 GitHub
      • 右上頭像 > Setting > SSH and GPG keys > New SSH Key,貼上公鑰
    • 貼到 BitBucket
      • 左下頭像 > View profile > Settings > SSH keys > Add Key,貼上公鑰
    • 自動登入 Server 的話,貼到 Server 上的 ~/.ssh/authorized_keys

常用設定

  • 快捷鍵 command + , 開啟設定
  • Profiles,先選擇左邊的 Default 再進行以下設定
    • General > Working Directory > Directory,輸入位置開啟時的位置 /Users/oa/www
    • Text
      • Font > Change Font > 點選 All Fonts > 點選 Hank > 標準體 > 18
      • 勾選 Use a different font for non-ASCII text
      • 修改 Non-ASCII Font > Change Font > 點選 All Fonts > 點選 Hank > 標準體 > 18
    • Window > Settings for New Windows,Columns 調整為 120,Rows 調整為 38
  • 調整快捷鍵
  • Keys
    • 游標移至最前,快捷鍵為 command + ←,Action 選 Send Hex Code,輸入 0x01
    • 游標移至最後,快捷鍵為 command + →,Action 選 Send Hex Code,輸入 0x05
    • 切換左邊頁籤,點選 + 新增,快捷鍵為 command + option + ←,Action 選 Next Tab
    • 切換右邊頁籤,點選 + 新增,快捷鍵為 command + option + →,Action 選 Previous Tab
    • 切換左方分頁,點選 + 新增,快捷鍵為 command + control + ←,Action 選 Select Split Page on Left
    • 切換右方分頁,點選 + 新增,快捷鍵為 command + control + →,Action 選 Select Split Page on Right
    • 切換上方分頁,點選 + 新增,快捷鍵為 command + control + ↑,Action 選 Select Split Page on Above
    • 切換下方分頁,點選 + 新增,快捷鍵為 command + control + ↑,Action 選 Select Split Page on Below
吳政賢個人簡歷OA WuLiveCoding.tw
OA Wu's Blog
蘋果環境
macOS 開發者必安裝的終端機 - iTerm2