return Snippet(abbr, str)
endfunction
+function! ParameterizedModule()
+ let current_file = expand("%")
+ let t = substitute(current_file, '\.pm', '', '')
+ let t = substitute(t, 'lib/', '', '')
+
+ " Sadly, this does not work because : is a special character in snippet
+ " tag names. Any ideas?
+ "let module = substitute(t, '/', '::', 'g')
+ let module = substitute(t, '/.*', '', '')
+
+ return '<{' . module . '}>'
+endfun
+
call Snippet('class', [
- \"package <{ClassName}>;",
+ \"package ".ParameterizedModule().";",
\"use Moose;",
\"",
\"extends '<{SuperClass:RemoveEmptySuperClass()}>';",
\"",
\"1;"])
call Snippet('role', [
- \"package <{RoleName}>;",
+ \"package ".ParameterizedModule().";",
\"use Moose::Role;",
\"",
\"<{}>",
" MooseX support
call Snippet('prole', [
- \"package <{RoleName}>;",
+ \"package ".ParameterizedModule().";",
\"use MooseX::Role::Parameterized;",
\"",
\"<{}>",