Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Materin Ctx

leapord40 downloads

Open JSON / YAML files in a native-feeling editor view with formatting, folding and search.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates2

Obsidian 插件:在 Obsidian 中直接打开、查看、编辑 JSON / YAML 文件。

English: an Obsidian plugin that opens JSON / YAML files in a native-feeling CodeMirror 6 editor view with formatting, folding and search.

功能 / Features

  • 文件接管 — 点击 vault 中的 .json / .yaml / .yml / .jsonc 文件,直接在 Obsidian 内打开,不再弹出系统应用。
  • 语法高亮 + 行号 — 基于 CodeMirror 6(Obsidian 内置运行时),与原生编辑器手感一致。
  • 折叠 — 点击行号槽的箭头折叠对象 / 数组 / YAML 块;支持「全部折叠 / 全部展开」按钮与命令。
  • 搜索 — Ctrl/Cmd + F 打开搜索面板,支持高亮全部、大小写、正则与替换。
  • 格式化 — 一键按配置重新缩进:
    • JSON / JSONC:容错重缩进(语法有错也能排版),保留注释;
    • YAML:Document 往返,保留注释,支持行宽限制(0 = 不限制)。
  • 编辑与保存 — 直接编辑,Ctrl/Cmd + S 或「保存」按钮写回文件;未保存改动以橙色圆点提示。
  • 外部修改同步 — 文件在磁盘上被其他工具修改后自动刷新;若有未保存改动,显示提示条由你决定是否重载。
  • 设置 — 缩进字符(空格 / Tab)、缩进宽度(2 / 4 / 8)、自动换行、行号、打开时折叠、YAML 行宽。

备注 / Notes

  • YAML 规范禁止 Tab 缩进:设置选择 Tab 时,YAML 格式化自动回退为对应宽度的空格(编辑器缩进仍使用 Tab)。
  • 读取文件时会剥离 BOM,保存时不回写。
  • 文件行尾(CRLF / LF)在保存时保持原样。
  • JSONC:语法高亮按 JSON 处理(注释无高亮),校验与格式化按 JSONC 宽松规则(允许尾随逗号、注释)。

安装 / Install

从 Release 页下载 main.js、manifest.json、styles.css,放入 <vault>/.obsidian/plugins/materin-ctx/,启用插件即可。

开发 / Development

npm install        # 安装依赖
npm run dev        # 开发构建(watch,自动部署到 .debug-vault)
npm test           # vitest 单元测试
npm run check      # tsc 类型检查
npm run lint       # eslint(eslint-plugin-obsidianmd recommended)
npm run build      # 生产构建(root main.js)

调试 vault 位于 .debug-vault/(含 hot-reload 插件),npm run dev 后用 Obsidian 打开该 vault 即可热重载调试。示例文件:sample.json / config.yaml / settings.jsonc。

License

MIT

HealthExcellent
ReviewSatisfactory
About
Open and edit .json, .jsonc, .yaml and .yml files directly inside Obsidian using a native CodeMirror 6 editor view. View syntax highlighting, line numbers, folding and search, format tolerant JSON/JSONC and YAML while preserving comments, and save with disk-sync and external-change detection.
JSONEditingCode
Details
Current version
0.1.1
Last updated
3 weeks ago
Created
3 weeks ago
Updates
2 releases
Downloads
40
Compatible with
Obsidian 1.7.2+
Platforms
Desktop, Mobile
Report bugRequest featureReport plugin
Author
leapordleapord
  1. Community
  2. Plugins
  3. JSON
  4. Materin Ctx

Related plugins

Code Space

Professional code file management with visual dashboard, syntax highlighting editor, Markdown embedding, external folder mounts, and terminal integration.

VSCode Editor

Edit Code Files like VSCode.

LanguageTool Integration

Advanced grammar and spell checking, powered by LanguageTool.

Meta Bind

Make your notes interactive with inline input fields, metadata displays, and buttons.

Advanced Tables

Improved table navigation, formatting, and manipulation.

Thino

Quickly capture memos and display them in the sidebar with a heatmap. (Closed source)

Mermaid Tools

Improved Mermaid.js experience: visual toolbar with common elements and more.

Editing Toolbar

The Editing Toolbar is modified from cMenu, which provides more powerful customization settings and has many built-in editing commands to be a MS Word-like toolbar editing experience.

Outliner

Work with your lists like in Workflowy or Roam Research.

Hover Editor

Transform the Page Preview hover popover into a fully working editor instance.