Expand description
The structured-value editor: a foldable tree for JSON and YAML.
Vix’s Tools menu offers Edit JSON and Edit YAML commands that parse the active buffer into a tree of objects, arrays, and scalars, then let the user fold/unfold containers, navigate, and edit scalar values — code folding, but for structured data. Saving serializes the tree back to JSON or YAML.
JSON and YAML share one model: both parse (via serde_norway, which also reads
JSON) into Val (private), and only the serializer differs (a key-order-preserving
JSON pretty-printer, or serde_norway for YAML). The Format chosen at open
time decides the title and the serializer.
Like the other editors, this module owns the data, cursor, fold state, and an
undo history, and interprets keys itself, returning an Outcome telling the
host when to close or save.
Keys: ↑/↓ (or k/j) move; ←/→ (or h/l) collapse/expand (or step
to parent/first child); Enter/F2 edit the selected scalar (or toggle a
container); Space toggles fold; u/Ctrl+R undo/redo; Ctrl+S
save; Esc/q close.
Structs§
- Tree
- A foldable, editable JSON/YAML value tree with a cursor and undo history.