Today I Learned

hashrocket A Hashrocket project

Pretty format a json file in vim with jq

Viewing a minified or unformatted json in vim can be a headache. But luckily for us, that's an easy fix if you have jq installed. The following command will pass the contents of your current buffer to the jq external command for formatting:

:!% jq .

See More #vim TILs
Every developer at Hashrocket is a Vim expert. Check out our development environment, Dotmatrix, and if you are in Chicago, come to the Vim Chicago Meetup hosted at our Chicago office.