Ubuntu – A text editor or viewer with folding based on indentation

software-recommendationtext-editor

I'm trying to get a better understanding of the *.dsl files as disassembled by the iasl program. Those files looks like:

/*
 * a comment
 */
Stuff
{
    More Stuff
    {
        Beer (a, b) // another comment
    }
    Hmm (mmm)
    {
        Package (0x04)
        {
            0xFFFF
        },

        Package (0x04)
        {
            0xFFFF
        }
    }
    Meh (x, y)
}

This syntax should be really easy for a text viewer / editor. Since I'm just viewing these files, the editing feature is not needed. The file has 11k lines which makes it more difficult to scan for text.

Is there a lightweight text viewer with folding capabilities? Both CLI and GUI solutions are welcome.

Addition: I would like to have the next features too:

  • shortcuts to jump from the child to the parent (e.g. Beer to More Stuff or the { next to it)
  • quick search (till now, I used less in which I can search by pressing / followed by the search term and Enter. The Firefox "on the bottom search" bar is something that I would like to see for a GUI program)
  • bonus: hiding blocks of text

The purpose of the viewer is getting me through the text file faster.

Best Answer

The editor geany, also useful as an IDE, has indentation based folding for python source files.

It should be a way to associate .dsl files with this type of representation

enter image description here