Sublime Text 3 的自定义折叠 [英] Custom folding for Sublime Text 3
问题描述
我正在尝试为 sublime text 3 自定义折叠,即标记:
I am trying to get custom folding for sublime text 3, namely the markers:
*--#[
some stuff
*--#]
请注明我所在的地区.我尝试了 AAAPacakgeDev
,但它似乎不支持折叠.SyntaxFold
包引入了自己的逻辑和新的键绑定,这似乎是不必要的.
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.
看起来 .tmLanguage
确实支持折叠,所以我所做的是将 Obective-C.tmLanguage
从它的包复制到 Packages\FORM
并将其重命名为FORM.tmLanguage".然后我将标记修改为:
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>
并将语法更改为 FORM.即使在我对代码执行正则表达式时颜色发生变化并且模式匹配,折叠也不起作用.
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.
我做错了什么?
推荐答案
显然,这是一个长期的请求的功能.我发现 SyntaxFold
包是一个方便的替代品.我的配置文件看起来像:
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.
这篇关于Sublime Text 3 的自定义折叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!