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.....)

 1 <snippet>
 2     <!-- Caution: 1, Need to eacape the letter "}" !! 
 3          2, '$0' is to stop the tab moving forward. -->
 4     <content>
 5 <![CDATA[
 6 Ext.Msg.confirm("${1:Warn}", "${2:Continue?}"${3:, function(option){
 7     if(option == "yes"){
 8         $4
 9     \} else{
10         $0
11     \}
12 \}});
13 ]]></content>
14     <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
15     <tabTrigger>confirm</tabTrigger>
16     <!-- Optional: Set a scope to limit where the snippet will trigger -->
17     <!-- <scope>source.python</scope> -->
18 </snippet>
View Code

 

 

 

posted @ 2013-07-02 20:48  goto13  阅读(201)  评论(0编辑  收藏  举报