From b17c11b5f1dc4ae82f002366433bea68aabb19bc Mon Sep 17 00:00:00 2001 From: Philippe Mongeau Date: Wed, 22 Jun 2011 14:38:03 -0400 Subject: [PATCH 1/4] merge with my as3 and textile snippets --- snippets/actionscript.snippets | 125 +++++++++++++++++++++++++++++++++ snippets/textile.snippets | 42 +++++++++++ 2 files changed, 167 insertions(+) create mode 100644 snippets/textile.snippets diff --git a/snippets/actionscript.snippets b/snippets/actionscript.snippets index f77a334..430ed5c 100644 --- a/snippets/actionscript.snippets +++ b/snippets/actionscript.snippets @@ -1,3 +1,107 @@ +# Actionscript 3 snippets file by Alex Schearer + +# trace +snippet tr + trace(${1:/* argument* /}); +# package +snippet pa + package ${1:/* package */} + { + ${2:/* code */} + } +# import +snippet im + import ${1:/* package */}; +# Start Docblock +snippet /* + /** + * ${1:Comments} + **/ +# while +snippet wh + while (${1:/* condition */}) { + ${2:// code...} + } +# do ... while +snippet do + do { + ${2:// code... } + } while (${1:/* condition */}); +snippet if + if (${1:/* condition */}) { + ${2:// code...} + } +snippet ife + if (${1:/* condition */}) { + ${2:// code...} + } else { + ${3:// code...} + } + ${4} +snippet else + else { + ${1:// code...} + } +snippet elseif + elseif (${1:/* condition */}) { + ${2:// code...} + } +# switch +snippet sw + switch (${1:/* condition */}) { + case ${2:/* value */}: + ${3:// code...} + break; + ${5} + default: + ${4:// code...} + break; + } +# case +snippet ca + case ${1:/* value */}: + ${2:// code...} + break;${3} +snippet for + for (var ${2:i}:uint = 0; $2 < ${1:count}; $2${3:++}) { + ${4: // code...} + } +snippet foreeach + for each (var ${1:value}:${2:Type} in ${3:list}) { + ${4:// code...} + } +snippet fu + ${1:public }function ${2:FunctionName}(${3}):${4:void} + { + ${5:// code...} + } +snippet get + ${1:public }function get ${2:FunctionName}():${3:void} + { + ${4:// code...} + } +snippet set + ${1:public }function set ${2:FunctionName}(${3:value}:${4:Type:}):${5:void} + { + ${6:// code...} + } +snippet cl + ${1:public }class ${2:ClassName} ${3:extends} ${4:BaseClass} + { + public function $2(${5}):void + { + } + + ${6://code...} + } +snippet const + ${1:public }static const ${2:CONSTANT}:${3:Type} = ${4:value}; +# gotoAndPlay +snippet gop + gotoAndPlay(${1:frame}); +# gotoAndStop +snippet gos + gotoAndStop(${1:frame}); snippet main package { import flash.display.*; @@ -133,3 +237,24 @@ snippet fun { ${4:/* code */} } +# FlxSprite +snippet FlxSprite + package + { + import org.flixel.* + + public class ${1:ClassName} extends ${2:FlxSprite} + { + public function $1(${3: X:Number, Y:Number}):void + { + super(X,Y); + ${4: //code...} + } + + override public function update():void + { + super.update(); + ${5: //code...} + } + } + } diff --git a/snippets/textile.snippets b/snippets/textile.snippets new file mode 100644 index 0000000..987a3c2 --- /dev/null +++ b/snippets/textile.snippets @@ -0,0 +1,42 @@ +snippet header + " File: ${1:`expand('%:t')`} + " Author: ${2:`g:snips_author`} + " Description: ${3} + ${4:" Last Modified: `strftime("%B %d, %Y")`} +snippet guard + if exists('${1:did_`Filename()`}') || &cp${2: || version < 700} + finish + endif + let $1 = 1${3} +snippet f + fun ${1:function_name}(${2}) + ${3:" code} + endf +snippet for + for ${1:needle} in ${2:haystack} + ${3:" code} + endfor +snippet wh + while ${1:condition} + ${2:" code} + endw +snippet if + if ${1:condition} + ${2:" code} + endif +snippet ife + if ${1:condition} + ${2} + else + ${3} + endif +snippet info + --- + title: ${1:title} + layout: post + date: ${2:date} ${3:hour:minute:second} -05:00 + --- + +snippet img + !${1:url}! + From 76b47ffbbd48e1760b992182dbb7b3a4b41d3231 Mon Sep 17 00:00:00 2001 From: Philippe Mongeau Date: Wed, 22 Jun 2011 17:25:25 -0400 Subject: [PATCH 2/4] cleaned textile file --- snippets/textile.snippets | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/snippets/textile.snippets b/snippets/textile.snippets index 987a3c2..e2a7a30 100644 --- a/snippets/textile.snippets +++ b/snippets/textile.snippets @@ -1,36 +1,4 @@ snippet header - " File: ${1:`expand('%:t')`} - " Author: ${2:`g:snips_author`} - " Description: ${3} - ${4:" Last Modified: `strftime("%B %d, %Y")`} -snippet guard - if exists('${1:did_`Filename()`}') || &cp${2: || version < 700} - finish - endif - let $1 = 1${3} -snippet f - fun ${1:function_name}(${2}) - ${3:" code} - endf -snippet for - for ${1:needle} in ${2:haystack} - ${3:" code} - endfor -snippet wh - while ${1:condition} - ${2:" code} - endw -snippet if - if ${1:condition} - ${2:" code} - endif -snippet ife - if ${1:condition} - ${2} - else - ${3} - endif -snippet info --- title: ${1:title} layout: post From 8b778875b0d81bd83a02c0aa73958cd022b79708 Mon Sep 17 00:00:00 2001 From: Philippe Mongeau Date: Wed, 22 Jun 2011 17:52:23 -0400 Subject: [PATCH 3/4] added table, link, acronym and footnote snippets for textile --- snippets/textile.snippets | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/snippets/textile.snippets b/snippets/textile.snippets index e2a7a30..c78d6ec 100644 --- a/snippets/textile.snippets +++ b/snippets/textile.snippets @@ -1,3 +1,4 @@ +# Jekyll post header snippet header --- title: ${1:title} @@ -5,6 +6,25 @@ snippet header date: ${2:date} ${3:hour:minute:second} -05:00 --- +# Image snippet img - !${1:url}! + !${1:url}(${2:title}):${3:link}! +# Table +snippet | + |${1}|${2} + +# Link +snippet link + "${1:link text}":${2:url} + +# Acronym +snippet ( + (${1:Expand acronym})${2} + +# Footnote +snippet fn + [${1:ref number}] ${3} + + fn$1. ${2:footnote} + From 0054b2765ee4b7f5d241c73e942fc39f88922954 Mon Sep 17 00:00:00 2001 From: Philippe Mongeau Date: Wed, 22 Jun 2011 18:03:11 -0400 Subject: [PATCH 4/4] updated actionscript to match honza/snipmate-snippets --- snippets/actionscript.snippets | 107 +-------------------------------- 1 file changed, 2 insertions(+), 105 deletions(-) diff --git a/snippets/actionscript.snippets b/snippets/actionscript.snippets index 430ed5c..999b8a3 100644 --- a/snippets/actionscript.snippets +++ b/snippets/actionscript.snippets @@ -1,107 +1,3 @@ -# Actionscript 3 snippets file by Alex Schearer - -# trace -snippet tr - trace(${1:/* argument* /}); -# package -snippet pa - package ${1:/* package */} - { - ${2:/* code */} - } -# import -snippet im - import ${1:/* package */}; -# Start Docblock -snippet /* - /** - * ${1:Comments} - **/ -# while -snippet wh - while (${1:/* condition */}) { - ${2:// code...} - } -# do ... while -snippet do - do { - ${2:// code... } - } while (${1:/* condition */}); -snippet if - if (${1:/* condition */}) { - ${2:// code...} - } -snippet ife - if (${1:/* condition */}) { - ${2:// code...} - } else { - ${3:// code...} - } - ${4} -snippet else - else { - ${1:// code...} - } -snippet elseif - elseif (${1:/* condition */}) { - ${2:// code...} - } -# switch -snippet sw - switch (${1:/* condition */}) { - case ${2:/* value */}: - ${3:// code...} - break; - ${5} - default: - ${4:// code...} - break; - } -# case -snippet ca - case ${1:/* value */}: - ${2:// code...} - break;${3} -snippet for - for (var ${2:i}:uint = 0; $2 < ${1:count}; $2${3:++}) { - ${4: // code...} - } -snippet foreeach - for each (var ${1:value}:${2:Type} in ${3:list}) { - ${4:// code...} - } -snippet fu - ${1:public }function ${2:FunctionName}(${3}):${4:void} - { - ${5:// code...} - } -snippet get - ${1:public }function get ${2:FunctionName}():${3:void} - { - ${4:// code...} - } -snippet set - ${1:public }function set ${2:FunctionName}(${3:value}:${4:Type:}):${5:void} - { - ${6:// code...} - } -snippet cl - ${1:public }class ${2:ClassName} ${3:extends} ${4:BaseClass} - { - public function $2(${5}):void - { - } - - ${6://code...} - } -snippet const - ${1:public }static const ${2:CONSTANT}:${3:Type} = ${4:value}; -# gotoAndPlay -snippet gop - gotoAndPlay(${1:frame}); -# gotoAndStop -snippet gos - gotoAndStop(${1:frame}); snippet main package { import flash.display.*; @@ -237,7 +133,7 @@ snippet fun { ${4:/* code */} } -# FlxSprite +# FlxSprite (usefull when using the flixel library) snippet FlxSprite package { @@ -258,3 +154,4 @@ snippet FlxSprite } } } +