Skip to content

Instantly share code, notes, and snippets.

@viviparous
Last active May 11, 2019 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viviparous/3439503198bdf88214477ea33d5a9fce to your computer and use it in GitHub Desktop.
Save viviparous/3439503198bdf88214477ea33d5a9fce to your computer and use it in GitHub Desktop.
perl entries for Geany's snippets.conf file
#In Geany, open the snippets.conf file: Tools→Configuration Files→snippets.conf
#add these entries
[Special]
bracescompact={my $p=shift; my $rv=0; if(\s$p eq "something"\s) {\s%cursor%\s; $rv=1; } return $rv; }\n
[Perl]
if=if (\s%cursor%\s)%bracescompact%
sub=sub mySub %bracescompact%
package=package myPkg {\n\tsub new {my ($class,$name)=@_;\n\tmy $self={\n\tval1=>$name||$class,\n\tval2=>"default",\n\tval3=>()\n\t};\n\tmy $obj=bless $self,$class;\n\t$obj->_init;\n\treturn $obj;\n\t}\n\tsub _init %bracescompact%\n};\n
ifelse=if( condition ){ code }\nelsif( condition ){ code }\nelse{ code }\n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment