matte.hx 是一个用 Steel Scheme 编写的 Helix 编辑器插件,通过居中文本栏和聚焦分屏提供无干扰的写作模式。

Stars

4

7 天增长

暂无数据

Fork 数

0

开放 Issue

0

开源协议

AGPL-3.0

最近更新

2026-07-30

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它利用裁剪和软换行将专注式编辑体验引入 Helix,并设计了巧妙的聚焦功能以保留分屏布局,全部以插件形式实现,无需修改编辑器核心。

适合谁使用

  • 追求居中、极简编辑模式的 Helix 用户
  • 频繁使用分屏布局并希望快速切换焦点的开发者
  • 偏好固定行宽以提高可读性的程序员或写作者

典型使用场景

  • 切换居中文本栏,实现无干扰编码或写作
  • 通过快捷键动态加宽或收窄居中度量
  • 聚焦当前分屏以专注编辑,并恢复之前的分屏排列
  • 将居中与聚焦合并为‘专注模式’,一键进入全屏居中编辑

项目优势

  • 边距补偿使文本栏真正居中而非仅视图居中,提升视觉对齐
  • 切换聚焦时能记住并重建分屏布局,最大程度保留状态
  • 通过 Scheme 设置可配置宽度、内边距、软换行和缓冲区栏隐藏
  • 纯逻辑部分(裁剪计算、快照排序等)通过了单元测试

使用前须知

  • 选择器、提示框及其他插件组件不会被裁剪,信息框可能错位或截断
  • 边距测量依赖光标位置;光标移出屏幕或使用制表符缩进时可能失败,回退为无补偿
  • `:config-reload` 会重置插件状态,且计数仅能通过快捷键使用,无法通过输入命令生效

README 快速开始

matte.hx

Zen mode for the Helix editor, written in Steel Scheme: a centred text column, and zoom on the focused split.

:matte clips the editor to a measure and centres it in the terminal. It can also soft wrap at that measure and hide the bufferline; both are off unless you ask for them.

:zoom maximises the focused split and puts the others back afterwards.

Demo

Install

Requires a plugin-enabled Helix build. With forge, Steel’s package manager:

forge pkg install --git https://github.com/waddie/matte.hx

Then in ~/.config/helix/init.scm:

(require "matte.hx/matte.scm")

Or, from a checkout, ./install.sh.

Commands

CommandAction
matteToggle centring
matte_widenWiden the measure by the count, entering the mode first
matte_narrowNarrow the measure by the count
zoomToggle zoom on the focused split
zenToggle matte and zoom modes together, for convenience

Configuration

Settings are functions, called from init.scm before or after the require:

(require "matte.hx/matte.scm")

(matte-width! 88)                  ; columns of text, default 88
(matte-padding! 0)                 ; rows of inset top and bottom, default 0
(matte-soft-wrap! #false)          ; soft wrap at the measure, default off
(matte-bufferline! #false)         ; hide the bufferline, default off
(matte-gutter-compensation! #true) ; centre the text, not the view

Gutter compensation is the difference between centring the text column and centring the view. The gutter sits inside the view, so without it the text reads as sitting right of centre by the width of the line numbers.

A count only reaches a command through a keybinding, so bind the two that take one:

(require "helix/keymaps.scm")
(require "matte.hx/matte.scm")

(keymap (global)
  (normal
    (space (m
            (m ":matte")
            (w ":matte_widen")
            (n ":matte_narrow")
            (z ":zoom")
            (Z ":zen"))))
  (select
    (space (m
            (m ":matte")
            (w ":mat

项目描述

Zen mode for Helix: centre a buffer, zoom and restore splits

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

waddie
waddie GitHub avatar

previously.hx

A Helix editor plugin that provides a fuzzy-filtered picker to browse and reuse yanks, command history, and search history stored in registers.

Scheme
3
Ra77a3l3-jar
Ra77a3l3-jar GitHub avatar

forest.hx

forest.hx is a file tree explorer for the Helix editor offering two selectable UI styles: a persistent sidebar panel with fuzzy search ('snacks') and floating Miller columns with live preview ('mini').

Scheme
71
angieruiz17
angieruiz17 GitHub avatar

codex-gpt-plugin

Codex Gpt Plugin connects a Codex agent to a logged-in ChatGPT Pro session via browser automation, enabling high-leverage tasks like architecture review and debugging strategy.

JavaScript
136