Home About me Cookie Zero Now archive

Formatting JSON files in Vim

You can paste a bunch of minified JSON into a buffer, open the command window and type :%!jq and then hit enter. This will update the buffer with the formatted output.

You can then use :%!jq -c to re-minify the output

Published on February 9, 2024


Reply by email