Is there a good way to use folding with "plain text" files?
But what do I mean by "plain text"?
I'm thinking of text like it is used in human communication when no formal structure is required.
It has some ad-hoc structure, like paragraphs, indentation changes, maybe ranges of cited lines.
But with no clear rules.
It's certainly possible to use folding for this kind of text: it can be done manually.
I am looking for ways to make that easier.
One way to answer this could be to use a plugin that provides a set of support functions, used loosely together.
They could implement things like
- handling folding for structured sections of text, while tolerating the other parts
- check or enforce rules of some kind of minimal structure
- support restructuring of the text
A different approach, related to the third item, would be to require to change the text to be more structured.
With this, a valid, but suboptimal solution is to require the user to reformat the text to Markdown, and then use a standard Markdown filetype plugin to handle the folding.