Folding in plain text (.txt) files

Hi. Is there any way to enable folding in plain text files?

Hey @JesperIRL

There is not. Not sure how that would work. What would be your delimiter? Have you seen it in other editors?

  • Carey

Yes, there is an editor (Mac) called FoldingText that does this. (https://www.foldingtext.com) Obviously folding is the soul purpose of that editor so it’s not really that impressive apart from the ability to fold in text files. I would very much like to move the documents I have there into Komodo instead.

They use # as the delimiter, folding any text down to the next line that starts with a #.
I could most likely live with any syntax for this if you’d prefer some other character.

It’s really good for note-taking, lists of different kinds etc.

Example:

The folded text looks like:
# Series 1 (2005) Ninth Doctor
# Series 2 (2006) Tenth Doctor
# Series 3 (2007)
# Series 4 (2008)
# Specials (2008 - 2010)
# Series 5 (2010) Eleventh Doctor

And clicking the # will expand it to:

# Series 1 (2005) Ninth Doctor
157 Rose
158 The End of the World
159 The Unquiet Dead
160 Aliens of London
a. Aliens of London
b. World War Three
161 Dalek
162 The Long Game
163 Father’s Day
164 The Empty Child
a. The Empty Child
b. The Doctor Dances
165 Boom Town
166 Bad Wolf
a. Bad Wolf
b. The Parting of the Ways
# Series 2 (2006) Tenth Doctor
167 The Christmas Invasion
168 New Earth
169 Tooth and Claw
170 School Reunion
171 The Girl in the Fireplace
172 Rise of the Cybermen
a. Rise of the Cybermen
b. The Age of Steel
173 The Idiot’s Lantern
174 The Impossible Planet
a. The Impossible Planet
b. The Satan Pit
175 Love & Monsters
176 Fear Her
177 Army of Ghosts
a. Army of Ghosts
b. Doomsday
# Series 3 (2007)
…

@JesperIRL is that meant to be Markdown? That would be interesting. The only delimiter for arbitrary text seems like extra newlines separating paragraphs but if it’s Markdown like your example appears to be then you can use the Markdown spec. Using # seems like a good idea.

Unfortunately this isn’t supported and it’s too late in our development process to get it into the next release.

If you’d like to file a enhancement request in your Github issue tracker, please feel free. Someone might be interested in picking it up in the community:

  • Carey

Yes, that is markdown. They also have stuff like bold and italic text etc using * and **. But that’s less important (though nice), it’s the folding that I crave.

I’ll file an enhancement request.

@JesperIRL, ya folding on # or more than one would be the most obvious one. Maybe on a table… I do pretty basic MD usually.

Make sure you link the ticket back here when you create it. Thanks!

Filed https://github.com/Komodo/KomodoEdit/issues/3819

Thank you for your engagement!

1 Like