# ───────────────────────────────────────── # Helix 配置文件(2026 官方验证版) # 重载配置::config-reload # ───────────────────────────────────────── theme = "gruvbox_dark" # 高对比度主题,备选:catppuccin_mocha # ══════════════════════════════════════════ # [editor] 核心编辑器行为 # ══════════════════════════════════════════ [editor] cursorline = true # 高亮当前行背景 mouse = false # 禁用鼠标交互 bufferline = "multiple" # 打开多文件时显示标签栏 color-modes = true # 不同模式下状态栏显示不同颜色 scrolloff = 8 # 光标距屏幕边缘保留 8 行视距 text-width = 80 # 文本宽度基准,影响 wrap 等行为 rulers = [80] # 在第 80 列显示竖线参考标尺 auto-format = true # 保存时自动格式化(依赖 LSP formatter) trim-trailing-whitespace = true # 保存时删除行尾空白 insert-final-newline = true # 保存时确保文件末尾有换行符 popup-border = "all" # 弹出窗口(补全、文档)显示完整边框 indent-heuristic = "hybrid" # 混合策略推断缩进:先 treesitter,再文本匹配 completion-trigger-len = 2 # 输入 2 个字符后触发自动补全 idle-timeout = 200 # 无操作 200ms 后触发 LSP 诊断等后台任务 end-of-line-diagnostics = "warning" # 行尾显示 warning 及以上级别的诊断信息 gutters = [] # 清空左侧边栏,不显示行号和 diff 标记 # ══════════════════════════════════════════ # [editor.lsp] LSP 行为 # ══════════════════════════════════════════ [editor.lsp] display-inlay-hints = true # 显示内联类型提示(如变量类型、参数名) display-messages = true # 在状态栏显示 LSP 服务端消息 auto-signature-help = true # 输入函数参数时自动弹出签名帮助 # ══════════════════════════════════════════ # [editor.inline-diagnostics] 行内诊断 # ══════════════════════════════════════════ [editor.inline-diagnostics] cursor-line = "warning" # 当前行:显示 warning 及以上级别的诊断 other-lines = "disable" # 非当前行:不显示行内诊断,避免视觉干扰 prefix-len = 1 # 诊断信息前缀缩进 1 个字符 # ══════════════════════════════════════════ # [editor.cursor-shape] 光标形状 # ══════════════════════════════════════════ [editor.cursor-shape] normal = "block" # Normal 模式:块状光标 insert = "bar" # Insert 模式:竖线光标 select = "underline" # Select 模式:下划线光标 # ══════════════════════════════════════════ # [editor.statusline] 状态栏 # ══════════════════════════════════════════ [editor.statusline] left = ["mode", "spinner", "file-name", "file-modification-indicator"] center = ["position-percentage"] right = ["diagnostics", "selections", "version-control", "position", "file-encoding"] separator = "│" mode.normal = "NORMAL" mode.insert = "INSERT" mode.select = "SELECT" # ══════════════════════════════════════════ # [editor.file-picker] 文件选择器 # ══════════════════════════════════════════ [editor.file-picker] hidden = false # 显示隐藏文件(以 . 开头) git-ignore = true # 遵守 .gitignore 规则,过滤已忽略文件 # ══════════════════════════════════════════ # [editor.indent-guides] 缩进参考线 # ══════════════════════════════════════════ [editor.indent-guides] render = true # 显示缩进参考线 character = "╎" # 参考线使用虚线竖线字符 skip-levels = 1 # 跳过第一级缩进,减少顶层代码的视觉噪音 # ══════════════════════════════════════════ # [editor.soft-wrap] 软换行 # ══════════════════════════════════════════ [editor.soft-wrap] enable = false # 禁用软换行,超出宽度的行需水平滚动查看 # ══════════════════════════════════════════ # [editor.auto-save] 自动保存 # ══════════════════════════════════════════ [editor.auto-save] focus-lost = true # 窗口失去焦点时自动保存 after-delay.enable = false # 不启用定时延迟自动保存 # ══════════════════════════════════════════ # [editor.search] 搜索行为 # ══════════════════════════════════════════ [editor.search] smart-case = true # 全小写时忽略大小写,含大写时区分大小写 wrap-around = true # 搜索到文件末尾后回绕至开头继续 # ══════════════════════════════════════════ # [keys.normal] Normal 模式快捷键 # ══════════════════════════════════════════ [keys.normal] "C-s" = ":write" # Ctrl+S 保存文件 "C-a" = "select_all" # Ctrl+A 全选 "esc" = ["collapse_selection", "keep_primary_selection"] # Esc 取消多光标/收缩选区,保留主选区 # ══════════════════════════════════════════ # [keys.insert] Insert 模式快捷键 # ══════════════════════════════════════════ [keys.insert] "C-s" = ["normal_mode", ":write"] # Ctrl+S 退出 Insert 模式并保存文件