how to use codefolding feature of notepad++ for normal text documents

8

4

When I open an reg file in notepad++ file in notepad++, I see the amazing functionality to minimize and maximize the subkeys of a base key by clicking on that little arrow on the left. Can I get this functionality in normal documents? I want to create different categories for ex: topic 1, topic 2, etc, which I can maximize and minimize.

http://imgur.com/JU8JfwF

adi

Posted 2013-07-31T08:33:36.373

Reputation: 103

1If you click Language -> Define your language... you can define code folding styles in the Folding in code 1 style boxes. You need to set a symbol which means "open the fold" (maybe "Topic") and a symbol which closes the fold (e.g. "Endtopic"). However, this will mean that you will need to add "Endtopic" to your files, so I'm not sure that this is an ideal solution – TheTurkey – 2013-07-31T11:04:56.817

this is amazing , sorry for late reply but your answer worked for me , thanx :) – adi – 2013-08-05T22:44:53.570

Thanks Adi, glad I could help! I've made my comment into an answer - could you please accept it? – TheTurkey – 2013-08-06T07:17:53.540

dude , really very sorry for late reply , i had tried to upvote it but couldn't because i don't have enough reputation to tick a reply as answer.maybe someone else who may benefit from it can or i will when i have enough rep ,thanx again , it was working very useful for me ,have a great day – adi – 2013-09-06T20:27:21.727

Answers

5

You can define your own syntax highlighting and code folding rules by defining a 'User language'. Click Language -> Define your language... to open the User Defined Language dialog.

This dialog gives options for many levels of customisation. In your case, you could add the word 'Topic' to the 'Folding in code 1 style' open list.

TheTurkey

Posted 2013-07-31T08:33:36.373

Reputation: 911

3

Basically, View -> User-Defined Dialogue
Create New. I call it Txt, set the extension to .txt
In folder and default pane, set the open and close options.
I use {{ and }} respectively.

Then from the View menu, use the fold, collapse options.

More details in http://sourceforge.net/p/notepad-plus/discussion/331754/thread/c01d98f7

charioteer

Posted 2013-07-31T08:33:36.373

Reputation: 31