From: Shawn M Moore Date: Mon, 4 May 2009 16:57:24 +0000 (-0400) Subject: Add vim/moose_snippets.vim X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bb2ea7b76f019f2ff95904a6a0b13345f9fa82ca;p=gitmo%2Fmoose-dev-utils.git Add vim/moose_snippets.vim --- diff --git a/vim/moose_snippets.vim b/vim/moose_snippets.vim new file mode 100644 index 0000000..ceefb90 --- /dev/null +++ b/vim/moose_snippets.vim @@ -0,0 +1,16 @@ +" See http://www.vim.org/scripts/script.php?script_id=1318 +" Written by Sartak, feel free to add your own! + +if !exists('loaded_snippet') || &cp + finish +endif + +let st = g:snip_start_tag +let et = g:snip_end_tag +let cd = g:snip_elem_delim + +exec "Snippet class package ".st."ClassName".et.";use Moose;".st.et."__PACKAGE__->meta->make_immutable;no Moose;1;" +exec "Snippet has has ".st."attr".et." => (is => 'rw',isa => 'Str',".st.et.");" +exec "Snippet hasl has ".st."attr".et." => (is => 'rw',isa => 'Str',lazy_build => 1,);sub _build_".st."attr".et." {my $self = shift;".st.et."}" +exec "Snippet sub sub ".st."name".et." {my $self = shift;".st.et."}" +