Merge pull request #65 from hzx/master

add dart language snippets, tornado html snippets
This commit is contained in:
Honza Pokorny 2012-01-03 04:59:49 -08:00
commit e981832476
3 changed files with 138 additions and 0 deletions

View File

@ -33,3 +33,4 @@ fo60213
marutanm
msanders
Povilas Balzaravičius Pawka
Dmitry Dementev

82
snippets/dart.snippets Normal file
View File

@ -0,0 +1,82 @@
snippet lib
#library('${1}');
${2}
snippet im
#import('${1}');
${2}
snippet so
#source('${1}');
${2}
snippet main
static void main() {
${1:/* code */}
}
snippet st
static ${1}
snippet fi
final ${1}
snippet re
return ${1}
snippet br
break;
snippet th
throw ${1}
snippet cl
class ${1:`Filename("", "untitled")`} ${2}
snippet in
interface ${1:`Filename("", "untitled")`} ${2}
snippet imp
implements ${1}
snippet ext
extends ${1}
snippet if
if (${1:true}) {
${2}
}
snippet ife
if (${1:true}) {
${2}
} else {
${3}
}
snippet el
else
snippet sw
switch (${1}) {
${2}
}
snippet cs
case ${1}:
${2}
snippet de
default:
${1}
snippet for
for (var ${2:i} = 0, len = ${1:things}.length; $2 < len; ${3:++}$2) {
${4:$1[$2]}
}
snippet fore
for (final ${2:item} in ${1:itemList}) {
${3:/* code */}
}
snippet wh
while (${1:/* condition */}) {
${2:/* code */}
}
snippet dowh
do {
${2:/* code */}
} while (${1:/* condition */});
snippet as
assert(${1:/* condition */});
snippet try
try {
${2}
} catch (${1:Exception e}) {
}
snippet tryf
try {
${2}
} catch (${1:Exception e}) {
} finally {
}

View File

@ -0,0 +1,55 @@
# Generic tags
snippet {
{{ ${1} }}
# Template tags
snippet extends
{% extends "${1:base.html}" %}
snippet autoescape
{% autoescape ${1:xhtml_escape | None} %}
snippet apply
{% apply ${1:function} %}
${2}
{% end %}
snippet block
{% block ${1} %}
${2}
{% end %}
snippet for
{% for ${1:item} in ${2} %}
${3}
{% end %}
snippet from
{% from ${1:x} import ${2:y} %}
snippet if
{% if ${1:condition} %}
${2}
{% end %}
snippet elif
{% elif ${1:condition} %}
snippet else
{% else %}
snippet import
{% import ${1:module} %}
snippet include
{% include "${1:filename}" %}
snippet module
{% module ${1:expression} %}
snippet raw
{% raw ${1:expression} %}
snippet set
{% set ${1:x} = ${2:y} %}
snippet try
{% try %}
${1}
{% except %}
${2}
{% finallly %}
${3}
{% end %}
snippet while
{% while ${1:condition} %}
${2}
{% end %}