I am trying to get custom folding for sublime text 3, namely the markers:
*--#[
some stuff
*--#]
indicate my region. I tried AAAPacakgeDev
, but it doesn't seem to support folding. The package SyntaxFold
introduces its own logic and new keybindings, which seems unnecessary.
It seems .tmLanguage
does support folds, so what I did is I copied Obective-C.tmLanguage
from its package to Packages\FORM
and renamed it to `FORM.tmLanguage'. Then I modified the markers to:
<key>foldingStartMarker</key>
<string>^\*..#\[.*$</string>
<key>foldingStopMarker</key>
<string>^\*..#\].*$</string>
and changed the syntax to FORM. Even though the colors change and the pattern matches when I do a regex on the code, the folds are not working.
What am I doing wrong?
Sublime Text has really good multiple selection support. Here's another way: select all 50 lines (with the mouse, maybe?) then press cmd+shift+right or shift+End, as above, and collapse it.
Select the text you want to hide, then from the Edit menu -> Code Folding -> Fold.
Apparently, this is a long-time requested feature. I found the SyntaxFold
package to be a convenient substitute. My configuration file looks like:
{
"endMarker": "^\\*..#\\][^\n]*$",
"name": "Form",
"startMarker": "^\\*..#\\[[^\n]*$"
},
I also made the key bindings the same as the normal folds.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With