0

Is there any way with TextMate to hide comments when editing code? Sometimes I want to see my code with the full comments and other times just want to see the code itself with all comments hidden. I was hoping there would be a way to toggle the display of comments, but haven't been able to find anything about this.

4

1 回答 1

0

这是您需要逐个语言编辑的东西,但它非常可行。在Bundles -> Bundle Editor -> Edit Languages您的内部会发现 TextMate 用来突出显示特定语法的语言定义。在语法定义中,您会发现foldingStartMarkerfoldingStopMarker

您可以向那些添加注释语法以允许折叠注释本身。单行注释可能非常棘手,但多行注释,具有清晰和独特的开始和停止语法,应该可以正常工作。

例如,对于 PHP,我们将要添加\/\*到开始语法和\*\/结束语法。您需要重新加载捆绑包才能使这些更改生效(或重新启动 TM)。

于 2012-06-23T06:15:35.653 回答