2014-03-11 20:10:50 +00:00
|
|
|
priority -50
|
|
|
|
|
2012-08-17 03:41:25 +00:00
|
|
|
###########################################################################
|
|
|
|
# TextMate Snippets #
|
|
|
|
###########################################################################
|
|
|
|
snippet ife "Conditional if..else (ife)"
|
|
|
|
if ($1) {
|
|
|
|
${2:# body...}
|
2014-03-11 20:10:50 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-08-17 03:41:25 +00:00
|
|
|
${3:# else...}
|
|
|
|
}
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet ifee "Conditional if..elsif..else (ifee)"
|
|
|
|
if ($1) {
|
|
|
|
${2:# body...}
|
2014-03-11 20:10:50 +00:00
|
|
|
}
|
|
|
|
elsif ($3) {
|
2012-08-17 03:41:25 +00:00
|
|
|
${4:# elsif...}
|
2014-03-11 20:10:50 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-08-17 03:41:25 +00:00
|
|
|
${5:# else...}
|
|
|
|
}
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet xunless "Conditional one-line (unless)"
|
|
|
|
${1:expression} unless ${2:condition};
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet xif "Conditional one-line (xif)"
|
|
|
|
${1:expression} if ${2:condition};
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet sub "Function (sub)"
|
|
|
|
sub ${1:function_name} {
|
|
|
|
${2:# body...}
|
|
|
|
}
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet xfore "Loop one-line (xforeach)"
|
|
|
|
${1:expression} foreach @${2:array};
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet xwhile "Loop one-line (xwhile)"
|
|
|
|
${1:expression} while ${2:condition};
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet test "Test"
|
2014-03-11 20:10:50 +00:00
|
|
|
#!/usr/bin/env perl -w
|
2012-08-17 03:41:25 +00:00
|
|
|
|
|
|
|
use strict;
|
|
|
|
use Test::More tests => ${1:1};
|
|
|
|
use ${2:ModuleName};
|
|
|
|
|
|
|
|
ok(${3:assertion});
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet class "class"
|
|
|
|
package ${1:ClassName};
|
|
|
|
|
2014-03-11 20:10:50 +00:00
|
|
|
${2:use parent qw(${3:ParentClass});}${2/.+/\n\n/}sub new {
|
2012-08-17 03:41:25 +00:00
|
|
|
my $class = shift;
|
|
|
|
$class = ref $class if ref $class;
|
|
|
|
my $self = bless {}, $class;
|
|
|
|
$self;
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet eval "eval"
|
2014-03-11 20:10:50 +00:00
|
|
|
local $@;
|
2012-08-17 03:41:25 +00:00
|
|
|
eval {
|
|
|
|
${1:# do something risky...}
|
|
|
|
};
|
2014-03-11 20:10:50 +00:00
|
|
|
if (my $${2:exception} = $@) {
|
|
|
|
${3:# handle failure...}
|
2012-08-17 03:41:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet for "for"
|
|
|
|
for (my $${1:var} = 0; $$1 < ${2:expression}; $$1++) {
|
|
|
|
${3:# body...}
|
|
|
|
}
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet fore "foreach"
|
|
|
|
foreach ${1:my $${2:x}} (@${3:array}) {
|
|
|
|
${4:# body...}
|
|
|
|
}
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet if "if"
|
|
|
|
if ($1) {
|
|
|
|
${2:# body...}
|
|
|
|
}
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet slurp "slurp"
|
2014-03-11 20:10:50 +00:00
|
|
|
my $${1:var} = do { local $/ = undef; open my $fh, '<', ${2:$file}; <$fh> };
|
2012-08-17 03:41:25 +00:00
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet unless "unless"
|
|
|
|
unless ($1) {
|
|
|
|
${2:# body...}
|
|
|
|
}
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
2014-03-11 20:10:50 +00:00
|
|
|
snippet while "while"
|
2012-08-17 03:41:25 +00:00
|
|
|
while ($1) {
|
|
|
|
${2:# body...}
|
|
|
|
}
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
# vim:ft=snippets:
|