Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to NOT collapse brackets when re-open the do files

    Hi all,

    I am writing to ask a quick question on using the brackets "{ }" in Stata. I want to use it to hide a large intermediate code in a do file, but it always unhides every time I re-open the do file.

    Example:
    Code:
    sysuse auto, clear
    scalar step1 = 0
    scalar step2 = 1
    
    if step1 == 1 {
           reg price headroom
           reg price headroom
           reg price headroom
           reg price headroom
           reg price headroom
    ​​​​​​​       reg price headroom
    }
    
    if step2 == 1 {
           sum price
    }
    In the example, I would like to hide step 1 every time I re-open the do file. Thanks!!

    Best,
    Long

  • #2
    Select all (CTRL-a)
    CTLR+SHIFT+f //hotkey for folding
    Last edited by George Ford; 13 Sep 2023, 19:32.

    Comment


    • #3
      Thanks, George! I tried what you suggested, but it does not fold the code (in both Mac and Windows computers)... I wonder if I need to pre-set anything before using the hotkey. Thanks!

      Comment


      • #4
        You using 18? It works for me.

        Comment

        Working...
        X