From: Shawn M Moore Date: Sat, 16 May 2009 09:23:17 +0000 (-0400) Subject: Attempt "subtype" with auto ; placement X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2Fmoose-dev-utils.git;a=commitdiff_plain;h=6588bf042c676fc8704dd259199bf7bba79fc57b Attempt "subtype" with auto ; placement --- diff --git a/vim/moose_snippets.vim b/vim/moose_snippets.vim index bfe9f90..16b7604 100644 --- a/vim/moose_snippets.vim +++ b/vim/moose_snippets.vim @@ -14,6 +14,18 @@ function! RemoveUnchangedLine() endif endfun +function! RemoveUnchangedLineSemicolon() + if match(getline('.'), "<{}>") >= 0 + normal! ddkA; + normal! o + return '' + else + normal! A; + "normal! o " we can't actually change what line we're on :/ + return @z + endif +endfun + function! Snippet(abbr, str) if type(a:str) == type([]) return Snippet(a:abbr, join(a:str, "\n")) @@ -107,6 +119,12 @@ call Snippet('after', [ \ "my $self = shift;", \ "<{}>", \"};"]) +call Snippet('subtype', [ + \"subtype '<{name}>'", + \ "=> as '<{supertype}>'", + \ "=> where { <{predicate:RemoveUnchangedLine()}> }", + \ "=> message { \"<{message:RemoveUnchangedLineSemicolon()}>\" }", + \""]) " MooseX support call Snippet('prole', [