" See http://www.vim.org/scripts/script.php?script_id=1318
-" Written by Sartak, feel free to add your own!
+" Written by Sartak and doy, feel free to add your own!
if !exists('loaded_snippet') || &cp
finish
\"no Moose;",
\"",
\"1;"])
+call Snippet('role', [
+ \"package <{RoleName}>;",
+ \"use Moose::Role;",
+ \"",
+ \"<{}>",
+ \"",
+ \"no Moose::Role;",
+ \"",
+ \"1;"])
call Snippet('has', [
\"has <{attr}> => (",
\ "is => '<{rw}>',",
\"}"])
call Snippet('around', [
\"around <{name}> => sub {",
- \ "my $orig = shift;",
+ \ "my $<{next}> = shift;",
\ "my $self = shift;",
\ "<{}>",
\"};"])
\ "<{}>",
\"};"])
+" MooseX support
+call Snippet('prole', [
+ \"package <{RoleName}>;",
+ \"use MooseX::Role::Parameterized;",
+ \"",
+ \"<{}>",
+ \"",
+ \"role {",
+ \"my $p = shift;",
+ \"",
+ \"<{}>",
+ \"};",
+ \"",
+ \"no MooseX::Role::Parameterized;",
+ \"",
+ \"1;"])
+
"for file in globpath(&rtp, 'snippets/*')
"call SnippetFile(file)
"endfor