Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • browsers (firefox, chrome, IE)
  • vim
  • nedit
  • emacs
  • eclipse
  • komodo
  • slickedit

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!

like image 272
user1111991 Avatar asked Dec 22 '11 18:12

user1111991


1 Answers

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
like image 100
Jeremy Woodland Avatar answered Nov 16 '22 02:11

Jeremy Woodland