########################################################################### # TEXTMATE SNIPPETS # ########################################################################### snippet for "for... (for)" b for {${1:set i 0}} {${2:\$i < \$n}} {${3:incr i}} { ${4} } endsnippet snippet foreach "foreach... (foreach)" foreach ${1:var} ${2:\$list} { ${3} } endsnippet snippet if "if... (if)" b if {${1:condition}} { ${2} } endsnippet snippet proc "proc... (proc)" b proc ${1:name} {${2:args}} \ { ${3} } endsnippet snippet switch "switch... (switch)" b switch ${1:-exact} -- ${2:\$var} { ${3:match} { ${4} } default {${5}} } endsnippet snippet while "while... (while)" b while {${1:condition}} { ${2} } endsnippet # vim:ft=snippets: # #!/usr/bin/tclsh snippet #! #!/usr/bin/tclsh endsnippet # Process snippet pro proc ${1:function_name} {${2:args}} { ${3:#body ...} } endsnippet #xif snippet xif ${1:expr}? ${2:true} : ${3:false} endsnippet # Conditional snippet if if {${1}} { ${2:# body...} } endsnippet # Conditional if..else snippet ife if {${1}} { ${2:# body...} } else { ${3:# else...} } endsnippet # Conditional if..elsif..else snippet ifee if {${1}} { ${2:# body...} } elseif {${3}} { ${4:# elsif...} } else { ${5:# else...} } endsnippet # If catch then snippet ifc if { [catch {${1:#do something...}} ${2:err}] } { ${3:# handle failure...} } endsnippet # Catch snippet catch catch {${1}} ${2:err} ${3:options} endsnippet # While Loop snippet wh while {${1}} { ${2:# body...} } endsnippet # For Loop snippet for for {set ${2:var} 0} {$$2 < ${1:count}} {${3:incr} $2} { ${4:# body...} } endsnippet # Foreach Loop snippet fore foreach ${1:x} {${2:#list}} { ${3:# body...} } endsnippet # after ms script... snippet af after ${1:ms} ${2:#do something} endsnippet # after cancel id snippet afc after cancel ${1:id or script} endsnippet # after idle snippet afi after idle ${1:script} endsnippet # after info id snippet afin after info ${1:id} endsnippet # Expr snippet exp expr {${1:#expression here}} endsnippet # Switch snippet sw switch ${1:var} { ${3:pattern 1} { ${4:#do something} } default { ${2:#do something} } } endsnippet # Case snippet ca ${1:pattern} { ${2:#do something} }${3} endsnippet # Namespace eval snippet ns namespace eval ${1:path} {${2:#script...}} endsnippet # Namespace current snippet nsc namespace current endsnippet