elp-revive / origami.el

A folding minor mode for Emacs
MIT License
32 stars 6 forks source link

feat: open nodes till depth #15

Closed mosquito-magnet closed 3 years ago

mosquito-magnet commented 3 years ago

Hi,

This adds a method that allows opening all child nodes till a given tree depth, starting from the node at point. It is inspired by hs-hide-level, which I found useful, but missing from origami. I often deal with large, deeply nested data structures (json, xml), where its useful to show a certain level when skimming through the file.

I'm not an elisp expert, so any suggestions for improvement are more than welcome :)

jcs090218 commented 3 years ago

Hi, thanks for contribution to this package!

How do you use this command? Sorry I am not an Emacs Lisp expert too! I think the command should be merge into this package since I am able to see value of this command! :)

mosquito-magnet commented 3 years ago

To use it, enter a numeric prefix arg by digit-argument (C-1 to C-9) or negative-argument (C-- followed by number), and execute the command. Maybe I should improve the docstring to make it more clear.

Edit: Heres a stupid little test file for playing around with the function: nested_indentation.txt

jcs090218 commented 3 years ago

Merged! Thanks for explaining this to me! :)