go install github.com/coreyog/fld
Code folding in the terminal.
Controls
Up, Down: Move up and down the file.
Space: Fold the section the cursor is in
Left, Right: Scroll left and right for long strings
F: Fold all sections
U: Unfold all sections
Q, Esc: Quit
It loads the entire file into memory, so it's not suitable for LARGE files.
Couldn't call it fold
because that's already a linux tool. It cuts off lines at a
max length.