Unknown CSS Tab Completion in Sublime Text

↘锁芯ラ 提交于 2019-12-11 04:58:21

问题


I've seen "Tuts+. PSD to WordPress – Minimal Portfolio Theme" and the author uses the tab completion "sep" and then presses tab and voila he gets multiple line comment separator for CSS something like:

/****************************************************************************/
/* Name Here */
/****************************************************************************/

I want to know how can I achieve this in sublime text? Using what package?


回答1:


The tab completion you saw was most likely a custom snippet

Go to Tools > New Snippet and add the following code

<snippet>
    <content><![CDATA[
/****************************************************************************/
/* ${1:Name Here} */
/****************************************************************************/
]]></content>

<tabTrigger>sep</tabTrigger>
<scope>source.css</scope>

</snippet>


The ${1:Name Here} is a variable that will focus your cursor to that point

The <tabTrigger>sep</tabTrigger> is the defined text that will fire the snippet code with tab

The <scope>source.css</scope> indicates that the snippet will fire when your syntax is set to CSS.

Save with the .sublime-snippet file extension. Example: css-sep.sublime-snippet



来源:https://stackoverflow.com/questions/25529315/unknown-css-tab-completion-in-sublime-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!