如何让 Zencoding 为 Sublime Text 2 中的 div 添加结束注释? [英] How to get Zencoding to add a closing comment to divs in Sublime Text 2?
问题描述
我以前设法在 ST2 中使用 Zencoding 来自动注释结束标签,例如:
我会输入 div.my_div 并点击 Tab 并创建 div,它还会添加结束注释,以便我可以轻松导航文档中的结束 div 标签.
*<!-- .my_div -->
你们中有人知道如何复制这个吗?
谢谢.
您应该使用评论"过滤器:http://code.google.com/p/zen-coding/wiki/Filters
.my_tag|c
您还可以让 ZC 自动将评论"过滤器应用于 HTML.这有点hacky,但您需要打开zen_settings.py 文件并在https://github.com/sublimator/ZenCoding/blob/master/zencoding/zen_settings.py#L511
它应该是这样的:
"filters": "html,c"
I had previously managed to get Zencoding in ST2 to autocomment closing tags eg:
I'd type div.my_div and hit tab and as well as creating the div, it would also add a closing comment so that I can easily navigate the closing div tags in my document.
<div class="my_div">
*
</div> <!-- .my_div -->
Do any of you know how to replicate this?
Thank you.
You should use "comment" filter: http://code.google.com/p/zen-coding/wiki/Filters
.my_tag|c
You can also make ZC to automatically apply "comments" filter to HTML. It‘s a bit hacky, but you need to open zen_settings.py file and add c
filter at https://github.com/sublimator/ZenCoding/blob/master/zencoding/zen_settings.py#L511
It should look like this:
"filters": "html,c"
这篇关于如何让 Zencoding 为 Sublime Text 2 中的 div 添加结束注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!