7/20/2015 - 7:26 AM

gedit json formatter

gedit json formatter

Ensure that you have an up-to-date version of Python.  It’s included with nearly every Linux distribution.
Ensure that the External Tools plugin is installed

    Click Edit -> Preferences
    Select the Plugins tab
    Check the box next to External Tools
    Click Close

Add the Format JSON command

    Click Tools -> Manage External Tools…
    Click New (bottom left, looks like a piece of paper with a plus sign)
    Enter a name (Format JSON)
    Paste this text into the text window on the right

#! /usr/bin/env python
import json
import sys
j = json.load(sys.stdin)
print json.dumps(j, sort_keys=True, indent=2)