開發者必備終端機。
安裝步驟
- 開啟 Safari
- 官網下載 - https://www.iterm2.com/
- 解壓縮,移到 應用程式目錄 並開啟
安裝 command line
- 更新 Xcode command line:
xcode-select --install
安裝 Homebrew 與 ZSH
- 安裝
- 快速(一行):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && eval "$(/opt/homebrew/bin/brew shellenv)" && brew --version && brew doctor && brew update && brew install zsh && sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" - 分步:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"- 載入指令:
eval "$(/opt/homebrew/bin/brew shellenv)" - 顯示版本:
brew --version - 檢查:
brew doctor - 更新:
brew update - 安裝 ZSH:
brew install zsh - 安裝 oh-my-zsh:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- 快速(一行):
- 設定
- 設置 Homebrew bin 位置:
echo "\n# Brew\nexport PATH=\"\$PATH:/opt/homebrew/bin\"" >> ~/.zshrc - 更新設定檔:
source ~/.zshrc - 重開 iTerm
- 設置 Homebrew bin 位置:
建立 SSH
- 產生金鑰:
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 - 複製公鑰
常用設定
- 快捷鍵
command + ,開啟設定 - General ❯ Selection ❯ Clicking on a command selects it to restrict Find and Filter - 取消
- Profiles - 先選左邊的 Default 再進行以下設定
- General ❯ Working Directory ❯ Directory - 輸入開啟時的位置
~/Workspace - Color
- 取消勾選 User separatete colors for light and dark mode
- Color Preset 選擇 Dark Background
- Text
- Font ❯ Hack ❯ 標準體(Regular) ❯
18 - Use a different font for non-ASCII text - 勾選
- Non-ASCII Font ❯ Hack ❯ 標準體(Regular) ❯
18
- Font ❯ Hack ❯ 標準體(Regular) ❯
- Window ❯ Settings for New Windows - Columns 調整為
120、Rows 調整為38 - Terminal ❯ Scrollback lines 調整為
3,000(可依需求調整;想無限保留則勾選Unlimited scrollback)
- General ❯ Working Directory ❯ Directory - 輸入開啟時的位置
- Keys
- 游標移至最前 - 按
+點Click to Set,按下command + ←,Action 選Send Hex Code,輸入0x01 - 游標移至最後 - 按
+點Click to Set,按下command + →,Action 選Send Hex Code,輸入0x05 - 切換左邊頁籤 - 按
+點Click to Set,按下command + option + ←,Action 選Previous Tab - 切換右邊頁籤 - 按
+點Click to Set,按下command + option + →,Action 選Next Tab - 切換左方分頁 - 按
+點Click to Set,按下command + control + ←,Action 選Select Split Pane on Left - 切換右方分頁 - 按
+點Click to Set,按下command + control + →,Action 選Select Split Pane on Right - 切換上方分頁 - 按
+點Click to Set,按下command + control + ↑,Action 選Select Split Pane Above - 切換下方分頁 - 按
+點Click to Set,按下command + control + ↓,Action 選Select Split Pane Below
- 游標移至最前 - 按
相關參考
- Youtube 影音教學版 - https://www.youtube.com/watch?v=4A3L1kJ6q5Q