[[PageOutline(2-4)]] [wiki:Plugins <-plug-ins] = {{{Padre::Plugin::Snippet}}} [[Image(PadrePluginSnippet.png)]] == Notes - '''Snippet mode''' can be entered through '''''' - '''''' should be matched on a '''word boundary''' that ends with the current position - '''Shift-TAB''' traverses all '''variables''' ('''circular''' is a useful snipMate feature). '''Does not break snippet mode'''. - Movement keys and deletion: Up/down/right/left/page up/page down/home/end/delete automatically '''exit snippet mode''' - Cancel current selection when exiting snippet mode == Sample snippet file {{{#!application/x-yaml --- # # Moose snippets bundle for Padre::Plugin::Moose # Written by Ahmad M. Zawawi (azawawi) # # Adapted from 'TextMate Bundle for Moose' by Chris Prather (perigrin) # https://github.com/perigrin/perl-moose.tmbundle/Snippets # # after method modifier after: | after '${1:method_name}' => sub { ${2:# body...} }; # before method modifier before: | before '${1:method_name}' => sub { ${2:# body...} }; # Property has: has '${1:property}' => ( is => '${2:rw}', isa => '${3:Str}', ); }}} == TODO == - Support extended syntax ${index:default_value:list_of_values} - Support predefined special variables inside default_value - http://manual.macromates.com/en/environment_variables.html - Import snipMate snippets facility - Import {{{TextMate}}} snippets facility - ~~Add mojo '''HTML''' snippet to the mix[https://github.com/kraih/mojo-tmbundle/blob/master/Snippets/Template.tmSnippet Template]~~ - Support a way to '''change''' the current subscope - Detect whether we're {{{__DATA__}}} or not (to do some interesting mimetype things to Mojo HTML stuff - Add support for {{{MooseX::Getopt}}} - Add snippets support for {{{MooseX::Singleton}}} - Add snippets support for {{{MooseX::ClassAttribute}}} - Add snippets support For {{{Moo}}} / {{{Mo}}} - Handle here snippet (Here docs). The lines are not indented... - Respect the current file indentation == Resources - [http://www.vim.org/scripts/script.php?script_id=2540 snipMate on vim] - [http://manual.macromates.com/en/snippets TextMate Manual/Snippets] - [http://manual.macromates.com/en/scope_selectors TextMate Scope selectors] - [http://www.zalas.eu/how-to-use-textmate-like-snippets-in-vim How to use snipMate] \\ **{{{__END__}}}** [wiki:Plugins <-plug-ins]