sublime 3 使用Snippets創建代碼片段

選擇菜單 Tools -> new snippet...


<snippet>

<content><![CDATA[

some code write here '${1:highlight}'

]]></content>

<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->

<tabTrigger>tt</tabTrigger>

<!-- Optional: Set a scope to limit where the snippet will trigger -->

<!-- <scope>source.php</scope> -->

</snippet>


可以通過設置快捷鍵快速顯示,如上,輸入tt後按tab鍵即可顯示出來,或選擇菜單Tools -> Snippets... 在列表裏選擇


保存時存放在\Packages\User目錄下,後綴名必須爲 .sublime-snippet



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章