user1111991
user1111991

Reputation: 111

Options for collapsing YAML when viewing?

I chose YAML over XML as a format to store our input and output data. It works well, but now I'm discovering one of YAML's main weaknesses: editor/viewer support.

I need help to simplify the viewing of potentially large YAML files by coworkers. Here are some of the programs they might use:

I'm most interested in using browsers to view the YAML because that would cover everyone, but solutions for any of those other editors would also be helpful. The less customization required by the user, the better!

Anyone know of browser plugins or have any other tips for viewing YAML?

Thanks in advance!

Upvotes: 11

Views: 4939

Answers (2)

de-jcup
de-jcup

Reputation: 1865

For eclipse you can use

https://marketplace.eclipse.org/content/yaml-editor/

which supports folding (but must be enabled in preferences) or you just use the quick outline Ctrl + Shift + o and type identifer as shown in example - here *city was used to show up only those parts of document. Pressing Enter will jump to the coresponding part.

screenshot showin quickoutline in yaml editor plugin

PS: I am the maintainer of the plugin

Upvotes: 0

Jeremy Woodland
Jeremy Woodland

Reputation: 3745

In vim you should look at Folding. See http://vim.wikia.com/wiki/Folding The default method of indent based folding should be sufficient for YAML.

  • :set foldmethod=indent
  • zo opens/expands/unfolds
  • zc collapses/closes/folds

Upvotes: 4

Related Questions