I’m using sublime 3 on Windows, so I edit text-type Windows’ registry file which has block header with character pair of ‘[’ and ‘]’, as it’s common in ini files; a section is initiated by a text string enclosed by [ and ] character then followed by another strings as its member. The question is How can I fold (and unfold) these blocks when I’m editing it… Thank you so much in advance
I'm using sublime on Windows
iamntz
#2
Since sublime does this code folding thing only based on indentantion, you won’t be able to do it with one click.
However, you could do it manually:
- while you’re inside of square braces ( e.g.
[ke|y]
) - press ctrl+shift+m to select the text between matching brackets;
- then press ctrl+shift+[ to collapse the selected text.
Probably you could do the last two steps with a macro, but i’m not sure.
To uncollapse, you just need to press ctrl+shift+] while your text cursor is touching the collapsed block or ctrl+k, ctrl+0 to uncolapse everything.
0 Likes