From df74813351e319012be0c8a0f5205141d875e266 Mon Sep 17 00:00:00 2001 From: Michael Thessel Date: Thu, 20 Jun 2013 14:33:44 -0700 Subject: [PATCH 1/2] Removed comment blocks from placeholders --- snippets/actionscript.snippets | 12 +++---- snippets/c.snippets | 14 ++++---- snippets/cpp.snippets | 10 +++--- snippets/dart.snippets | 8 ++--- snippets/falcon.snippets | 14 ++++---- snippets/go.snippets | 30 ++++++++--------- snippets/java.snippets | 2 +- snippets/javascript-jquery.snippets | 4 +-- snippets/javascript.snippets | 20 ++++++------ snippets/make.snippets | 2 +- snippets/objc.snippets | 2 +- snippets/perl.snippets | 2 +- snippets/php.snippets | 30 ++++++++--------- snippets/processing.snippets | 6 ++-- snippets/python.snippets | 40 +++++++++++------------ snippets/r.snippets | 10 +++--- snippets/scala.snippets | 50 ++++++++++++++--------------- snippets/vim.snippets | 8 ++--- 18 files changed, 132 insertions(+), 132 deletions(-) diff --git a/snippets/actionscript.snippets b/snippets/actionscript.snippets index af9611c..cd2ab0e 100644 --- a/snippets/actionscript.snippets +++ b/snippets/actionscript.snippets @@ -109,17 +109,17 @@ snippet try # For Loop (same as c.snippet) snippet for for (..) {..} for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) { - ${4:/* code */} + ${4} } # Custom For Loop snippet forr for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) { - ${5:/* code */} + ${5} } # If Condition snippet if if (${1:/* condition */}) { - ${2:/* code */} + ${2} } snippet el else { @@ -131,7 +131,7 @@ snippet t snippet fun function ${1:function_name}(${2})${3} { - ${4:/* code */} + ${4} } # FlxSprite (usefull when using the flixel library) snippet FlxSprite @@ -144,13 +144,13 @@ snippet FlxSprite public function $1(${3: X:Number, Y:Number}):void { super(X,Y); - ${4: //code...} + ${4} } override public function update():void { super.update(); - ${5: //code...} + ${5} } } } diff --git a/snippets/c.snippets b/snippets/c.snippets index de6d6a9..85e7ac2 100644 --- a/snippets/c.snippets +++ b/snippets/c.snippets @@ -53,7 +53,7 @@ snippet once # if snippet if if (${1:/* condition */}) { - ${2:/* code */} + ${2} }${3} # else snippet el @@ -63,7 +63,7 @@ snippet el # else if snippet elif else if (${1:/* condition */}) { - ${2:/* code */} + ${2} }${3} # ternary snippet t @@ -94,22 +94,22 @@ snippet case # for snippet for for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) { - ${4:/* code */} + ${4} }${5} # for (custom) snippet forr for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) { - ${5:/* code */} + ${5} }${6} # while snippet wh while (${1:/* condition */}) { - ${2:/* code */} + ${2} }${3} # do... while snippet do do { - ${2:/* code */} + ${2} } while (${1:/* condition */});${3} ## ## Functions @@ -117,7 +117,7 @@ snippet do snippet fun ${1:void} ${2:function_name}(${3}) { - ${4:/* code */} + ${4} }${5} # function declaration snippet fund diff --git a/snippets/cpp.snippets b/snippets/cpp.snippets index c3e19fe..0486712 100644 --- a/snippets/cpp.snippets +++ b/snippets/cpp.snippets @@ -80,7 +80,7 @@ snippet cl # member function implementation snippet mfun ${4:void} ${1:`Filename('$1', 'ClassName')`}::${2:memberFunction}(${3}) { - ${5:/* code */} + ${5} } # namespace snippet ns @@ -100,13 +100,13 @@ snippet cin # for i snippet fori for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) { - ${4:/* code */} + ${4} }${5} # foreach snippet fore for (${1:auto} ${2:i} : ${3:container}) { - ${4:/* code */} + ${4} }${5} # iterator snippet iter @@ -123,9 +123,9 @@ snippet itera ## Lambdas # lamda (one line) snippet ld - [${1}](${2}){${3:/* code */}}${4} + [${1}](${2}){${3}}${4} # lambda (multi-line) snippet lld [${1}](${2}){ - ${3:/* code */} + ${3} }${4} diff --git a/snippets/dart.snippets b/snippets/dart.snippets index 6f0b8ac..c7b56da 100644 --- a/snippets/dart.snippets +++ b/snippets/dart.snippets @@ -9,7 +9,7 @@ snippet so ${2} snippet main static void main() { - ${1:/* code */} + ${1} } snippet st static ${1} @@ -57,15 +57,15 @@ snippet for } snippet fore for (final ${2:item} in ${1:itemList}) { - ${3:/* code */} + ${3} } snippet wh while (${1:/* condition */}) { - ${2:/* code */} + ${2} } snippet dowh do { - ${2:/* code */} + ${2} } while (${1:/* condition */}); snippet as assert(${1:/* condition */}); diff --git a/snippets/falcon.snippets b/snippets/falcon.snippets index 85fb918..93aba19 100644 --- a/snippets/falcon.snippets +++ b/snippets/falcon.snippets @@ -8,7 +8,7 @@ snippet imp # Function snippet fun function ${2:function_name}(${3}) - ${4:/* code */} + ${4} end # Class @@ -20,13 +20,13 @@ snippet class # If snippet if if ${1:condition} - ${2:/* code */} + ${2} end # If else snippet ife if ${1:condition} - ${2:/* code */} + ${2} else ${1} end @@ -34,7 +34,7 @@ snippet ife # If else if snippet elif elif ${1:condition} - ${2:/* code */} + ${2} # Switch case snippet switch @@ -55,17 +55,17 @@ snippet select # For/in Loop snippet forin for ${1:element} in ${2:container} - ${3:/* code */} + ${3} end # For/to Loop snippet forto for ${1:lowerbound} to ${2:upperbound} - ${3:/* code */} + ${3} end # While Loop snippet while while ${1:conidition} - ${2:/* code */} + ${2} end diff --git a/snippets/go.snippets b/snippets/go.snippets index c64db91..a88d8d0 100644 --- a/snippets/go.snippets +++ b/snippets/go.snippets @@ -16,7 +16,7 @@ snippet ch # case snippet cs case ${1:value}: - ${2:/* code */} + ${2} # const snippet c const ${1:NAME} = ${2:0} @@ -36,7 +36,7 @@ snippet df snippet dfr defer func() { if err := recover(); err != nil { - ${1:/* code */} + ${1} } }() # gpl @@ -78,7 +78,7 @@ snippet inf # if condition snippet if if ${1:/* condition */} { - ${2:/* code */} + ${2} }${2} # else snippet snippet el @@ -109,7 +109,7 @@ snippet f6 # if else snippet ie if ${1:/* condition */} { - ${2:/* code */} + ${2} } else { ${3} } @@ -117,25 +117,25 @@ snippet ie # for loop snippet fo for ${2:i} := 0; $2 < ${1:count}; $2${3:++} { - ${4:/* code */} + ${4} } ${5} # for range loop snippet fr for ${1:k}, ${2:v} := range ${3} { - ${4:/* code */} + ${4} } ${5} # function simple snippet fun func ${1:funcName}(${2}) ${3:error} { - ${4:/* code */} + ${4} } ${5} # function on receiver snippet fum func (self ${1:type}) ${2:funcName}(${3}) ${4:error} { - ${5:/* code */} + ${5} } ${6} # log printf @@ -153,7 +153,7 @@ snippet mp # main() snippet main func main() { - ${1:/* code */} + ${1} } ${2} # new @@ -178,11 +178,11 @@ snippet rs snippet sl select { case ${1:v1} := <-${2:chan1} - ${3:/* code */} + ${3} case ${4:v2} := <-${5:chan2} - ${6:/* code */} + ${6} default: - ${7:/* code */} + ${7} } # string snippet sr @@ -197,11 +197,11 @@ snippet st snippet sw switch ${1:var} { case ${2:value1}: - ${3:/* code */} + ${3} case ${4:value2}: - ${5:/* code */} + ${5} default: - ${6:/* code */} + ${6} } snippet sp fmt.Sprintf("%${1:s}", ${2:var})${3} diff --git a/snippets/java.snippets b/snippets/java.snippets index 854f14a..daf8928 100644 --- a/snippets/java.snippets +++ b/snippets/java.snippets @@ -171,7 +171,7 @@ snippet wh ## Main method snippet main public static void main (String[] args) { - ${1:/* code */} + ${1} } ## ## Print Methods diff --git a/snippets/javascript-jquery.snippets b/snippets/javascript-jquery.snippets index ce247a0..014c615 100644 --- a/snippets/javascript-jquery.snippets +++ b/snippets/javascript-jquery.snippets @@ -260,7 +260,7 @@ snippet filter ${1:obj}.filter('${2:selector expression}')${3} snippet filtert ${1:obj}.filter(function (${2:index}) { - ${3:// test code} + ${3} })${4} snippet find ${1:obj}.find('${2:selector expression}')${3} @@ -291,7 +291,7 @@ snippet getscript }); snippet grep $.grep(${1:array}, function (item, index) { - ${2:// test code} + ${2} }${3:, true}); snippet hasc ${1:obj}.hasClass('${2:className}')${3} diff --git a/snippets/javascript.snippets b/snippets/javascript.snippets index 801968f..e9dd58b 100644 --- a/snippets/javascript.snippets +++ b/snippets/javascript.snippets @@ -17,7 +17,7 @@ snippet f # Immediate function snippet (f (function (${1}) { - ${3:/* code */} + ${3} }(${2})); # if snippet if @@ -38,16 +38,16 @@ snippet ter snippet switch switch (${1:expression}) { case '${3:case}': - ${4:// code} + ${4} break; ${5} default: - ${2:// code} + ${2} } # case snippet case case '${1:case}': - ${2:// code} + ${2} break; ${3} # for (...) {...} @@ -63,19 +63,19 @@ snippet forr # while (...) {...} snippet wh while (${1:/* condition */}) { - ${2:/* code */} + ${2} } # try snippet try try { - ${1:/* code */} + ${1} } catch (${2:e}) { ${3:/* handle error */} } # do...while snippet do do { - ${2:/* code */} + ${2} } while (${1:/* condition */}); # Object Method snippet :f @@ -124,10 +124,10 @@ snippet jsons # self-defining function snippet sdf var ${1:function_name} = function (${2:argument}) { - ${3:// initial code ...} + ${3} $1 = function ($2) { - ${4:// main code} + ${4} }; }; # singleton @@ -150,7 +150,7 @@ snippet sing // reset the constructor pointer instance.constructor = $1; - ${3:// code ...} + ${3} return instance; } diff --git a/snippets/make.snippets b/snippets/make.snippets index 4364813..ba8e2b2 100644 --- a/snippets/make.snippets +++ b/snippets/make.snippets @@ -1,4 +1,4 @@ snippet ifeq ifeq (${1:cond0},${2:cond1}) - ${3:code} + ${3} endif diff --git a/snippets/objc.snippets b/snippets/objc.snippets index 85b80d9..3cf5a0a 100644 --- a/snippets/objc.snippets +++ b/snippets/objc.snippets @@ -207,7 +207,7 @@ snippet arel # autorelease pool snippet pool NSAutoreleasePool *${1:pool} = [[NSAutoreleasePool alloc] init]; - ${2:/* code */} + ${2} [$1 drain]; # Throw an exception snippet except diff --git a/snippets/perl.snippets b/snippets/perl.snippets index 9cebede..ef83e0f 100644 --- a/snippets/perl.snippets +++ b/snippets/perl.snippets @@ -326,7 +326,7 @@ snippet tsub snippet trsub test ${1:test_name} => { description => '${2:Description of test.}'} => sub { my ($self) = @_; - ${3:# test code} + ${3} }; #prep test method diff --git a/snippets/php.snippets b/snippets/php.snippets index 5ca502d..97ec3e3 100644 --- a/snippets/php.snippets +++ b/snippets/php.snippets @@ -231,7 +231,7 @@ snippet class */ ${5:public} function ${6:__construct}(${7:argument}) { - ${8:// code...} + ${8} } } snippet nc @@ -249,26 +249,26 @@ snippet def? ${1}defined('${2}')${3} snippet wh while (${1:/* condition */}) { - ${2:// code...} + ${2} } # do ... while snippet do do { - ${2:// code... } + ${2} } while (${1:/* condition */}); snippet if if (${1:/* condition */}) { - ${2:// code...} + ${2} } snippet ifil - ${2:} + ${2} snippet ife if (${1:/* condition */}) { - ${2:// code...} + ${2} } else { - ${3:// code...} + ${3} } ${4} snippet ifeil @@ -280,33 +280,33 @@ snippet ifeil ${4} snippet else else { - ${1:// code...} + ${1} } snippet elseif elseif (${1:/* condition */}) { - ${2:// code...} + ${2} } snippet switch switch ($${1:variable}) { case '${2:value}': - ${3:// code...} + ${3} break; ${5} default: - ${4:// code...} + ${4} break; } snippet case case '${1:value}': - ${2:// code...} + ${2} break;${3} snippet for for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) { - ${4: // code...} + ${4} } snippet foreach foreach ($${1:variable} as $${2:value}) { - ${3:// code...} + ${3} } snippet foreachil @@ -314,7 +314,7 @@ snippet foreachil snippet foreachk foreach ($${1:variable} as $${2:key} => $${3:value}) { - ${4:// code...} + ${4} } snippet foreachkil $${3:value}): ?> diff --git a/snippets/processing.snippets b/snippets/processing.snippets index b0aa93c..27f3e00 100755 --- a/snippets/processing.snippets +++ b/snippets/processing.snippets @@ -65,7 +65,7 @@ snippet for #loop while snippet while while (${1:/* condition */}) { - ${2:/* code */} + ${2} } #break snippet break @@ -84,11 +84,11 @@ snippet default snippet switch switch(${1:expression}) { case '${3:case}': - ${4:// code} + ${4} break; ${5} default: - ${2:// code} + ${2} } #try snippet try diff --git a/snippets/python.snippets b/snippets/python.snippets index 518d2d6..c29b340 100644 --- a/snippets/python.snippets +++ b/snippets/python.snippets @@ -15,16 +15,16 @@ snippet docs """ snippet wh while ${1:condition}: - ${2:# TODO: write code...} + ${2} # dowh - does the same as do...while in other languages snippet dowh while True: - ${1:# TODO: write code...} + ${1} if ${2:condition}: break snippet with with ${1:expr} as ${2:var}: - ${3:# TODO: write code...} + ${3} # New Class snippet cl class ${1:ClassName}(${2:object}): @@ -37,14 +37,14 @@ snippet cl snippet def def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): """${3:docstring for $1}""" - ${4:# TODO: write code...} + ${4} snippet deff def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): - ${3:# TODO: write code...} + ${3} # New Method snippet defs def ${1:mname}(self, ${2:arg}): - ${3:# TODO: write code...} + ${3} # New Property snippet property def ${1:foo}(): @@ -60,17 +60,17 @@ snippet property # Ifs snippet if if ${1:condition}: - ${2:# TODO: write code...} + ${2} snippet el else: - ${1:# TODO: write code...} + ${1} snippet ei elif ${1:condition}: - ${2:# TODO: write code...} + ${2} # For snippet for for ${1:item} in ${2:items}: - ${3:# TODO: write code...} + ${3} # Encodes snippet cutf8 # -*- coding: utf-8 -*- @@ -85,32 +85,32 @@ snippet . self. snippet try Try/Except try: - ${1:# TODO: write code...} + ${1} except ${2:Exception}, ${3:e}: ${4:raise $3} snippet try Try/Except/Else try: - ${1:# TODO: write code...} + ${1} except ${2:Exception}, ${3:e}: ${4:raise $3} else: - ${5:# TODO: write code...} + ${5} snippet try Try/Except/Finally try: - ${1:# TODO: write code...} + ${1} except ${2:Exception}, ${3:e}: ${4:raise $3} finally: - ${5:# TODO: write code...} + ${5} snippet try Try/Except/Else/Finally try: - ${1:# TODO: write code...} + ${1} except ${2:Exception}, ${3:e}: ${4:raise $3} else: - ${5:# TODO: write code...} + ${5} finally: - ${6:# TODO: write code...} + ${6} # if __name__ == '__main__': snippet ifmain if __name__ == '__main__': @@ -136,13 +136,13 @@ snippet " # test function/method snippet test def test_${1:description}(${2:`indent('.') ? 'self' : ''`}): - ${3:# TODO: write code...} + ${3} # test case snippet testcase class ${1:ExampleCase}(unittest.TestCase): def test_${2:description}(self): - ${3:# TODO: write code...} + ${3} snippet fut from __future__ import ${1} #getopt diff --git a/snippets/r.snippets b/snippets/r.snippets index 71186e3..9507965 100644 --- a/snippets/r.snippets +++ b/snippets/r.snippets @@ -12,24 +12,24 @@ snippet source # conditionals snippet if if (${1:condition}) { - ${2:code} + ${2} } snippet el else { - ${1:code} + ${1} } snippet ei else if (${1:condition}) { - ${2:code} + ${2} } # functions snippet fun ${1:name} = function (${2:variables}) { - ${3:code} + ${3} } snippet ret - return(${1:code}) + return(${1}) # dataframes, lists, etc snippet df diff --git a/snippets/scala.snippets b/snippets/scala.snippets index c342228..9a71ec2 100644 --- a/snippets/scala.snippets +++ b/snippets/scala.snippets @@ -7,61 +7,61 @@ #if snippet if if(${1:obj}) { - ${2:/* code */} + ${2} } #if not snippet ifn if(!${1:obj}) { - ${2:/* code */} + ${2} } #if-else snippet ifel if(${1:obj}) { - ${2:/* code */} + ${2} } else { - ${3:/* code */} + ${3} } #if-else-if snippet ifelif if(${1:obj}) { - ${2:/* code */} + ${2} } else if(${3:obj}) { - ${4:/* code */} + ${4} } #while loop snippet while while (${1:obj}) { - ${2:/* code */} + ${2} } #for loop(classic) snippet for for (${1:item} <- ${2:obj}) { - ${3:/* code */} + ${3} } #for loop(indexed) snippet fori for (${1:i} <- ${2:0} to ${3:obj}.length) { - ${4:/* code */} + ${4} } #exceptions snippet try try { - ${1:/* code */} + ${1} } catch { - case e: FileNotFoundException => ${2:/* code */} - case e: IOException => ${3:/* code */} + case e: FileNotFoundException => ${2} + case e: IOException => ${3} } finally { - ${4:/* code */} + ${4} } #match snippet match ${1: obj} match { - case ${2:e} => ${3:/* code */} - case _ => ${4:/* code */} + case ${2:e} => ${3} + case _ => ${4} } #case snippet case - case ${1:value} => ${2:/* code */} + case ${1:value} => ${2} ############################ # methods and arguments # @@ -82,9 +82,9 @@ snippet ovdef override def ${1:name}(${2:arg}) = ${3:} #first class function(see scalabook p 188) snippet fcf - (${1:a}: ${2:T}) => $1 ${3:/* code */} + (${1:a}: ${2:T}) => $1 ${3} snippet => - ${1:name} => ${2:/* code */} + ${1:name} => ${2} #recursion snippet rec def ${1:name}(${2:arg}) = @@ -196,11 +196,11 @@ snippet as #scope() with one arg snippet (a - (${1:a} => ${2:/* code */}) + (${1:a} => ${2}) #scope() with two args snippet {( {(${1:a},${2:b}) => - ${3:/* code */} + ${3} } #filter snippet filter @@ -220,10 +220,10 @@ snippet fldr #fold left operator(if u wanna reduce readability of ur code) #use wildcard symbols snippet /: - (${1:first}/:${2:name})(${3:/* code */}) + (${1:first}/:${2:name})(${3}) #fold right operator snippet :\ - (${1:first}:\${2:name})(${3:/* code */}) + (${1:first}:\${2:name})(${3}) #reduce left snippet redl ${1:name}.reduceLeft[${2:T}] {( @@ -258,13 +258,13 @@ snippet athis snippet abstract abstract class ${1:name}${2:(arg)}${3: extends }${4: with} { ${5:override def toString = "$1"} - ${6:/* code */} + ${6} } #class snippet class class ${1:name}${2:(arg)}${3: extends }${4: with} { ${5:override def toString = "$1"} - ${6:/* code */} + ${6} } #object snippet object @@ -279,7 +279,7 @@ snippet ordered class ${1:name}${2:(arg)} extends Ordered[$1] ${3: with} { ${4:override def toString = "$1"} def compare(that: $1) = ${5:this - that} - ${6:/* code */} + ${6} } #case class snippet casecl diff --git a/snippets/vim.snippets b/snippets/vim.snippets index 329d1e9..728c402 100644 --- a/snippets/vim.snippets +++ b/snippets/vim.snippets @@ -10,7 +10,7 @@ snippet guard let $1 = 1${3} snippet f fun! ${1:`expand('%') =~ 'autoload' ? substitute(matchstr(expand('%:p'),'autoload/\zs.*\ze.vim'),'[/\\]','#','g').'#' : ''`}${2:function_name}(${3}) - ${4:" code} + ${4} endf snippet t try @@ -20,15 +20,15 @@ snippet t endtry snippet for for ${1:needle} in ${2:haystack} - ${3:" code} + ${3} endfor snippet wh while ${1:condition} - ${2:" code} + ${2} endw snippet if if ${1:condition} - ${2:" code} + ${2} endif snippet ife if ${1:condition} From b6ba92b409b37684983bca76f53859c6ca514298 Mon Sep 17 00:00:00 2001 From: Michael Thessel Date: Thu, 20 Jun 2013 14:39:31 -0700 Subject: [PATCH 2/2] Removed unnecessary whitespace from the end of the line --- snippets/_.snippets | 68 +++++++++---------- snippets/actionscript.snippets | 8 +-- snippets/apache.snippets | 2 +- snippets/c.snippets | 4 +- snippets/chef.snippets | 6 +- snippets/clojure.snippets | 2 +- snippets/cmake.snippets | 6 +- snippets/cpp.snippets | 6 +- snippets/cs.snippets | 14 ++-- snippets/django.snippets | 12 ++-- snippets/erlang.snippets | 8 +-- snippets/falcon.snippets | 26 ++++---- snippets/go.snippets | 32 ++++----- snippets/haskell.snippets | 2 +- snippets/htmltornado.snippets | 2 +- snippets/java.snippets | 2 +- snippets/javascript.snippets | 10 +-- snippets/markdown.snippets | 4 +- snippets/progress.snippets | 2 +- snippets/puppet.snippets | 8 +-- snippets/python.snippets | 4 +- snippets/r.snippets | 2 +- snippets/rst.snippets | 8 +-- snippets/sh.snippets | 12 ++-- snippets/tcl.snippets | 2 +- snippets/textile.snippets | 2 +- snippets/xslt.snippets | 8 +-- snippets/yii-chtml.snippets | 118 ++++++++++++++++----------------- snippets/yii.snippets | 82 +++++++++++------------ 29 files changed, 231 insertions(+), 231 deletions(-) diff --git a/snippets/_.snippets b/snippets/_.snippets index c729748..6204aee 100644 --- a/snippets/_.snippets +++ b/snippets/_.snippets @@ -16,17 +16,17 @@ snippet lorem snippet GPL2 ${1:One line to give the program's name and a brief description.} Copyright (C) `strftime("%Y")` ${2:copyright holder} - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, see . @@ -34,17 +34,17 @@ snippet GPL2 snippet LGPL2 ${1:One line to give the program's name and a brief description.} Copyright (C) `strftime("%Y")` ${2:copyright holder} - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this library; if not, see . @@ -52,35 +52,35 @@ snippet LGPL2 snippet GPL3 ${1:one line to give the program's name and a brief description.} Copyright (C) `strftime("%Y")` ${2:copyright holder} - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . - + ${3} snippet LGPL3 ${1:One line to give the program's name and a brief description.} Copyright (C) `strftime("%Y")` ${2:copyright holder} - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this library; if not, see . @@ -89,7 +89,7 @@ snippet BSD2 ${1:one line to give the program's name and a brief description} Copyright (C) `strftime("%Y")` ${2:copyright holder} All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright @@ -97,7 +97,7 @@ snippet BSD2 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -108,9 +108,9 @@ snippet BSD2 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - The views and conclusions contained in the software and documentation + + + The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressedor implied, of $2. @@ -119,7 +119,7 @@ snippet BSD3 ${1:one line to give the program's name and a brief description} Copyright (C) `strftime("%Y")` ${2:copyright holder} All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright @@ -130,7 +130,7 @@ snippet BSD3 3. Neither the name of the ${3:organization} nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -147,7 +147,7 @@ snippet BSD4 ${1:one line to give the program's name and a brief description} Copyright (C) `strftime("%Y")` ${2:copyright holder} All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright @@ -161,7 +161,7 @@ snippet BSD4 4. Neither the name of the $3 nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -177,17 +177,17 @@ snippet BSD4 snippet MIT ${1:one line to give the program's name and a brief description} Copyright (C) `strftime("%Y")` ${2:copyright holder} - + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the + and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -200,13 +200,13 @@ snippet MIT snippet APACHE ${1:one line to give the program's name and a brief description} Copyright `strftime("%Y")` ${2:copyright holder} - + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -214,14 +214,14 @@ snippet APACHE limitations under the License. ${3} -snippet BEERWARE +snippet BEERWARE ${2:one line to give the program's name and a brief description} Copyright `strftime("%Y")` ${3:copyright holder} - + Licensed under the "THE BEER-WARE LICENSE" (Revision 42): ${1:`g:snips_author`} wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think - this stuff is worth it, you can buy me a beer or coffee in return + this stuff is worth it, you can buy me a beer or coffee in return ${4} diff --git a/snippets/actionscript.snippets b/snippets/actionscript.snippets index cd2ab0e..5385d11 100644 --- a/snippets/actionscript.snippets +++ b/snippets/actionscript.snippets @@ -2,22 +2,22 @@ snippet main package { import flash.display.*; import flash.Events.*; - + public class Main extends Sprite { public function Main ( ) { trace("start"); stage.scaleMode = StageScaleMode.NO_SCALE; stage.addEventListener(Event.RESIZE, resizeListener); } - + private function resizeListener (e:Event):void { trace("The application window changed size!"); trace("New width: " + stage.stageWidth); trace("New height: " + stage.stageHeight); } - + } - + } snippet class ${1:public|internal} class ${2:name} ${3:extends } { diff --git a/snippets/apache.snippets b/snippets/apache.snippets index a9e53e1..6f0c887 100644 --- a/snippets/apache.snippets +++ b/snippets/apache.snippets @@ -6,7 +6,7 @@ snippet dir Order Deny,Allow Deny from All -# +# snippet filesmatch ${2} diff --git a/snippets/c.snippets b/snippets/c.snippets index 85e7ac2..21c265d 100644 --- a/snippets/c.snippets +++ b/snippets/c.snippets @@ -14,7 +14,7 @@ snippet mainn return 0; } ## -## Preprocessor +## Preprocessor # #include <...> snippet inc #include <${1:stdio}.h>${2} @@ -230,5 +230,5 @@ snippet gpl * * Copyright (C) ${1:Author}, `strftime("%Y")` */ - + ${2} diff --git a/snippets/chef.snippets b/snippets/chef.snippets index 5103613..d44f535 100644 --- a/snippets/chef.snippets +++ b/snippets/chef.snippets @@ -141,7 +141,7 @@ snippet svn ${12:#}svn_username ${13} # (Subversion only) Username for Subversion operations ${14:#}svn_password ${15} # (Subversion only) Password for Subversion operations ${16:#}svn_arguments ${17} # (Subversion only) Extra arguments passed to the subversion command - + ${18:#}${19:action :sync} # Update the source to the specified revision, or get a new checkout (Default) ${20:#}${21:action :checkout} # Checkout the source. Does nothing if a checkout is available ${22:#}${23:action :export} # Export the source, excluding or removing any version control artifacts @@ -159,7 +159,7 @@ snippet git ${14:#}enable_submodules ${15:"false"} # (Git only) performs a submodule init and submodule update ${16:#}remote ${17:"origin"} # (Git only) remote repository to use for syncing an existing clone ${18:#}ssh_wrapper ${19} # (Git only) path to a wrapper script for running SSH with git. GIT_SSH environment variable is set to this. - + ${20:#}${21:action :sync} # Update the source to the specified revision, or get a new clone (Default) ${22:#}${23:action :checkout} # Clone the source. Does nothing if a checkout is available ${24:#}${25:action :export} # Export the source, excluding or removing any version control artifacts @@ -197,7 +197,7 @@ snippet deploy ${54:#}before_symlink ${55:"deploy/before_symlink.rb"} # A block or path to a file containing chef code to run before symlinking ${56:#}before_restart ${57:"deploy/before_restart.rb"} # A block or path to a file containing chef code to run before restarting ${58:#}after_restart ${59:"deploy/after_restart.rb"} # A block or path to a file containing chef code to run after restarting - + ${60:#}${61::deploy} # Deploy the application (Default) ${62:#}${63::force_deploy} # For the revision deploy strategy, this removes any existing release of the same code version and re-deploys in its place ${64:#}${65::rollback} # Rollback the application to the previous release diff --git a/snippets/clojure.snippets b/snippets/clojure.snippets index e247deb..59867b7 100644 --- a/snippets/clojure.snippets +++ b/snippets/clojure.snippets @@ -43,7 +43,7 @@ snippet if (if ${1:test-expr} ${2:then-expr} ${3:else-expr}) -snippet if-let +snippet if-let (if-let [${1:result} ${2:test-expr}] (${3:then-expr} $1) (${4:else-expr})) diff --git a/snippets/cmake.snippets b/snippets/cmake.snippets index 26aa9ac..0c3a215 100644 --- a/snippets/cmake.snippets +++ b/snippets/cmake.snippets @@ -39,7 +39,7 @@ snippet link TARGET_LINK_LIBRARIES(${1:bin} ${2:somelib} ) - + snippet bin ADD_EXECUTABLE(${1:bin}) @@ -52,7 +52,7 @@ snippet dep ) snippet props - SET_TARGET_PROPERTIES(${1:target} - ${2:PROPERTIES} ${3:COMPILE_FLAGS} + SET_TARGET_PROPERTIES(${1:target} + ${2:PROPERTIES} ${3:COMPILE_FLAGS} ${4:"-O3 -Wall -pedantic"} ) diff --git a/snippets/cpp.snippets b/snippets/cpp.snippets index 0486712..52148e7 100644 --- a/snippets/cpp.snippets +++ b/snippets/cpp.snippets @@ -64,11 +64,11 @@ snippet fr # mutable snippet mu mutable -## +## ## Class # class snippet cl - class ${1:`Filename('$1', 'name')`} + class ${1:`Filename('$1', 'name')`} { public: $1(${2}); @@ -97,7 +97,7 @@ snippet cin std::cin >> ${1};${2} ## ## Iteration -# for i +# for i snippet fori for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) { ${4} diff --git a/snippets/cs.snippets b/snippets/cs.snippets index 725f8b7..d934351 100644 --- a/snippets/cs.snippets +++ b/snippets/cs.snippets @@ -1,12 +1,12 @@ # cs.snippets # =========== -# +# # Standard C-Sharp snippets for snipmate. # # Largely ported over from Visual Studio 2010 snippets plus # a few snippets from Resharper plus a few widely known snippets. # -# Most snippets on elements (i.e. classes, properties) +# Most snippets on elements (i.e. classes, properties) # follow suffix conventions. The order of suffixes to a snippet # is fixed. # @@ -55,13 +55,13 @@ # * Events # # Feedback is welcome! -# +# # entry point snippet sim public static int Main(string[] args) { ${1} return 0; - } + } snippet simc public class Application { public static int Main(string[] args) { @@ -73,13 +73,13 @@ snippet simc snippet if if (${1}) { ${2} - } + } snippet el else { ${1} - } + } snippet ifs - if (${1}) + if (${1}) ${2} # ternary conditional snippet t diff --git a/snippets/django.snippets b/snippets/django.snippets index 8296cce..5c72b2b 100644 --- a/snippets/django.snippets +++ b/snippets/django.snippets @@ -73,16 +73,16 @@ snippet model class ${1:ModelName}(models.Model): """${2:docstring}""" ${3} - + class Meta: ${4} - + def __unicode__(self): ${5} - + def save(self, force_insert=False, force_update=False): ${6} - + @models.permalink def get_absolute_url(self): return ('${7:view_or_url_name}' ${8}) @@ -90,9 +90,9 @@ snippet model snippet modeladmin class ${1:ModelName}Admin(admin.ModelAdmin): ${2} - + admin.site.register($1, $1Admin) - + snippet tabularinline class ${1:ModelName}Inline(admin.TabularInline): model = $1 diff --git a/snippets/erlang.snippets b/snippets/erlang.snippets index acc6fd1..1199e84 100644 --- a/snippets/erlang.snippets +++ b/snippets/erlang.snippets @@ -1,12 +1,12 @@ # module and export all snippet mod -module(${1:`Filename('', 'my')`}). - + -compile([export_all]). - + start() -> ${2} - + stop() -> ok. # define directive @@ -81,7 +81,7 @@ snippet application end. stop(_State) -> - ok. + ok. # OTP supervisor snippet supervisor -module(${1:`Filename('', 'my')`}). diff --git a/snippets/falcon.snippets b/snippets/falcon.snippets index 93aba19..3fe4cac 100644 --- a/snippets/falcon.snippets +++ b/snippets/falcon.snippets @@ -1,15 +1,15 @@ snippet #! #!/usr/bin/env falcon -# Import +# Import snippet imp import ${1:module} # Function snippet fun - function ${2:function_name}(${3}) + function ${2:function_name}(${3}) ${4} - end + end # Class snippet class @@ -17,35 +17,35 @@ snippet class ${3:/* members/methods */} end -# If +# If snippet if if ${1:condition} - ${2} + ${2} end # If else snippet ife if ${1:condition} - ${2} + ${2} else - ${1} + ${1} end -# If else if +# If else if snippet elif elif ${1:condition} - ${2} + ${2} # Switch case snippet switch switch ${1:expression} case ${2:item} case ${3:item} - default + default end # Select -snippet select +snippet select select ${1:variable} case ${2:TypeSpec} case ${3:TypeSpec} @@ -65,7 +65,7 @@ snippet forto end # While Loop -snippet while +snippet while while ${1:conidition} - ${2} + ${2} end diff --git a/snippets/go.snippets b/snippets/go.snippets index a88d8d0..1d7d4f5 100644 --- a/snippets/go.snippets +++ b/snippets/go.snippets @@ -4,7 +4,7 @@ snippet ap # bool snippet bl bool -# byte +# byte snippet bt byte # break @@ -29,7 +29,7 @@ snippet co # continue snippet cn continue -# defer +# defer snippet df defer ${1:func}() # defer recover @@ -57,20 +57,20 @@ snippet gpl * * Copyright (C) ${1:Author}, `strftime("%Y")` */ - + ${2} # int snippet i int -# import +# import snippet im import ( - "${1:package}" + "${1:package}" )${2} -# interface +# interface snippet in interface{} -# full interface snippet +# full interface snippet snippet inf interface ${1:name} { ${2:/* methods */} @@ -126,13 +126,13 @@ snippet fr ${4} } ${5} -# function simple +# function simple snippet fun func ${1:funcName}(${2}) ${3:error} { ${4} } ${5} -# function on receiver +# function on receiver snippet fum func (self ${1:type}) ${2:funcName}(${3}) ${4:error} { ${5} @@ -147,7 +147,7 @@ snippet lp # make snippet mk make(${1:[]string}, ${2:0}) -# map +# map snippet mp map[${1:string}]${2:int} # main() @@ -159,19 +159,19 @@ snippet main # new snippet nw new(${1:type}) -# panic +# panic snippet pn panic("${1:msg}") # print snippet pr fmt.Printf("%${1:s}\n", ${2:var})${3} -# range +# range snippet rn range ${1} -# return +# return snippet rt return ${1} -# result +# result snippet rs result # select @@ -193,7 +193,7 @@ snippet st ${2:/* data */} } ${3} -# switch +# switch snippet sw switch ${1:var} { case ${2:value1}: @@ -205,7 +205,7 @@ snippet sw } snippet sp fmt.Sprintf("%${1:s}", ${2:var})${3} -# true +# true snippet t true # variable declaration diff --git a/snippets/haskell.snippets b/snippets/haskell.snippets index bcda8a5..3857d8b 100644 --- a/snippets/haskell.snippets +++ b/snippets/haskell.snippets @@ -48,7 +48,7 @@ snippet ap ${1:map} ${2:fn} ${3:list} snippet do do - + snippet λ \${1:x} -> ${2} snippet \ diff --git a/snippets/htmltornado.snippets b/snippets/htmltornado.snippets index de99153..9685b1f 100644 --- a/snippets/htmltornado.snippets +++ b/snippets/htmltornado.snippets @@ -28,7 +28,7 @@ snippet if ${2} {% end %} snippet elif - {% elif ${1:condition} %} + {% elif ${1:condition} %} snippet else {% else %} snippet import diff --git a/snippets/java.snippets b/snippets/java.snippets index daf8928..c34010c 100644 --- a/snippets/java.snippets +++ b/snippets/java.snippets @@ -47,7 +47,7 @@ snippet tc ## ## Class Enhancements snippet ext - extends + extends snippet imp implements ## diff --git a/snippets/javascript.snippets b/snippets/javascript.snippets index e9dd58b..fedb943 100644 --- a/snippets/javascript.snippets +++ b/snippets/javascript.snippets @@ -140,7 +140,7 @@ snippet sing $1 = function $1($2) { return instance; }; - + // carry over the prototype properties $1.prototype = this; @@ -154,7 +154,7 @@ snippet sing return instance; } -# Crockford's object function +# Crockford's object function snippet obj function object(o) { function F() {} @@ -164,7 +164,7 @@ snippet obj # Define multiple properties snippet props var ${1:my_object} = Object.defineProperties( - ${2:new Object()}, + ${2:new Object()}, { ${3:property} : { get : function $1_$3_getter() { @@ -182,9 +182,9 @@ snippet props ); # Define single property snippet prop - Object.defineProperty( + Object.defineProperty( ${1:object}, - "${2:property}", + "${2:property}", { get : function $1_$2_getter() { // getter code diff --git a/snippets/markdown.snippets b/snippets/markdown.snippets index e4efd3c..9788959 100644 --- a/snippets/markdown.snippets +++ b/snippets/markdown.snippets @@ -24,11 +24,11 @@ snippet ![:* snippet === `repeat('=', strlen(getline(line(".") - 1)))` - + ${1} snippet --- `repeat('-', strlen(getline(line(".") - 1)))` - + ${1} snippet blockquote diff --git a/snippets/progress.snippets b/snippets/progress.snippets index 0e6d47b..0f1f436 100644 --- a/snippets/progress.snippets +++ b/snippets/progress.snippets @@ -55,4 +55,4 @@ snippet log snippet dec DECIMAL snippet sep - /* ------------------------------------------------------------------------- */ + /* ------------------------------------------------------------------------- */ diff --git a/snippets/puppet.snippets b/snippets/puppet.snippets index f349932..29fe6b3 100644 --- a/snippets/puppet.snippets +++ b/snippets/puppet.snippets @@ -1,6 +1,6 @@ # Snippets for use with VIM and http://www.vim.org/scripts/script.php?script_id=2540 # -# Please contact R.I.Pienaar for additions and feedback, +# Please contact R.I.Pienaar for additions and feedback, # see it in action @ http://www.devco.net/archives/2009/09/22/vim_and_puppet.php # Language Constructs @@ -25,7 +25,7 @@ snippet ife snippet if if $${1:variable} { ${2} - } + } snippet else else { ${1} @@ -34,7 +34,7 @@ snippet ? ? { '${1}' => ${2} } -# +# # blocks etc and general syntax sugar snippet [ [ ${1} ]${2} @@ -54,7 +54,7 @@ snippet defined defined(${1:Resource}["${2:name}"])${3} snippet emerg emerg("${1:message}")${2} -snippet extlookup Simple extlookup +snippet extlookup Simple extlookup extlookup("${1:variable}")${2} snippet extlookup Extlookup with defaults extlookup("${1:variable}", "${2:default}")${3} diff --git a/snippets/python.snippets b/snippets/python.snippets index c29b340..fcce99f 100644 --- a/snippets/python.snippets +++ b/snippets/python.snippets @@ -140,7 +140,7 @@ snippet test # test case snippet testcase class ${1:ExampleCase}(unittest.TestCase): - + def test_${2:description}(self): ${3} snippet fut @@ -151,7 +151,7 @@ snippet getopt # Short option syntax: "hv:" # Long option syntax: "help" or "verbose=" opts, args = getopt.getopt(sys.argv[1:], "${1:short_options}", [${2:long_options}]) - + except getopt.GetoptError, err: # Print debug info print str(err) diff --git a/snippets/r.snippets b/snippets/r.snippets index 9507965..2436f56 100644 --- a/snippets/r.snippets +++ b/snippets/r.snippets @@ -117,5 +117,5 @@ snippet cor cor.test(${1:x}, ${2:y}) snippet fte var.test(${1:x}, ${2:y}) -snippet kvt +snippet kvt kv.test(${1:x}, ${2:y}) diff --git a/snippets/rst.snippets b/snippets/rst.snippets index d97fa57..6cb7992 100644 --- a/snippets/rst.snippets +++ b/snippets/rst.snippets @@ -30,7 +30,7 @@ snippet cont: ${1:content} snippet code: .. code:: ${1:type} - + ${2:write some code} snippet tip: .. tip:: @@ -59,11 +59,11 @@ snippet cau: #Spinx only snippet sid: .. sidebar:: ${1:Title} - - ${2} + + ${2} # CJK optimize, CJK has no space between charaters snippet *c - \ *${1:Emphasis}*\ ${2} + \ *${1:Emphasis}*\ ${2} snippet **c \ **${1:Strong emphasis}**\ ${2} diff --git a/snippets/sh.snippets b/snippets/sh.snippets index b073620..83e7848 100644 --- a/snippets/sh.snippets +++ b/snippets/sh.snippets @@ -1,7 +1,7 @@ # Shebang. Executing bash via /usr/bin/env makes scripts more portable. snippet #! #!/usr/bin/env bash - + snippet if if [[ ${1:condition} ]]; then ${2:#statements} @@ -30,9 +30,9 @@ snippet case ${2:pattern}) ${3};; esac -snippet go - while getopts '${1:o}' ${2:opts} - do +snippet go + while getopts '${1:o}' ${2:opts} + do case $$2 in ${3:o0}) ${4:#staments};; @@ -53,9 +53,9 @@ snippet getopt { cat <<- EOT - Usage : $${0:0} [options] [--] + Usage : $${0:0} [options] [--] - Options: + Options: -h|help Display this message -v|version Display script version diff --git a/snippets/tcl.snippets b/snippets/tcl.snippets index 1fe1cb9..4d456de 100644 --- a/snippets/tcl.snippets +++ b/snippets/tcl.snippets @@ -1,7 +1,7 @@ # #!/usr/bin/env tclsh snippet #! #!/usr/bin/env tclsh - + # Process snippet pro proc ${1:function_name} {${2:args}} { diff --git a/snippets/textile.snippets b/snippets/textile.snippets index c78d6ec..9ad97be 100644 --- a/snippets/textile.snippets +++ b/snippets/textile.snippets @@ -27,4 +27,4 @@ snippet fn [${1:ref number}] ${3} fn$1. ${2:footnote} - + diff --git a/snippets/xslt.snippets b/snippets/xslt.snippets index e7abdf3..6e25fd5 100644 --- a/snippets/xslt.snippets +++ b/snippets/xslt.snippets @@ -50,7 +50,7 @@ snippet import snippet include ${2} - + snippet otherwise ${1} @@ -64,7 +64,7 @@ snippet stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">${1} -snippet template +snippet template ${3} @@ -91,7 +91,7 @@ snippet when snippet with-param ${2} - + snippet with-param select - + diff --git a/snippets/yii-chtml.snippets b/snippets/yii-chtml.snippets index 91c65b9..df5d5eb 100644 --- a/snippets/yii-chtml.snippets +++ b/snippets/yii-chtml.snippets @@ -1,59 +1,59 @@ #--------------------Yii CHtml--------------------------------- #Yii CHtml::radioButton snippet yhrb - echo CHtml::radioButton('${1:name}', ${2:false},array(${3:optionName}=>${4:optionValue} ); + echo CHtml::radioButton('${1:name}', ${2:false},array(${3:optionName}=>${4:optionValue} ); #Yii CHtml::asset snippet yhass - echo CHtml::asset('${1:path}'); + echo CHtml::asset('${1:path}'); #Yii CHtml::activeLabelEx snippet yhale - echo CHtml::activeLabelEx(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::activeLabelEx(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::encodeArray snippet yheca - echo CHtml::encodeArray(array(${1})); + echo CHtml::encodeArray(array(${1})); #Yii CHtml::normalizeUrl snippet yhnurl - echo CHtml::normalizeUrl(array('${1}')); + echo CHtml::normalizeUrl(array('${1}')); #Yii CHtml::resetButton snippet yhsb - echo CHtml::submitButton('${1:label}',array('${2:optionName}'=>${3:optionValue})); + echo CHtml::submitButton('${1:label}',array('${2:optionName}'=>${3:optionValue})); #Yii CHtml::linkButton snippet yhlinkb - echo CHtml::linkButton('${1:lable}',array('${2:optionName}'=>${3:optionValue})); + echo CHtml::linkButton('${1:lable}',array('${2:optionName}'=>${3:optionValue})); #Yii CHtml::activeTextArea snippet yhata - echo CHtml::activeTextArea(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::activeTextArea(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::ajaxButton snippet yhajb - echo CHtml::ajaxButton('${1:label}', '${2:url}',array('${3:ajaxOptionName}'=>${4:ajaxOptionValue}),array('${5:optionName}'=>${6:optionValue})); + echo CHtml::ajaxButton('${1:label}', '${2:url}',array('${3:ajaxOptionName}'=>${4:ajaxOptionValue}),array('${5:optionName}'=>${6:optionValue})); #Yii CHtml::activeId snippet yhai - echo CHtml::activeId(${1:model}, '${2:attribute}'); + echo CHtml::activeId(${1:model}, '${2:attribute}'); #Yii CHtml::activeCheckBox snippet yhacb - echo CHtml::activeCheckBox(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::activeCheckBox(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::activeHiddenField snippet yhahf - echo CHtml::activeHiddenField(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::activeHiddenField(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::encode snippet yhec - echo CHtml::encode(${1:text}); + echo CHtml::encode(${1:text}); #Yii CHtml::metaTag snippet yhmtag - echo CHtml::metaTag('${1:content}', '${2:name}', '${3:httpEquiv}',array('${4:optionName}'=>${5:optionValue})); + echo CHtml::metaTag('${1:content}', '${2:name}', '${3:httpEquiv}',array('${4:optionName}'=>${5:optionValue})); #Yii CHtml::dropDownList snippet yhddl @@ -61,167 +61,167 @@ snippet yhddl #Yii CHtml::listBox snippet yhlb - echo CHtml::listBox('${1:name}', '${2:select}',array(${3}),array('${4:optionName}'=>${5:optionValue})); + echo CHtml::listBox('${1:name}', '${2:select}',array(${3}),array('${4:optionName}'=>${5:optionValue})); #Yii CHtml::script snippet yhjs - echo CHtml::script('${1:test}'); + echo CHtml::script('${1:test}'); #Yii CHtml::ajax snippet yhaj - echo CHtml::ajax(array(${1})); + echo CHtml::ajax(array(${1})); #Yii CHtml::textField snippet yhtf - echo CHtml::textField('${1:name}', '${2:value}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::textField('${1:name}', '${2:value}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::activePasswordField snippet yhapf - echo CHtml::activePasswordField(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::activePasswordField(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::listData snippet yhld - echo CHtml::listData(array(${1}),'${2:valueField}', '${3:textField}','${4:groupField}'); + echo CHtml::listData(array(${1}),'${2:valueField}', '${3:textField}','${4:groupField}'); #Yii CHtml::mailto snippet yhmt - echo CHtml::mailto('${1:text}', '${2:email}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::mailto('${1:text}', '${2:email}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::image snippet yhimg - echo CHtml::image('${1:src}', '${2:alt}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::image('${1:src}', '${2:alt}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::activeListBox snippet yhalb - echo CHtml::activeListBox(${1:model}, '${2:attribute}', array(${3}),array('${4:optionName}'=>${5:optionValue})); + echo CHtml::activeListBox(${1:model}, '${2:attribute}', array(${3}),array('${4:optionName}'=>${5:optionValue})); #Yii CHtml::activeFileField snippet yhaff - echo CHtml::activeFileField(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::activeFileField(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::closeTag snippet yhct - echo CHtml::closeTag('${1:tag}'); + echo CHtml::closeTag('${1:tag}'); #Yii CHtml::activeInputField snippet yhaif - echo CHtml::activeInputField('${1:type}', ${2:model}, '${3:attribute}',array('${4:optionName}'=>${5:optionValue})); + echo CHtml::activeInputField('${1:type}', ${2:model}, '${3:attribute}',array('${4:optionName}'=>${5:optionValue})); #Yii CHtml::scriptFile snippet yhjsf - echo CHtml::scriptFile('${1:url}'); + echo CHtml::scriptFile('${1:url}'); #Yii CHtml::radioButtonList snippet yhrbl - echo CHtml::radioButtonList('${1:name}', ${2:select}, array(${3}),array('${4:optionName}'=>${5:optionValue})); + echo CHtml::radioButtonList('${1:name}', ${2:select}, array(${3}),array('${4:optionName}'=>${5:optionValue})); #Yii CHtml::cssFile snippet yhcssf - echo CHtml::cssFile('${1:url}','${2:media}'); + echo CHtml::cssFile('${1:url}','${2:media}'); #Yii CHtml::error snippet yherr - echo CHtml::error(${1:model}, '${2:attribute}'); + echo CHtml::error(${1:model}, '${2:attribute}'); #Yii CHtml::passwordField snippet yhpf - echo CHtml::passwordField('${1:name}', '${2:value}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::passwordField('${1:name}', '${2:value}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::hiddenField snippet yhhf - echo CHtml::hiddenField('${1:name}', '${2:value}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::hiddenField('${1:name}', '${2:value}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::cdata snippet yhc - echo CHtml::cdata(${1:text}); + echo CHtml::cdata(${1:text}); #Yii CHtml::link snippet yhlink - echo CHtml::link('${1:text}',array(${2}),array('${3:optionName}'=>${4:optionValue})); + echo CHtml::link('${1:text}',array(${2}),array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::errorSummary snippet yherrs - echo CHtml::errorSummary(${1:model},'${2:headerHtml}','${3:footerHtml}'); + echo CHtml::errorSummary(${1:model},'${2:headerHtml}','${3:footerHtml}'); #Yii CHtml::tag snippet yht - echo CHtml::tag('${1:tag}',array('${2:optionName}'=>${3:optionValue}),${4:false},${5:true}); + echo CHtml::tag('${1:tag}',array('${2:optionName}'=>${3:optionValue}),${4:false},${5:true}); #Yii CHtml::ajaxLink snippet yhajl - echo CHtml::ajaxLink('${1:label}', '${2:url}',array('${3:ajaxOptionName}'=>${4:ajaxOptionValue}),array('${5:optionName}'=>${6:optionValue})); + echo CHtml::ajaxLink('${1:label}', '${2:url}',array('${3:ajaxOptionName}'=>${4:ajaxOptionValue}),array('${5:optionName}'=>${6:optionValue})); #Yii CHtml::label snippet yhlabel - echo CHtml::label('${1:label}', '${2:for}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::label('${1:label}', '${2:for}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::activeName snippet yhan - echo CHtml::activeName(${1:model}, '${2:attribute}'); + echo CHtml::activeName(${1:model}, '${2:attribute}'); #Yii CHtml::statefulForm snippet yhsform - echo CHtml::statefulForm(array('${1}'), '${2:post}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::statefulForm(array('${1}'), '${2:post}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::fileField snippet yhff - echo CHtml::fileField('${1:name}', '${2:value}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::fileField('${1:name}', '${2:value}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::activeTextField snippet yhatf - echo CHtml::activeTextField(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::activeTextField(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::css snippet yhcss - echo CHtml::css('${1:test}','${2:media}'); + echo CHtml::css('${1:test}','${2:media}'); #Yii CHtml::imageButton snippet yhimgb - echo CHtml::imageButton('${1:src}',array('${2:optionName}'=>${3:optionValue})); + echo CHtml::imageButton('${1:src}',array('${2:optionName}'=>${3:optionValue})); #Yii CHtml::ajaxSubmitButton snippet yhajsb - echo CHtml::ajaxSubmitButton('${1:label}', '${2:url}',array('${3:ajaxOptionName}'=>${4:ajaxOptionValue}),array('${5:optionName}'=>${6:optionValue})); + echo CHtml::ajaxSubmitButton('${1:label}', '${2:url}',array('${3:ajaxOptionName}'=>${4:ajaxOptionValue}),array('${5:optionName}'=>${6:optionValue})); #Yii CHtml::button snippet yhb - echo CHtml::button('${1:label}',array('${2:optionName}'=>${3:optionValue})); + echo CHtml::button('${1:label}',array('${2:optionName}'=>${3:optionValue})); #Yii CHtml::listOptions snippet yhlo - echo CHtml::listOptions('${1:selection}', array(${2}), array('${3:optionName}'=>${4:optionValue})); + echo CHtml::listOptions('${1:selection}', array(${2}), array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::activeCheckBoxList snippet yhacbl - echo CHtml::activeCheckBoxList(${1:model}, '${2:attribute}', array(${3}),array('${4:optionName}'=>${5:optionValue})); + echo CHtml::activeCheckBoxList(${1:model}, '${2:attribute}', array(${3}),array('${4:optionName}'=>${5:optionValue})); #Yii CHtml::openTag snippet yhot - echo CHtml::openTag('${1:tag}', array('${2:optionName}'=>${3:optionValue})); + echo CHtml::openTag('${1:tag}', array('${2:optionName}'=>${3:optionValue})); #Yii CHtml::checkBox snippet yhcb - echo CHtml::checkBox('${1:name}', ${2:false}, array('${3:optionName}'=>${4:optionValue})); + echo CHtml::checkBox('${1:name}', ${2:false}, array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::textArea snippet yhta - echo CHtml::textArea('${1:name}', '${2:value}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::textArea('${1:name}', '${2:value}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::linkTag snippet yhlinkt - echo CHtml::linkTag('${1:relation}', '${2:type}', '${3:href}', '${4:media}',array('${5:optionName}'=>${6:optionValue})); + echo CHtml::linkTag('${1:relation}', '${2:type}', '${3:href}', '${4:media}',array('${5:optionName}'=>${6:optionValue})); #Yii CHtml::resetButton snippet yhrsb - echo CHtml::resetButton('${1:label}',array('${2:optionName}'=>${3:optionValue})); + echo CHtml::resetButton('${1:label}',array('${2:optionName}'=>${3:optionValue})); #Yii CHtml::activeRadioButtonList snippet yharbl - echo CHtml::activeRadioButtonList(${1:model}, '${2:attribute}', array(${3}),array('${4:optionName}'=>${5:optionValue})); + echo CHtml::activeRadioButtonList(${1:model}, '${2:attribute}', array(${3}),array('${4:optionName}'=>${5:optionValue})); #Yii CHtml::checkBoxList snippet yhcbl - echo CHtml::checkBoxList('${1:name}', ${2:select}, array(${3}),array('${4:optionName}'=>${5:optionValue})); + echo CHtml::checkBoxList('${1:name}', ${2:select}, array(${3}),array('${4:optionName}'=>${5:optionValue})); #Yii CHtml::form snippet yhform @@ -231,18 +231,18 @@ snippet yhform snippet yhbeform echo CHtml::beginForm(array('${1}'), '${2:post}',array('${3:optionName}'=>${4:optionValue})); ${5} - echo CHtml::endForm(); + echo CHtml::endForm(); #Yii CHtml::activeDropDownList snippet yhaddl - echo CHtml::activeDropDownList(${1:model}, '${2:attribute}', array(${3}),array('${4:optionName}'=>${5:optionValue})); + echo CHtml::activeDropDownList(${1:model}, '${2:attribute}', array(${3}),array('${4:optionName}'=>${5:optionValue})); #Yii CHtml::activeRadioButton snippet yharb - echo CHtml::activeRadioButton(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::activeRadioButton(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); #Yii CHtml::activeLabel snippet yhal - echo CHtml::activeLabel(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); + echo CHtml::activeLabel(${1:model}, '${2:attribute}',array('${3:optionName}'=>${4:optionValue})); diff --git a/snippets/yii.snippets b/snippets/yii.snippets index 9f29eaf..da48ee2 100644 --- a/snippets/yii.snippets +++ b/snippets/yii.snippets @@ -1,58 +1,58 @@ #Yii session offset snippet yse - Yii::app()->session['${1}']; + Yii::app()->session['${1}']; #Yii renderDynamic snippet yrd - $this->renderDynamic('${1:callback}'); + $this->renderDynamic('${1:callback}'); #Yii set cache snippet ycas - Yii::app()->cache->set('${1:key}', ${2:value}, ${3:expire}, new C${4:}CacheDependency(${5})); + Yii::app()->cache->set('${1:key}', ${2:value}, ${3:expire}, new C${4:}CacheDependency(${5})); #Yii Add cache snippet ycad - Yii::app()->cache->add('${1:key}', ${2:value}, ${3:expire}, new C${4}CacheDependency(${5})); + Yii::app()->cache->add('${1:key}', ${2:value}, ${3:expire}, new C${4}CacheDependency(${5})); #Yii register CSS file snippet yregcf - Yii::app()->clientScript->registerCssFile('${1:file}'); + Yii::app()->clientScript->registerCssFile('${1:file}'); #Yii requestType snippet yreqtype - Yii::app()->request->requestType + Yii::app()->request->requestType #Yii isAjaxRequest snippet yisajax - Yii::app()->request->isAjaxRequest + Yii::app()->request->isAjaxRequest #Yii translate snippet yt - Yii::t('${1:category}', '${2:message}',array(${3})); + Yii::t('${1:category}', '${2:message}',array(${3})); #Yii register CSS snippet yregc - Yii::app()->clientScript->registerCss('${1:id}', '${2}'); + Yii::app()->clientScript->registerCss('${1:id}', '${2}'); #Yii log snippet ylog - Yii::log('${1:msg}', '${2:info}'); + Yii::log('${1:msg}', '${2:info}'); #Yii userHostAddress snippet yuserip - YYii::app()->request->userHostAddress + YYii::app()->request->userHostAddress #Yii register script file snippet yregsf - Yii::app()->clientScript->registerScriptFile('${1:scriptUrl}', CClientScript::POS_${2:END}); + Yii::app()->clientScript->registerScriptFile('${1:scriptUrl}', CClientScript::POS_${2:END}); #Yii CLinkPager snippet ylinkpager - $this->widget('CLinkPager', array('pages'=>$pages,'header'=>'${1}'})) + $this->widget('CLinkPager', array('pages'=>$pages,'header'=>'${1}'})) #Yii CJSON::encode snippet yjec - CJSON::encode(${1:text}); + CJSON::encode(${1:text}); #CActiveDataProvider snippet yadp @@ -68,23 +68,23 @@ snippet yadp ), )); ${6} - // $dataProvider->getData() will return a list of Post objects + // $dataProvider->getData() will return a list of Post objects #Yii renderDynamic internal snippet yrdi - $this->renderDynamic('${1:callback}', array('${2:key}'=>${3:value})); + $this->renderDynamic('${1:callback}', array('${2:key}'=>${3:value})); #Yii register script snippet yregs - Yii::app()->clientScript->registerScript('${1:id}', '${2}', CClientScript::POS_${3:READY}); + Yii::app()->clientScript->registerScript('${1:id}', '${2}', CClientScript::POS_${3:READY}); #Yii Flush cache snippet ycaf - Yii::app()->cache->flush(); + Yii::app()->cache->flush(); #Yii Yii::app()->request->cookies snippet yco - Yii::app()->request->cookies['${1}'] + Yii::app()->request->cookies['${1}'] #Yii user-> snippet yuser @@ -92,54 +92,54 @@ snippet yuser #Yii refresh snippet yrf - $this->refresh(); + $this->refresh(); #Yii import snippet yimp - Yii::import('${1}'); + Yii::import('${1}'); #Yii trace snippet ytrace - Yii::trace('${1:msg}'); + Yii::trace('${1:msg}'); #Yii params snippet ypar - Yii::app()->params['${1}'] + Yii::app()->params['${1}'] #Yii isPostRequest snippet yispost - Yii::app()->request->isPostRequest + Yii::app()->request->isPostRequest #Yii IF isAjaxRequest snippet yifisajax if(Yii::app()->request->isAjaxRequest == TRUE) { ${1} - } + } #Yii Yii::app()->cache->delete snippet ydelcache - Yii::app()->cache->delete('${1:key}'); + Yii::app()->cache->delete('${1:key}'); #Yii render view snippet yr - $this->render('${1:view}',array('${2:key}'=>${3:value})); + $this->render('${1:view}',array('${2:key}'=>${3:value})); #Yii redirect snippet yre - $this->redirect(array('${1:controller}/${2:action}')); + $this->redirect(array('${1:controller}/${2:action}')); #Yii Get cache snippet ycag - Yii::app()->cache->get('${1:key}'); + Yii::app()->cache->get('${1:key}'); #Yii render text snippet yrt - $this->renderText('${1}'); + $this->renderText('${1}'); #Yii render partial snippet yrp - $this->renderPartial('${1:view}',array('${2:key}'=>${3:value})); + $this->renderPartial('${1:view}',array('${2:key}'=>${3:value})); #----------------Yii Model----------------------------- #Yii Model count @@ -152,7 +152,7 @@ snippet ycountbs #Yii Model updateAll snippet yupdatea - ${1:ModelName}::model()->updateAll(${2:array('attributes')}, ${3:condition},array('${4:key}'=>${5:value})); + ${1:ModelName}::model()->updateAll(${2:array('attributes')}, ${3:condition},array('${4:key}'=>${5:value})); #Yii Model updateByPk snippet yupdatebp @@ -164,35 +164,35 @@ snippet ydela #Yii Model deleteByPk snippet ydelbp - ${1:ModelName}::model()->deleteByPk(${2:pk}, ${3:condition}, array('${4:key}'=>${5:value})); + ${1:ModelName}::model()->deleteByPk(${2:pk}, ${3:condition}, array('${4:key}'=>${5:value})); #Yii Model find snippet yfind - ${1:ModelName}::model()->find(${2:condition},array('${3:key}'=>${4:value})); + ${1:ModelName}::model()->find(${2:condition},array('${3:key}'=>${4:value})); #Yii Model findAll snippet yfinda - ${1:ModelName}::model()->findAll(${2:condition},array('${3:key}'=>${4:value})); + ${1:ModelName}::model()->findAll(${2:condition},array('${3:key}'=>${4:value})); #Yii Model findByPk snippet yfindbp - ${1:ModelName}::model()->findByPk(${2:pk}, ${3:condition}, array('${4:key}'=>${5:value})); + ${1:ModelName}::model()->findByPk(${2:pk}, ${3:condition}, array('${4:key}'=>${5:value})); #Yii Model findAllByPk snippet yfindabp - ${1:ModelName}::model()->findAllByPk(${2:pk}, ${3:condition},array('${4:key}'=>${5:value})); + ${1:ModelName}::model()->findAllByPk(${2:pk}, ${3:condition},array('${4:key}'=>${5:value})); #Yii Model findBySql snippet yfindbs - ${1:ModelName}::model()->findBySql(${2:sql}, array('${3:key}'=>${4:value})); + ${1:ModelName}::model()->findBySql(${2:sql}, array('${3:key}'=>${4:value})); #Yii Model findAllByAttributes snippet yfindaba - ${1:ModelName}::model()->findAllByAttributes(array('${2:attributeName}'=>${3:attributeValue}), ${4:condition}, array('${5:key}'=>${6:value})); + ${1:ModelName}::model()->findAllByAttributes(array('${2:attributeName}'=>${3:attributeValue}), ${4:condition}, array('${5:key}'=>${6:value})); #Yii Model exists snippet yexists - ${1:ModelName}::model()->exists(${2:condition}, array('${3:key}'=>${4:value})); + ${1:ModelName}::model()->exists(${2:condition}, array('${3:key}'=>${4:value})); #Yii Create model class snippet ymodel @@ -245,7 +245,7 @@ snippet ymodel } } -#------------Yii Controller------------------------------------ +#------------Yii Controller------------------------------------ #Yii Create controller class snippet ycontroller