Joined February 2017
·

jlb333333

Posted to Format JSON in vim over 1 year ago

@lastorset:
Try

:%!python -c "import json, sys, collections; print json.dumps(json.load(sys.stdin, objectpairshook=collections.OrderedDict), indent=4)"

Thank you.
Initial tests look good.
Still testing for use cases.

Posted to Format JSON in vim over 1 year ago

Unfortunately it sorts the json alphabetically. is there a switch to prevent this sorting. I want to keep my document in it's original order.
Otherwise an absolutely amazing tool.

Achievements
1 Karma
0 Total ProTip Views