configuring-ghostty-vibe-stack
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGhostty Vibe Coding Stack
Ghostty 沉浸式编码工具栈
A complete terminal-based AI coding environment for macOS (Apple Silicon). Replaces heavy IDEs with lightweight, composable tools for Claude Code / AI-assisted development.
这是一款为搭载Apple Silicon的macOS打造的完整终端式AI编码环境。它用轻量、可组合的工具替代重型IDE,支持Claude Code / AI辅助开发。
Setup Workflow
搭建流程
Follow these steps in order. Skip steps where the tool is already installed.
Copy this checklist and track progress:
Setup Progress:
- [ ] Step 1: Pre-flight checks
- [ ] Step 2: Install Ghostty
- [ ] Step 3: Install CLI tools
- [ ] Step 4: Install fonts
- [ ] Step 5: Configure Ghostty
- [ ] Step 6: Configure Fish shell
- [ ] Step 7: Install Fish plugins
- [ ] Step 8: Configure lazygit
- [ ] Step 9: Configure yazi
- [ ] Step 10: Install Neovim + LazyVim
- [ ] Step 11: Set Ghostty as default terminal
- [ ] Step 12: Validate and verify请按顺序执行以下步骤,若工具已安装可跳过对应步骤。
复制以下清单跟踪进度:
Setup Progress:
- [ ] Step 1: Pre-flight checks
- [ ] Step 2: Install Ghostty
- [ ] Step 3: Install CLI tools
- [ ] Step 4: Install fonts
- [ ] Step 5: Configure Ghostty
- [ ] Step 6: Configure Fish shell
- [ ] Step 7: Install Fish plugins
- [ ] Step 8: Configure lazygit
- [ ] Step 9: Configure yazi
- [ ] Step 10: Install Neovim + LazyVim
- [ ] Step 11: Set Ghostty as default terminal
- [ ] Step 12: Validate and verifyStep 1: Pre-flight Checks
步骤1:前置检查
Verify prerequisites before starting:
bash
undefined开始前先验证必备条件:
bash
undefinedCheck macOS and architecture
检查macOS版本和架构
uname -m # expect: arm64
sw_vers --productVersion # expect: 13.0+
uname -m # 预期输出:arm64
sw_vers --productVersion # 预期输出:13.0+
Check Homebrew
检查Homebrew
brew --version || echo "Homebrew not installed — install from https://brew.sh"
If Homebrew is missing, install it:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Check what is already installed to skip redundant steps:
bash
for cmd in ghostty fish yazi lazygit nvim fzf zoxide atuin fd rg bat delta; do
printf "%-10s: " "$cmd"
which $cmd 2>/dev/null || echo "not installed"
donebrew --version || echo "Homebrew未安装 — 请从https://brew.sh安装"
若未安装Homebrew,执行以下命令安装:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"检查已安装的工具以跳过重复步骤:
bash
for cmd in ghostty fish yazi lazygit nvim fzf zoxide atuin fd rg bat delta; do
printf "%-10s: " "$cmd"
which $cmd 2>/dev/null || echo "未安装"
doneStep 2: Install Ghostty
步骤2:安装Ghostty
Check if Ghostty is already installed:
bash
ls /Applications/Ghostty.app 2>/dev/null && echo "Ghostty installed" || echo "Not installed"If not installed:
bash
brew install --cask ghostty检查Ghostty是否已安装:
bash
ls /Applications/Ghostty.app 2>/dev/null && echo "Ghostty已安装" || echo "未安装"若未安装:
bash
brew install --cask ghosttyStep 3: Install CLI Tools
步骤3:安装CLI工具
Install all tools in one command (already-installed tools are skipped automatically):
bash
brew install fish yazi lazygit neovim fzf zoxide atuin fd ripgrep bat git-delta一键安装所有工具(已安装的工具会自动跳过):
bash
brew install fish yazi lazygit neovim fzf zoxide atuin fd ripgrep bat git-deltaStep 4: Install Fonts
步骤4:安装字体
Ask the user which font setup they prefer before installing:
Option A: CJK-optimized (recommended for Chinese/Japanese/Korean users)
bash
brew install --cask font-maple-mono-nf-cn font-sarasa-gothic font-jetbrains-mono-nerd-fontOption B: Latin-only (English-primary users)
bash
brew install --cask font-jetbrains-mono-nerd-font安装前询问用户偏好的字体设置:
选项A:CJK优化版(推荐给中、日、韩用户)
bash
brew install --cask font-maple-mono-nf-cn font-sarasa-gothic font-jetbrains-mono-nerd-font选项B:仅拉丁语系版(英文用户优先)
bash
brew install --cask font-jetbrains-mono-nerd-fontStep 5: Configure Ghostty
步骤5:配置Ghostty
Read the complete config template from references/ghostty-config.md.
Before writing, ask the user about preferences:
- Theme: Run to show options. Popular: Monokai Vivid, Rose Pine, TokyoNight Storm, Catppuccin Mocha
ghostty +list-themes - Transparency: Whether to enable background opacity (some users prefer fully opaque)
- Font size: Default 15, adjust for their display
Write config to :
~/.config/ghostty/configbash
mkdir -p ~/.config/ghosttyAfter writing, ALWAYS validate:
bash
ghostty +validate-configIf validation shows theme errors, the theme name likely needs exact casing. Check with .
ghostty +list-themes | grep -i <name>从references/ghostty-config.md读取完整配置模板。
写入配置前询问用户偏好:
- 主题:执行查看可选主题。热门选项:Monokai Vivid、Rose Pine、TokyoNight Storm、Catppuccin Mocha
ghostty +list-themes - 透明度:是否启用背景透明度(部分用户偏好完全不透明)
- 字体大小:默认15号,可根据显示器调整
将配置写入:
~/.config/ghostty/configbash
mkdir -p ~/.config/ghostty写入后务必验证配置:
bash
ghostty +validate-config若验证显示主题错误,可能是主题名称大小写不匹配。执行检查正确名称。
ghostty +list-themes | grep -i <name>Step 6: Configure Fish Shell
步骤6:配置Fish Shell
Read the complete config template from references/fish-config.md.
Register Fish as an allowed shell (requires sudo — inform the user):
bash
grep -q "$(which fish)" /etc/shells || echo "$(which fish)" | sudo tee -a /etc/shellsWrite config to :
~/.config/fish/config.fishbash
mkdir -p ~/.config/fish/{completions,conf.d,functions}Import existing shell history into atuin:
bash
fish -c "atuin import auto"从references/fish-config.md读取完整配置模板。
将Fish注册为允许的shell(需要sudo权限,请告知用户):
bash
grep -q "$(which fish)" /etc/shells || echo "$(which fish)" | sudo tee -a /etc/shells将配置写入:
~/.config/fish/config.fishbash
mkdir -p ~/.config/fish/{completions,conf.d,functions}将现有shell历史导入atuin:
bash
fish -c "atuin import auto"Step 7: Install Fish Plugins
步骤7:安装Fish插件
Check if Fisher (plugin manager) is installed:
bash
fish -c "type fisher" 2>/dev/null || fish -c "curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher"Install Tide prompt:
bash
fish -c "fisher install IlanCosman/tide@v6"检查Fisher(插件管理器)是否已安装:
bash
fish -c "type fisher" 2>/dev/null || fish -c "curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher"安装Tide提示符:
bash
fish -c "fisher install IlanCosman/tide@v6"Step 8: Configure lazygit
步骤8:配置lazygit
Read the complete config template from references/lazygit-config.md.
The reference includes color themes for Monokai, TokyoNight, and Rose Pine. Match the lazygit theme to whichever Ghostty theme the user chose in Step 5.
Write config to :
~/.config/lazygit/config.ymlbash
mkdir -p ~/.config/lazygit从references/lazygit-config.md读取完整配置模板。
参考模板包含Monokai、TokyoNight和Rose Pine的颜色主题。将lazygit主题与用户在步骤5中选择的Ghostty主题保持一致。
将配置写入:
~/.config/lazygit/config.ymlbash
mkdir -p ~/.config/lazygitStep 9: Configure yazi
步骤9:配置yazi
Read the complete config template from references/yazi-config.md.
Write config to :
~/.config/yazi/yazi.tomlbash
mkdir -p ~/.config/yazi从references/yazi-config.md读取完整配置模板。
将配置写入:
~/.config/yazi/yazi.tomlbash
mkdir -p ~/.config/yaziStep 10: Install Neovim + LazyVim
步骤10:安装Neovim + LazyVim
Check if nvim config already exists:
bash
ls ~/.config/nvim/init.lua 2>/dev/null && echo "Nvim config exists — skip or backup first" || echo "No config"If no existing config:
bash
git clone https://github.com/LazyVim/starter ~/.config/nvim && rm -rf ~/.config/nvim/.gitIf config exists, ask the user whether to backup and replace or skip.
Tell the user: first time opening , LazyVim auto-installs all plugins — wait about 30 seconds.
nvim检查nvim配置是否已存在:
bash
ls ~/.config/nvim/init.lua 2>/dev/null && echo "Nvim配置已存在 — 请先备份或跳过" || echo "无配置"若没有现有配置:
bash
git clone https://github.com/LazyVim/starter ~/.config/nvim && rm -rf ~/.config/nvim/.git若配置已存在,询问用户是否备份替换或跳过。
告知用户:首次打开时,LazyVim会自动安装所有插件 — 请等待约30秒。
nvimStep 11: Set Ghostty as Default Terminal (Optional)
步骤11:设置Ghostty为默认终端(可选)
Ask the user if they want Ghostty to replace their current default terminal in Finder's "Open in Terminal".
If yes, compile and run the Swift helper:
bash
cat << 'SWIFT' > /tmp/set_default_terminal.swift
import CoreServices
let result = LSSetDefaultRoleHandlerForContentType(
"public.unix-executable" as CFString, .shell,
"com.mitchellh.ghostty" as CFString)
print(result == 0 ? "Success: Ghostty set as default terminal" : "Failed: \(result)")
SWIFT
swiftc /tmp/set_default_terminal.swift -o /tmp/set_default_terminal && /tmp/set_default_terminal
rm -f /tmp/set_default_terminal.swift /tmp/set_default_terminal询问用户是否希望Ghostty替换Finder中“在终端中打开”的当前默认终端。
若用户同意,编译并运行Swift辅助脚本:
bash
cat << 'SWIFT' > /tmp/set_default_terminal.swift
import CoreServices
let result = LSSetDefaultRoleHandlerForContentType(
"public.unix-executable" as CFString, .shell,
"com.mitchellh.ghostty" as CFString)
print(result == 0 ? "Success: Ghostty set as default terminal" : "Failed: \(result)")
SWIFT
swiftc /tmp/set_default_terminal.swift -o /tmp/set_default_terminal && /tmp/set_default_terminal
rm -f /tmp/set_default_terminal.swift /tmp/set_default_terminalStep 12: Validate and Verify
步骤12:验证与确认
Run final verification:
bash
echo "=== Tool Versions ==="
for cmd in fish yazi lazygit nvim fzf zoxide atuin fd rg bat delta; do
printf "%-10s: " "$cmd"
$cmd --version 2>&1 | head -1
done
echo ""
echo "=== Ghostty Config ==="
ghostty +validate-config 2>&1 || echo "Config OK (no output = no errors)"
echo ""
echo "=== Fish Shell ==="
fish -c "echo Fish is working"Present the user with a summary of what was installed and configured, plus the quick reference below.
执行最终验证:
bash
echo "=== 工具版本 ==="
for cmd in fish yazi lazygit nvim fzf zoxide atuin fd rg bat delta; do
printf "%-10s: " "$cmd"
$cmd --version 2>&1 | head -1
done
echo ""
echo "=== Ghostty配置 ==="
ghostty +validate-config 2>&1 || echo "配置正常(无输出即无错误)"
echo ""
echo "=== Fish Shell ==="
fish -c "echo Fish运行正常"向用户展示已安装和配置的内容摘要,以及下方的快速参考。
Quick Reference
快速参考
| Alias | Command |
|---|---|
| yazi (file manager) |
| yazi with cd-on-exit |
| lazygit |
| nvim |
| claude |
| zoxide smart cd |
| Ghostty Shortcut | Action |
|---|---|
| Vertical split |
| Horizontal split |
| Navigate splits |
| Quick Terminal (global) |
| Fish Key | Action |
|---|---|
| Accept autosuggestion |
| Accept one word |
| Completion menu |
| History search (atuin) |
| 别名 | 命令 |
|---|---|
| yazi(文件管理器) |
| 退出时自动切换目录的yazi |
| lazygit |
| nvim |
| claude |
| zoxide智能跳转目录 |
| Ghostty快捷键 | 操作 |
|---|---|
| 垂直分屏 |
| 水平分屏 |
| 切换分屏窗口 |
| 全局快速终端 |
| Fish按键 | 操作 |
|---|---|
| 接受自动建议 |
| 接受单个单词的自动建议 |
| 打开补全菜单 |
| 历史记录搜索(atuin) |
Troubleshooting
问题排查
Theme names require exact casing with spaces:
- Wrong: ,
rose-pinetokyo-night - Correct: ,
Rose PineTokyoNight Storm - List available:
ghostty +list-themes - Validate config:
ghostty +validate-config
Cmd+V does not paste images into Claude Code (Ghostty bug, Discussion #10117):
- Use instead, or drag-and-drop image files
Ctrl+V
Fish key binding syntax differs from Zsh:
- Wrong: (
bind -k right completeis zsh syntax)-k - Correct:
bind right complete - Also override raw escape:
bind \e\[C complete
Chinese text too large or misaligned:
- Add CJK font as first entry
font-family - Set
adjust-cell-height = 20%
List available fonts:
ghostty +list-fontsList available themes:
ghostty +list-themes主题名称需严格区分大小写且保留空格:
- 错误写法:,
rose-pinetokyo-night - 正确写法:,
Rose PineTokyoNight Storm - 查看可用主题:
ghostty +list-themes - 验证配置:
ghostty +validate-config
Cmd+V无法将图片粘贴到Claude Code(Ghostty已知问题,讨论#10117):
- 改用,或直接拖拽图片文件
Ctrl+V
Fish按键绑定语法与Zsh不同:
- 错误写法:(
bind -k right complete是zsh语法)-k - 正确写法:
bind right complete - 同时需要覆盖原生转义:
bind \e\[C complete
中文文本过大或对齐异常:
- 将CJK字体设为的第一个条目
font-family - 设置
adjust-cell-height = 20%
查看可用字体:
ghostty +list-fonts查看可用主题:
ghostty +list-themes