PaulJuliusMartinez / jless

jless is a command-line JSON viewer designed for reading, exploring, and searching through JSON data.
https://jless.io
MIT License
4.61k stars 87 forks source link

open/close children recursively #127

Closed llimllib closed 1 month ago

llimllib commented 12 months ago

Here's an example usage; I'm browsing a package-lock file for a project with a large dependency tree and I want to collapse all the children of the packages node so that I can just browse that to scan for packages relevant to a problem I'm having.

In vim, I can do something like zM to recursively close all folds, zo to open just the packages fold, and all its children are collapsed in just a few keystrokes. (It's actually moderately a pain to close just the child nodes, but that's my ideal motion)

Currrently (as far as I can tell from the manual) there's no way to do "collapse all children of the packages node" - would love to have a shortcut for it.

PaulJuliusMartinez commented 1 month ago

C and E commands, which will deeply collapse and expand a node and all of its siblings, were added in v0.9.0.

To close just the child nodes you can either do:

llimllib commented 1 month ago

perfect, thanks!