marsuero204 downloadsFocus and typewriter modes for Obsidian Markdown editors.
Centerline 是一个 Obsidian 插件,为 Markdown 编辑器提供类似 Typora 的专注模式和打字机模式。
F8 一键切换两者,F9 暂时失效,关闭时全部恢复。F8:切换专注模式;禅模式开启时改为同时切换两个模式F9:切换打字机模式;禅模式开启期间暂时失效阅读模式不会被修改。
禅模式是设置里的一个开关(也可以通过命令面板或左侧栏的月亮图标切换):
F8 变为同时切换两者,F9 暂时失效。F8 恢复为切换专注模式,F9 恢复为切换打字机模式。在 GitHub Releases 下载与 manifest 版本一致的 main.js、manifest.json 和 styles.css。
在 vault 中创建目录:
<你的 vault>/.obsidian/plugins/centerline/
将这三个文件放入该目录。
打开 Obsidian 的 设置 > 社区插件。
启用 Centerline。
也可以从对应版本的 GitHub Release 单独下载 main.js、manifest.json 和 styles.css,再按上面的目录结构放入插件文件夹。
打开 设置 > 社区插件 > Centerline,可以:
专注模式默认透明度为 42%,默认上下文行数为 2,设置会在插件重载后保留。
命令面板提供:
插件不给命令注册固定快捷键,F8 / F9 由插件自己的快捷键系统处理。请不要在 Obsidian 的「设置 > 快捷键」里给这三个命令绑定按键——两套系统会同时响应,导致一次按键触发两次切换。
项目采用 Obsidian 官方 sample plugin 的工程结构,使用 TypeScript 和 esbuild。
npm install
npm run build
npm run dev
npm test
开发构建会生成 main.js。将它与 manifest.json、styles.css 一起复制到 vault 的插件目录即可。
CodeMirror 6 扩展通过 registerEditorExtension 注册,Obsidian 提供的 CodeMirror 包在构建中保持 external,避免加载第二份 CodeMirror 实例。
本项目使用 MIT License,详见 LICENSE。
Centerline adds independent Focus Mode, Typewriter Mode, and a persistent Zen Mode switch to Markdown editors. Focus Mode dims non-active lines (optionally keeping a few context lines around the cursor clear). Typewriter Mode smoothly scrolls the cursor line to the vertical center or the upper third. Enabling Zen Mode turns on both modes at once and makes F8 toggle them together while F9 is suspended; disabling it restores everything. It supports Live Preview, Source Mode, desktop, and mobile.
Default shortcuts are F8 and F9, handled by the plugin itself. Do not bind these commands in Obsidian's own hotkey settings — both systems would fire and each keypress would toggle twice. The plugin is MIT-licensed.
To install, download main.js, manifest.json, and styles.css from the matching GitHub Release. Place them in <your-vault>/.obsidian/plugins/centerline/, then enable Centerline under Settings > Community plugins.