How to get indent folding in plain text or user defined language?



  • When notepad++ language is set to python, you get a neat folding by indentation feature. How can I get that same feature to work in plain text or user defined language?

    I wouldn’t mind keeping notepad++ set to python language, but it highlights a bunch of words which is too distracting.



  • Is there a way to fold text using characters, when language is set to python? I can currently fold based on indentation, but can’t using special characters.

    I need some kind of word processor or text editor that has powerful text folding features. Notepad++ is the best so far, but is still limited unfortunately.



  • @henvu50 ,

    folding by indentation feature. How can I get that same feature to work in plain text or user defined language?

    Folding by indentation happens in the Python lexer (and maybe a few of the others), but cannot be replicated using the User Defined Language system (which requires both open and close keywords or character sequences).

    Is there a way to fold text using characters, when language is set to python

    Not that I’m aware of; as far as I know, the Python lexer only does folding-by-indentation.

    It sounds like you have a circumstance where you want mulitple folding styles (indentation and character) that both work simultaneously. I don’t know of any of the built-in lexers that you could use/abuse to get that. To get something like that, I think you’d have to either write a lexer plugin or use one of the scripting plugins (for example, the PythonScript plugin) to access the Scintilla folding commands and do it yourself.



  • I mean no disrespect to notepad++ with what I’m about to say. I love notepad++.

    I just discovered a new software called Sublime Text.

    • It allows folding of any text or code.
    • It literally has indentation folding that works right off the bat.

    Sublime text is a text and cold folding paradise, my god.

    I’m still using notepad++, but for folding of any kind, Sublime text is superior. The spell check works without any problems as well.



  • @henvu50 said in How to get indent folding in plain text or user defined language?:

    I just discovered a new software called Sublime Text.

    One thing you forgot to mention in your rave review of Sublime Text is that, unlike Notepad++, it is not zero-cost software.
    You are bound to purchase it if you want to use it.

    The spell check works without any problems as well.

    Notepad++ doesn’t have a spell check, so comparing it with Sublime Text on this point is apples and oranges.


Log in to reply