A simple Snippet in ST2

时间:2023-03-09 16:56:50
A simple Snippet in ST2

Reference: http://web-design-weekly.com/2012/07/03/snippets-in-sublime-text-2/

A sample - cofirm (Tools | New Snippet.....)

 <snippet>
<!-- Caution: 1, Need to eacape the letter "}" !!
2, '$0' is to stop the tab moving forward. -->
<content>
<![CDATA[
Ext.Msg.confirm("${1:Warn}", "${2:Continue?}"${3:, function(option){
if(option == "yes"){
$4
\} else{
$0
\}
\}});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>confirm</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>