Format JSON in Vim with jq
I've been using jq to format my JSON. It's a little less heavy-handed than the more standard Python JSON library; for instance it doesn't alphabetize my keys or convert my two spaces to four.
Here's how to use this library inside Vim (command mode):
:%!jq '.'
Happy JSON-ing!
Tweet