Joined February 2017
·
jlb333333
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.
@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.