I wanted to share a plugin that I’ve been using successfully, basically unchanged, since I built it around October 2024. It’s been very beneficial to me, and I felt a bit sad nobody else could use it.
It defines a system for indent-delimited nested blocks in text files.
The plugin defines the rules for how nested blocks are determined by indent levels, and it uses the Sublime text-folding feature to actually do the folding.
It provides commands like unfolding or folding by 1 level, folding the enclosing block, etc.
It does not support persistent storage of per-file fold state. But if anyone were to add that I’d look into using it.
I use it primarily to help me work on notes files made of nested, indented bullet-point lists. But I think it can also be used to fold indented source code if you really want.
For working on this kind of file it’s usually important to also have lines wrap to the current indent level, as opposed to the left margin, but Sublime does that just fine.
I have my most-used commands bound to Stream Deck buttons:
set_enclosing_fold_to_one_level
fold_enclosing_block
fold_one_more_level
toggle_block_fold
unfold_one_more_level
Obviously keyboard bindings can work too.
I was hoping to just be able to post the plugin source file into this forum so people could take a look if it sounded interesting.
But now I’m here, it doesn’t look like that’s a thing that we do around here? Only image attachments seem to be accepted.
I’ve seen a few people post github links. My plugin isn’t on github but I might put it there if that’s the only acceptable way to share it.