add more snippets

This commit is contained in:
Zhang Chiyuan 2008-03-06 13:46:17 +00:00
parent 81b3a98f1e
commit d63608bd79
14 changed files with 69 additions and 0 deletions

8
snippets/cperl-mode/eval Normal file
View File

@ -0,0 +1,8 @@
#name : eval { ... } if ($@) { ... }
# --
eval {
${1:# do something risky...}
};
if (\$@) {
${2:# handle failure...}
}

5
snippets/cperl-mode/for Normal file
View File

@ -0,0 +1,5 @@
#name : for (...) { ... }
# --
for (my \$${1:var} = 0; \$$1 < ${2:expression}; \$$1++) {
${3:# body...}
}

5
snippets/cperl-mode/fore Normal file
View File

@ -0,0 +1,5 @@
#name : foreach ... { ... }
# --
foreach my \$${1:x} (@${2:array}) {
${3:# body...}
}

5
snippets/cperl-mode/if Normal file
View File

@ -0,0 +1,5 @@
#name : if (...) { ... }
# --
if ($1) {
$0
}

7
snippets/cperl-mode/ife Normal file
View File

@ -0,0 +1,7 @@
#name : if (...) { ... } else { ... }
# --
if ($1) {
$2
} else {
$3
}

9
snippets/cperl-mode/ifee Normal file
View File

@ -0,0 +1,9 @@
#name : if, elsif, else ...
# --
if ($1) {
${2:# body...}
} elsif ($3) {
${4:# elsif...}
} else {
${5:# else...}
}

5
snippets/cperl-mode/sub Normal file
View File

@ -0,0 +1,5 @@
#name : sub ... { ... }
# --
sub ${1:function_name} {
$0
}

View File

@ -0,0 +1,5 @@
#name : unless (...) { ... }
# --
unless ($1) {
$0
}

View File

@ -0,0 +1,5 @@
#name : while (...) { ... }
# --
while ($1) {
$0
}

View File

@ -0,0 +1,3 @@
#name : ... foreach ...
# --
${1:expression} foreach @${2:array};

3
snippets/cperl-mode/xif Normal file
View File

@ -0,0 +1,3 @@
#name : ... if ...
# --
${1:expression} if ${2:condition}

View File

@ -0,0 +1,3 @@
#name : ... unless ...
# --
${1:expression} unless ${2:condition}

View File

@ -0,0 +1,3 @@
#name : ... while ...
# --
${1:expression} while ${2:condition};

3
snippets/python-mode/__ Normal file
View File

@ -0,0 +1,3 @@
#name : __...__
# --
__${init}__