YAML-PP-p5
YAML-PP-p5 copied to clipboard
Option to indent lists relative to mapping keys
Currently lists as values of mapping keys are not indented relative to mapping keys, so that e.g.
{ foo => ['bar', 'baz'] }
becomes
foo:
- bar
- baz
rather than
foo:
- bar
- baz
I understand that this is done so that the output shall contain as little whitespace as possible but it is a problem when using indentation as fold method in Vim because such lists will also not stay folded when the level the key is on is unfolded.
The best solution would probably be an option to indent lists relative to mapping keys, since this is a matter of taste.
This is on my todo list, but not with a very high priority, because there are so much more important other issues.
I want to implement that in YAML::Tidy, so depending on your use case you could postprocess the YAML to get your preferred formatting. But haven't got the time yet.