In a previous post, I wrote about how jq is great because it doesn’t alphabetize JSON keys by default. I still think that’s great, because sometimes the key order is meaningful, such as might be found in a
We can add alphabetization to jq, however, using the
-S flag. To format and and sort you current buffer in Vim, run the following:
:%!jq -S '.'