第 9 章 配置檔案說明

Last Updated: 2026-10-22 02:52 Views: 6

第 9 章 配置檔案說明

wxeditor 的全部使用者資料集中在一個目錄,與 wxterm 完全分離:

平台 配置目錄
Linux / FreeBSD ~/.wxeditor/
macOS ~/Library/Application Support/wxeditor/
Windows %APPDATA%\wxeditor\

9.1 檔案一覽

檔案 用途
settings.json 全部設定:options(主題/語言/UI 字體/主題切換)+ editor(編輯器字體/換行/閱讀器)
history.json 最近專案列表(上限 20 條)
remote.json 遠端伺服器列表;密碼 AES-GCM 加密,主金鑰隨檔案儲存
execute.json 安裝位置指標 {"exec": "<路徑>"},供 wxterm 調起;啟動時自動檢測寫入
keymap.json 使用者鍵位覆蓋(系統預設在安裝目錄 share/wxeditor/config/keymap.json)
themes.json 使用者自訂主題
wxeditor_debug.json 偵錯斷點與運行配置
ai/ AI 引擎資料:provider.json(模型配置)、wxeditor.dat(金鑰)、task/(任務庫)、skills/(技能)
logs/ 運行日誌(按日期滾動,排查問題時可查看)

9.2 settings.json 結構

{
  "editor": {
    "fontFamily": "微軟雅黑",
    "fontSize": 14,
    "monoFontFamily": "Source Code Pro",
    "autoWrap": true,
    "reader": {
      "viewMode": 0,
      "lineHeight": 0.0,
      "paraSpacing": 0.0,
      "invert": false,
      "brightness": 1.0,
      "textColor": "#1a1a1a",
      "bgColor": "#ffffff",
      "autoScroll": false,
      "scrollInterval": 4
    }
  },
  "options": {
    "themeFontFamily": "微軟雅黑",
    "themeFontSize": 12,
    "themeSwitchMode": "follow-system",
    "uiDarkTheme": "Dark",
    "uiLightTheme": "Light",
    "darkThemeStartTime": "18:00",
    "lightThemeStartTime": "06:00"
  }
}
  • themeSwitchMode:follow-system(跟隨系統)或 by-time (按時間,用 darkThemeStartTime/lightThemeStartTime 兩個時刻)。
  • options.language:介面語言代碼;未設定時跟隨系統區域設定。
  • 檔案由應用讀寫(經互斥鎖串行化),手動編輯後需重啟應用。

9.3 主題自動切換

  • 跟隨系統:監聽系統深淺色變化,即時切換 uiDarkTheme / uiLightTheme 對應的主題。
  • 按時間:每分鐘檢查一次當前時刻,落在深色時段(如 18:00–06:00) 用深色主題,否則淺色。

9.4 解除安裝殘留

解除安裝應用不會刪除配置目錄。如需徹底清理,刪除整個 ~/.wxeditor/ 即可(注意先備份 remote.json 中的伺服器資訊與 ai/ 中的會話資料)。

← Previous Article 第 8 章 快速鍵與命令列 Next Article → 第 10 章 常見問題

Comments

No comments yet