neosnippet.vim/neosnippets/perl.snip

78 lines
999 B
Plaintext
Raw Normal View History

2012-02-02 04:33:35 +00:00
snippet perl
#!/opt/local/bin/perl
2012-10-30 08:53:14 +00:00
2012-02-02 04:33:35 +00:00
use strict;
use warnings;
${1}
snippet sub
2012-10-30 08:53:14 +00:00
sub ${1:#:function_name} {
${2:TARGET}
2012-02-02 04:33:35 +00:00
}
snippet if
2012-10-30 08:53:14 +00:00
if (${1:#:condition}) {
${2:TARGET}
2012-02-02 04:33:35 +00:00
}
snippet ife
2012-10-30 08:53:14 +00:00
if (${1:#:condition}) {
${2:TARGET}
2012-02-02 04:33:35 +00:00
} else {
2012-10-30 08:53:14 +00:00
${3:#:else...}
2012-02-02 04:33:35 +00:00
}
snippet ifee
2012-10-30 08:53:14 +00:00
if (${1:#:condition}) {
${2:TARGET}
2012-02-02 04:33:35 +00:00
} elsif (${3}) {
2012-10-30 08:53:14 +00:00
${4:#:elsif...}
2012-02-02 04:33:35 +00:00
} else {
2012-10-30 08:53:14 +00:00
${5:#:else...}
2012-02-02 04:33:35 +00:00
}
snippet xif
2012-10-30 08:53:14 +00:00
${1:#:expression} if ${2:#:condition};
2012-02-02 04:33:35 +00:00
snippet while
abbr wh
2012-10-30 08:53:14 +00:00
while (${1:#:condition}) {
${2:TARGET}
2012-02-02 04:33:35 +00:00
}
2012-10-30 08:53:14 +00:00
2012-02-02 04:33:35 +00:00
snippet xwhile
abbr xwh
2012-10-30 08:53:14 +00:00
${1:#:expression} while ${2:#:condition};
2012-02-02 04:33:35 +00:00
snippet for
2012-10-30 08:53:14 +00:00
for (my $${1:#:var} = 0; $$1 < ${2:#:expression}; $$1++) {
${3:TARGET}
2012-02-02 04:33:35 +00:00
}
2012-10-30 08:53:14 +00:00
2012-02-02 04:33:35 +00:00
snippet fore
2012-10-30 08:53:14 +00:00
for ${1} (${2:#:expression}){
${3:TARGET}
2012-02-02 04:33:35 +00:00
}
snippet xfor
2012-10-30 08:53:14 +00:00
${1:#:expression} for @${2:#:array};
2012-02-02 04:33:35 +00:00
snippet unless
abbr un
2012-10-30 08:53:14 +00:00
unless (${1:condition}) {
${2:TARGET}
2012-02-02 04:33:35 +00:00
}
snippet xunless
abbr xun
2012-10-30 08:53:14 +00:00
${1:#:expression} unless ${2:#:condition};
2012-02-02 04:33:35 +00:00
snippet eval
eval {
2012-10-30 08:53:14 +00:00
${1:TARGET}
2012-02-02 04:33:35 +00:00
};
if ($@) {
2012-10-30 08:53:14 +00:00
${2:#:handle failure...}
2012-02-02 04:33:35 +00:00
}
2012-10-30 08:53:14 +00:00