如何在TextMate 2中创建新的代码段?当我转到“编辑捆绑包”时,我不知道如何创建一个新的片段。
TextMate 2尚未发布,处于Alpha状态。捆绑软件编辑器不是最后一个领域之一。
虽然包含了概念验证包编辑器,但它是临时的,存在一些缺陷,而不是我们设想的最终包编辑器的样子。
这些说明适用于2.0版(8956),当前版本为2012年1月20日。
在TextMate 2菜单中选择Bundles»Edit Bundles…。
选择您要添加代码段的包,例如HTML。按Cmd-N创建一个新的捆绑商品,然后选择Snippet。
它将自动添加到“菜单操作”小节中。您可以在抽屉中更改其设置,例如键盘快捷键,并在底部的编辑器中更改其内容。
在要输入字符的序列中输入一个制表符触发器(例如snip
),然后按Tab触发代码片段或分配键盘快捷键。
范围选择器指定可以使用触发器将代码段插入哪个范围。要查找所选语言的范围,请切换到具有该语法的文档,然后按Ctrl-Shift-P在光标下方显示所有适用的范围。
For example, if you want your snippet to be available anywhere in HTML documents, enter text.html.basic
; or source.shell
for shell scripts. You can enter multiple scopes, separated by comma, or only scope name prefixes (e.g. source
) to apply to all matching source.*
scopes.
For anything else, just look at all the other snippets you can access from that window and see how they achieve some desired behavior.
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句