Last active
May 11, 2019 10:47
-
-
Save viviparous/3439503198bdf88214477ea33d5a9fce to your computer and use it in GitHub Desktop.
perl entries for Geany's snippets.conf file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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