3
votes

I'm looking for a way to fold plaintext by whitespace depth. I would prefer for a notepad++ solution, but if it can only be done in another editor I could deal with that. For example

Header is arbitrary text
 Child is arbitrary text
 Another arbitrary child
  This one has a child of its own
Another arbitrary header
 And its child

Folding line 1 should hide lines 2-4, folding line 3 should hide line 4, and folding line 5 should hide line 6. I've tried a user defined language, but haven't been able to get it to fold without specific block start and end delimiters.

1
Set the language to Python, that seems to work. Perhaps you could copy the language definition and remove the syntax highlighting too. - Blorgbeard
That is similar to what I'm currently doing. Since (AFAIK) built in languages can't be copied and modified, I just use the python lexer with all the syntax highlighting disabled. The only problem with this is that I also edit actual python code sometimes, and I would like the highlighting to be on then. - QuantumRipple
So I see.. Perhaps you could mess around with the style configurator and set up some relatively easy way to switch highlighting on and off. - Blorgbeard

1 Answers

2
votes

You can use Notepad++, change the language > p > python. It will create automatically the folding based on space.