Sublime Forum

Make folded text more compact


Here is how Microsoft Visual Studio folds text:

Here is how Sublime Text does it:

You can clearly see that it take 3x times more lines, and in some cases more if there is an empty line before the closing curly brace.



Bumping this thread, it seems it has 5 “likes” on it.

I’m curious, did the main dev leave the project or is too busy? Is that feature a little difficult to implement properly?

I found a plugin that does it, called brackethighlighter, but it doesn’t have a “fold all” command, and doesn’t work on fold buttons, only with a keyboard shortcut, and you have to add those shortcuts.

This feature seems to no be non existent on most editors like sublime text or vscode, except brackets (the editor called brackets). For all the years I used sublime, this feature is my main beef.

Someone said it could be done in 30min with a proper python plugin. I should have the courage to make it but I frankly don’t know if “fold all” can be done well.



note that folding in general needs some love:

you can fold any block of text you want, so from that perspective, a plugin can achieve this easily. Some people have reported that helps with this.
If you are talking about the folding arrows in the sidebar, then see above. Apparently VSCode behaves the same way based on indentation:

I think the changelog answers that for itself…



Yes I’ve read that thread, but I could not make a lot of sense from it. I also know about this VSCode issue link as well.

Hope folding is on the top list of next features in sublime text…



There’s a very ugly fix for this problem that I sometimes use. If you put just one space before the closing bracket (and your editor is in indent folding mode) then it collapses the right way, the one-line way. But yes it causes a minor inconvenience with indenting.

I guess a plugin should exist for this. Me and GPT together we gave up a while ago.