mirror of
https://github.com/gryf/snipmate.vim.git
synced 2025-12-20 04:47:59 +01:00
changed perl snippets to match perl preferred practises (issue#72)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# #!/usr/bin/env perl
|
# #!/usr/bin/perl
|
||||||
snippet #!
|
snippet #!
|
||||||
#!/usr/bin/env perl
|
#!/usr/bin/perl
|
||||||
|
|
||||||
# Hash Pointer
|
# Hash Pointer
|
||||||
snippet .
|
snippet .
|
||||||
@@ -19,16 +19,19 @@ snippet if
|
|||||||
snippet ife
|
snippet ife
|
||||||
if (${1}) {
|
if (${1}) {
|
||||||
${2:# body...}
|
${2:# body...}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
${3:# else...}
|
${3:# else...}
|
||||||
}
|
}
|
||||||
# Conditional if..elsif..else
|
# Conditional if..elsif..else
|
||||||
snippet ifee
|
snippet ifee
|
||||||
if (${1}) {
|
if (${1}) {
|
||||||
${2:# body...}
|
${2:# body...}
|
||||||
} elsif (${3}) {
|
}
|
||||||
|
elsif (${3}) {
|
||||||
${4:# elsif...}
|
${4:# elsif...}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
${5:# else...}
|
${5:# else...}
|
||||||
}
|
}
|
||||||
# Conditional One-line
|
# Conditional One-line
|
||||||
@@ -58,18 +61,21 @@ snippet wh
|
|||||||
# While Loop One-line
|
# While Loop One-line
|
||||||
snippet xwh
|
snippet xwh
|
||||||
${1:expression} while ${2:condition};${3}
|
${1:expression} while ${2:condition};${3}
|
||||||
# For Loop
|
# C-style For Loop
|
||||||
snippet for
|
snippet cfor
|
||||||
for (my $${2:var} = 0; $$2 < ${1:count}; $$2${3:++}) {
|
for (my $${2:var} = 0; $$2 < ${1:count}; $$2${3:++}) {
|
||||||
${4:# body...}
|
${4:# body...}
|
||||||
}
|
}
|
||||||
|
# For loop one-line
|
||||||
|
snippet xfor
|
||||||
|
${1:expression} for @${2:array};${3}
|
||||||
# Foreach Loop
|
# Foreach Loop
|
||||||
snippet fore
|
snippet for
|
||||||
foreach my $${1:x} (@${2:array}) {
|
foreach my $${1:x} (@${2:array}) {
|
||||||
${3:# body...}
|
${3:# body...}
|
||||||
}
|
}
|
||||||
# Foreach Loop One-line
|
# Foreach Loop One-line
|
||||||
snippet xfore
|
snippet fore
|
||||||
${1:expression} foreach @${2:array};${3}
|
${1:expression} foreach @${2:array};${3}
|
||||||
# Package
|
# Package
|
||||||
snippet cl
|
snippet cl
|
||||||
|
|||||||
Reference in New Issue
Block a user