2

I'm working with ElasticSearch now which sometimes can throw 40MB JSONs back at me. Just browsing such a thing is difficult without support for collapsing/expanding some JSON subtrees (in brackets in JSON of course) and I need to edit this on top of browsing.

Is there an editor or at least viewer for OSX that is capable of doing that?

Unfortunately SublimeText 3 is not able to do that.

1

You can use Vim editor. See: How to fold text in a JSON file?

As per above, the minimal setup would be:

:set filetype=json
:syntax on
:set fdm=syntax

Then use zo and zc shortcuts to open and close foldings (see: :h fold-commands).

See also: Folding at Vim Wikia.

For better JSON highlighting of keywords vs values, you can consider vim-json plugin.

To improve performance further more for a big file, try to open it in read-only (-R).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.