Menu

Very Basic Q: How to Use Folding for Outline

2007-02-10
2012-11-13
  • Nobody/Anonymous

    I have searched the forum and looked at the off-line help files, but I cannot figure out how to use Notepad++'s folding feature to just create collapsable outlines and lists of plain text (not program code).  I have tried just using indents for levels and then selecting the folding and collapsing options in the context menu, but didn't work for me.

    I apologize if this is really simple or obvious, but I really can't figure it out and have tried to search for an answer before posting this very basic question.

    Any help will be appreciated.  If you need to flame me, I probably deserve that -- but please tell me how to solve my problem as well.  : )

    George

     
    • pshute

      pshute - 2007-02-21

      I'm not certain that I understand what you want to do, but I think if you set the language to Python then indenting should work.

       
    • Nobody/Anonymous

      Hi,

      I use what you'd asked for.

      You need Function List plugin.  The idea is to define blocks of text as function and body.  You can do that in two steps,

      First create a user defined language under View >> User Define Dialog.  I've created one for txt entension and named it TxT.

      Restart Notepad++ to refresh Function List plugin.  Go to Plugins >> Function List >> User Rules.  Select your language (e.g. TxT) in the Language dropdown; click Edit Rule.

      Decide on some charater or characters to define your function start and body end; I use back-quotes (i seldom use this character) and double back-quotes respectivley.  My rule looks like this:

      Function begin: `
      Function list name: .*$  (this will list all characters till end of line as function name in Function list window; serves to name the outlined text block).
      Body end: ``

      And that's it.  Any text file will have folding block for texts between ` and ``.

      This will not work with new files; cannot associate under defined language as default file type - yet.

      Hope this helps,
      Sivam

       
    • Nobody/Anonymous

      Sivam,

      Thanks so much!

      George

       
    • Nobody/Anonymous

      Sivam,

      I followed the steps to the letter and can indeed see my "functions"
      in the list on the right, but I couldn't get any collapsing! With
      a simple x.txt:

      `test1
      aaaaaaaaaa
      aaaaaaa
      ``

      `test2
      aaaaaaaaaa
      aaaaaaa
      ``

      ` block 3
      aaaaaaaaaa
      aaaaaaa
      ``

      The above would list the 3 functions (and highlight them
      when I entered the block), but no collapse! No [-] or [+]
      icons on the left either. Any ideas? I'm using V 4.0.1.

      Thanks in advance,
      Slo

       
    • Nobody/Anonymous

      Slo,

      You should have a space after `.  Try this,
      ` test1
      aaaaaaaaaa
      aaaaaaa
      ``

      ` test2
      aaaaaaaaaa
      aaaaaaa
      ``

      ` block 3
      aaaaaaaaaa
      aaaaaaa
      ``

      - Sivam

       
    • Nobody/Anonymous

      Is there a way of extending the definitions for functions?

      In asp the function list lists function starting with "Function" but I would also like functions called "Sub" to show up in the list.

      Where can I kind of classify "Sub" as a function?

       
    • Nobody/Anonymous

      You should have a space after `. Try this,
      ` test1 
      aaaaaaaaaa 
      aaaaaaa 
      `` 

      Of course I tried that, with and without spaces.
      Long and short text, etc. I can see the function names
      change accordingly, get highlighted in the list, etc.
      Hitting the Try button in the User Rules dialog shows
      my functions immediately!

      But I never see the [-] and [+] folding icons
      like I do in all other languages...

      Slo

       
    • Nobody/Anonymous

      >You should have a space after `. Try this,
      >` test1 
      >aaaaaaaaaa 
      >aaaaaaa 
      >`` 

      Of course I tried that, with and without spaces.
      Long and short text, etc. I can see the function names
      change accordingly, get highlighted in the list, etc.
      Hitting the Try button in the User Rules dialog shows
      my functions immediately!

      But I never see the [-] and [+] folding icons
      like I do in all other languages...

      Slo

       
    • Nobody/Anonymous

      Slo,George

      Sorry I goofed up in my first response.  Proper procedure is here,

      FOLDING

      This is controlled through View >> 'User define dialog'.  In the new language definition, assign ` to Folder Open Keyword setting and `` to Folder Close Keyword Setting.

      This should fold the text within ` and ``.

      OUTLINE OF FOLDED TEXT

      For this you need Function List plugin.  Go to Plugins >> Function List >> User Rules. Select your language (e.g. TxT) in the Language dropdown; click Edit Rule.

      Decide on some charater or characters to define your function start and body end; I use back-quotes (i seldom use this character) and double back-quotes respectivley. My rule looks like this:

      Function begin: `
      Function list name: .*$ (this will list all characters till end of line as function name in Function list window; serves to name the outlined text block).
      Body end: ``

      -Sivam

       
  • Anonymous

    Anonymous - 2012-01-31

    Five years later…after 2 hours of searching I also can't find how to turn on outlining. Great thing is Notepad++ is free. Bad  thing is Notepad++ is free.

     
  • cchris

    cchris - 2012-02-01

    FunctionList is not stable in the newwer versions of Notepad++, and has not been maintained in years.
    I think the simplest way nowadays is defining an user defined language, with some keywords as fold openers and closes.

    CChris

     
  • Richard Porter

    Richard Porter - 2012-08-28

    pshute answered correctly in 2007. The easiest solution is to select Python as your language from the top menu and indents will then trigger folding in your text document.