notepad++ user defined regions with folding

后端 未结 7 885
梦谈多话
梦谈多话 2020-11-28 23:00

I can\'t figure out how to configure notepad++ to display regions for user defined keywords.

I have a big trace file which shows the start and the end of a procedure

相关标签:
7条回答
  • 2020-11-28 23:11

    Another simple way is just to add a comment marker followed by open-block to begin a block, and a comment marker followed by end-block to end a block. In C, C++, Java, Javascript, etc. it would look like this:

    //{
    
    //}
    
    0 讨论(0)
  • 2020-11-28 23:12

    I used Marcelo's answer to solve this for myself (in Perl), with one change...
    If I included a space between the comment symbol and the bracket then it wouldn't work. It had to be placed immediately after:

    #START example
    ################{
    
    print "Hi there! ";
    print "How are you?\n";
    
    #}END example
    

    Note that if I do:

    #END example }
    

    with the bracket after the text it won't work either

    0 讨论(0)
  • 2020-11-28 23:14

    For version 6.5.5 and above:

    Under the menu "Language" there is a menuitem called "Define your language..."

    In the tab "Folder & Default" is a group called "Folding in code" where you can enter an "Open"- and a "Close"-Keyword.

    For versions older than 6.5.5:

    Under the menu "View" there is a menuitem called "User-Defined Dialog..."

    View Define your language

    In the tab "Folder & Default" you can enter a "Folder Open Keyword" and a "Folder Close Keyword"

    Folder Open Close Keyword

    0 讨论(0)
  • 2020-11-28 23:22

    STEP ONE: Add a unique key with open and close (i.e.,

    #1
    {{{
    #2
    {{{
    #2
    }}}
    ##
    }}}
    

    Use indentation and/or comments to indicate nest-level.

    Step 2: {CTRL}-H when you're finished. Replace all '{{{' and '}}}'.

    STEP 3: Comment strip (app).

    0 讨论(0)
  • 2020-11-28 23:23

    If it's SQL, then encapsulating your code with BEGIN and END works well. The BEGIN statement is shown, plus any comments you add on the same line.

    e.g:

    BEGIN --creating temp table with eligible users
    
       ...code
    
    END
    
    0 讨论(0)
  • 2020-11-28 23:25

    I have a similar problem. I want to add a custom tag like #region / #endregion to create arbitrary folding points in languages that don't support it. Specifically, I am trying to do this for php.

    After researching for an hour or two, it seems that modifying an existing language is quite difficult due to the underlying scintilla lexer, and writing a plugin may be the only way to accomplish this.

    I did discover however a decent workaround:

    Wrap the code you wish to fold in comments like:

    #{ 
    ...
    #}
    

    Then move your cursor before the open brace and press CTRL+ALT+b to highlight the entire block, followed by ALT+h to hide it.

    It's a different operation than folding, but it works in a pinch.

    0 讨论(0)
提交回复
热议问题