It seems that Sublime uses tmbundles for language definitions. When I was using TextMate, I modified the PHP.tmLanguage bundle so I could exclude comments from the code folding start/stop markers (foldingStartMarker / foldingStopMarker).
This way I could leave comments unfolded, but fold the functions and methods below them, like in the following code:
/**
* Comment is here (unfolded even if I do a 'fold all').
*/
function my_function_here() {
// This function would be folded if I did a 'fold all').
}
I changed the values in the PHP bundle for Sublime to what’s below, but it seems to have no effect. The only thing I could find in Googling is an old/deprecated documentation page saying that those values weren’t actually used by Sublime… but I would assume Sublime has some way to define start/stop markers for code folding, right?
Current code for folding:
<string>^#!.*(?<!-)php[0-9]{0,1}\b</string>
<key>foldingStartMarker</key>
<string>(\{\s*$|<<<HTML)</string>
<key>foldingStopMarker</key>
<string>(^\s*\}|^HTML;)</string>
For TextMate, being able to customize my folding markers was a handy solution for my particular code folding needs (see: http://stackoverflow.com/questions/7689965/collapse-all-php-functions-in-textmate). Am I missing something here?
Alternatively, is there some other way for me to only fold functions/methods, and not the comments above them?