我想在textmate中为markdown启用代码折叠。如何在TextMate中为折扣启用代码折叠?
具体来说,我希望任何标题(文本前面有一个或多个'#'字符)作为将在它与下一个标题和/或水平规则之间切换块的行。例如:
# Level 1 Heading - I'd like the block below to fold
The text I'd like to fold away
## Level 2 Heading
More text...
BBEdit似乎为降价做到了这一点。 TextMate支持代码折叠,适用于表示带有成对(和相同缩进)大括号的块的语言。
我知道TextMate提供了两个变量,您可以在语言语法文件中设置,但我需要更多的正则表达式才能比我具有的才能。以下就是目前居住在降价语言语法的代码折叠设置:
foldingStartMarker = '(?x)
(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?>
|<!--(?!.*-->)
|\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
)';
foldingStopMarker = '(?x)
(</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)>
|^\s*-->
|(^|\s)\}
)';
任何帮助,不胜感激!