The strength and beauty of VIM is the simple interaction with lots of external programs.
To format any JSON file in VIM/GVIM:
:% !jq .
% means the file you’re working on, and `!jq` is run the external command `jq`
You need to have `jq` installed:
sudo apt install jq
jq (1) - Command-line JSON processor