// Zed 設定
// 版控於 ~/Workspace/00_MacOS/02-setup/zed/settings.json
// 由 ~/.config/zed/settings.json symlink 過來
//
// 基準來源：~/Documents/Cursor/settings.json（2026-08 的 Cursor 配置）
{
  // ===== 基礎 =====
  // SublimeText preset 已內建這些綁定，不需自行設定：
  //   ctrl-shift-up/down = 上下加游標
  //   ctrl-shift-l       = 選取拆成每行游標
  //   cmd-shift-d        = 智慧複製（有選取複製選取，無選取複製整行）
  "base_keymap": "SublimeText",

  // 滑鼠多游標改用 cmd（Zed 預設是 alt）
  //   cmd + 點擊／拖曳 = 加游標／加選取
  //   option + 拖曳    = 欄選取
  "multi_cursor_modifier": "cmd_or_ctrl",

  // ===== 字型（對應 Cursor 的 Hack / 14px / lineHeight 20）=====
  "buffer_font_family": "Hack",
  "buffer_font_size": 14,
  "buffer_font_weight": 400,
  // 20 ÷ 14 = 1.43
  "buffer_line_height": { "custom": 1.43 },
  // 關閉連字，對應 Cursor 的 editor.fontLigatures: false
  "buffer_font_features": { "calt": false },
  "ui_font_size": 16,

  // ===== 配色 =====
  // Zed 內建沒有 Monokai（那是 VS Code 內建的），
  // 改以 One Dark 打底再覆蓋關鍵色 —— 與 Cursor 的做法相同。
  "theme": {
    "mode": "dark",
    "light": "One Dark",
    "dark": "One Dark"
  },
  "icon_theme": {
    "mode": "dark",
    "light": "Zed (Default)",
    "dark": "Zed (Default)"
  },
  "theme_overrides": {
    "One Dark": {
      "background": "#141418",
      "editor.background": "#141418",
      "editor.foreground": "#ffffff",
      "editor.gutter.background": "#141418",
      "editor.active_line.background": "#444446",
      "panel.background": "#0e1218",
      "tab_bar.background": "#0e1218",
      "tab.inactive_background": "#0e1218",
      "tab.active_background": "#141418",
      "title_bar.background": "#0e1218",
      "status_bar.background": "#0e1218",
      "element.selected": "#444446"
    }
  },

  // ===== 縮排 =====
  "tab_size": 2,
  "hard_tabs": false,

  // ===== 格式化 =====
  // 以 cmd+shift+f 手動觸發（見 keymap.json）
  // 存檔時不自動格式化 －－ Zed 預設是 "on"，但 Cursor 那邊是關的，此處對齊
  "format_on_save": "off",
  // auto：JSON／JS／CSS 等交給內建 prettier，其餘走 language server
  "formatter": "auto",
  "prettier": {
    "allowed": true,
    // prettier 的選項是 camelCase，直接透傳
    "tabWidth": 2,
    "useTabs": false
  },

  // ===== 編輯行為 =====
  "soft_wrap": "none",
  "show_whitespaces": "none",
  "remove_trailing_whitespace_on_save": true,
  "ensure_final_newline_on_save": true,
  // 對應 Cursor 的 editor.hover.enabled: false
  "hover_popover_enabled": false,

  // ===== 面板位置（沿用你原本的 Zed 設定）=====
  "project_panel": { "dock": "left" },
  "outline_panel": { "dock": "left" }
}
