Situation
I have a large, hierarchical json file with many single entries, like so:
{
"tokens": [
"payload, a string"
],
"values": [
{
"value": "frong zshok blam flarb"
}
]
},
{
"tokens": [
"another token"
],
"values": [
{
"value": "another important string"
}
]
},
so there are lots of empty lines with brackets and parentheses.
Question:
How can I have json formatted to only use line breaks after :
or ,
?
What I'm hoping for is something like this:
{ "tokens":
[ "<foo.barbaz>" ],
"values":
[ { "value": "<frong gronk shoop blurb>" } ] },
{ "tokens":
[ "<a string>" ],
"values":
[ { "value": "<another string>" } ] },
Pretty indentation to have contents of [] {} () aligned would be a bonus.
Whether this is done via external tool or vim plugin, I wouldn't mind either.