Macros 在文件中使用宏函数升华文本2

Macros 在文件中使用宏函数升华文本2,macros,sublimetext2,Macros,Sublimetext2,假设我想使用一个宏,它将向当前文件中添加一个头。 是否有一个插件允许我声明宏并在文本中使用它 例如: 宏名称:css标题 卡莱丽:!C针 所以当我打字的时候!C将光标缝合到我的文件中,然后按enter键,它将显示: /*------------------------------------*\ [Insert Title] \*------------------------------------*/ /* [Insert section title] [Insert descriptio

假设我想使用一个宏,它将向当前文件中添加一个头。 是否有一个插件允许我声明宏并在文本中使用它

例如:

宏名称:css标题

卡莱丽:!C针

所以当我打字的时候!C将光标缝合到我的文件中,然后按enter键,它将显示:

/*------------------------------------*\
[Insert Title]
\*------------------------------------*/
/*
[Insert section title]  [Insert description]
*/

我强烈建议为此使用内置代码段函数。它允许你做任何你需要的事情,而无需安装额外的插件

升华文本>工具>新代码段:

<snippet>
<content>
<![CDATA[
Hello, ${1:this} is a ${2:snippet}.
]]>
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

你的看起来像:

<snippet>
<content>
<![CDATA[
/*------------------------------------*\
[$1] Insert Title
\*------------------------------------*/
/*
[$2] Insert section title  [$3] Description
*/
]]>
</content>
<tabTrigger>!cssTitle</tabTrigger>
<scope>text/css</scope>
</snippet>

!C针
文本/css
当然,你可以随心所欲地改变它。也不需要
。如果您喜欢或不喜欢,可以将其删除

另存为>cstitle.sublime.snippet


Sublime Text 2>软件包>CSS>(保存在此处)。

您为什么不想为此使用内置宏功能?这正是我想要的。我是一个新的升华者,我试图把一切都弄清楚。谢谢