2014-02-26 03:31:33 -05:00
|
|
|
priority -50
|
2013-03-17 15:13:47 -04:00
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
## Snippets from SnipMate, taken from
|
|
|
|
## https://github.com/scrooloose/snipmate-snippets.git
|
2013-03-17 15:13:47 -04:00
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet array "array"
|
|
|
|
$${1:arrayName} = array('${2}' => ${3});${4}
|
2013-03-17 15:13:47 -04:00
|
|
|
endsnippet
|
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet def "def"
|
2015-03-02 10:30:48 -05:00
|
|
|
define('${1:VARIABLE_NAME}', ${2:'definition'});${3}
|
2013-03-17 15:13:47 -04:00
|
|
|
endsnippet
|
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet do "do"
|
|
|
|
do {
|
|
|
|
${2:// code... }
|
2014-09-11 07:58:01 -04:00
|
|
|
} while (${1:/* condition */});
|
2013-03-17 15:13:47 -04:00
|
|
|
endsnippet
|
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet doc_f "doc_f"
|
|
|
|
/**
|
|
|
|
* $2
|
|
|
|
* @return ${4:void}
|
|
|
|
* @author ${5:`!v g:snips_author`}
|
|
|
|
**/
|
|
|
|
${1:public }function ${2:someFunc}(${3})
|
|
|
|
{${6}
|
|
|
|
}
|
|
|
|
endsnippet
|
2013-03-17 15:13:47 -04:00
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet doc_i "doc_i"
|
2013-07-31 09:56:59 -04:00
|
|
|
/**
|
2014-02-26 03:31:33 -05:00
|
|
|
* $1
|
|
|
|
* @package ${2:default}
|
|
|
|
* @author ${3:`!v g:snips_author`}
|
|
|
|
**/
|
|
|
|
interface ${1:someClass}
|
|
|
|
{${4}
|
|
|
|
} // END interface $1"
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet else "else"
|
|
|
|
else {
|
|
|
|
${1:// code...}
|
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet for "for"
|
|
|
|
for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {
|
|
|
|
${4:// code...}
|
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet foreachk "foreachk"
|
2015-02-24 11:23:50 -05:00
|
|
|
foreach ($${1:variable} as $${2:key} => $${3:value}) {
|
2014-02-26 03:31:33 -05:00
|
|
|
${4:// code...}
|
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet get "get"
|
|
|
|
$_GET['${1}']${2}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet if "if"
|
|
|
|
if (${1:/* condition */}) {
|
|
|
|
${2:// code...}
|
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
2014-09-11 08:06:36 -04:00
|
|
|
snippet elif "elseif"
|
|
|
|
elseif (${1:/* condition */}) {
|
|
|
|
${2:// code...}
|
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet inc "inc"
|
|
|
|
include '${1:file}';${2}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet log "log"
|
|
|
|
error_log(var_export(${1}, true));${2}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet post "post"
|
|
|
|
$_POST['${1}']${2}
|
|
|
|
endsnippet
|
|
|
|
|
2015-02-24 11:23:50 -05:00
|
|
|
snippet req "req1"
|
|
|
|
require_once '${1:file}';${2}
|
|
|
|
endsnippet
|
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet req1 "req1"
|
|
|
|
require_once '${1:file}';${2}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet session "session"
|
|
|
|
$_SESSION['${1}']${2}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet t "t"
|
|
|
|
$${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b};${5}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet var "var"
|
|
|
|
var_export(${1});${2}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet getter "PHP Class Getter" b
|
2015-01-30 09:25:14 -05:00
|
|
|
/**
|
2014-02-26 03:31:33 -05:00
|
|
|
* Getter for $1
|
2015-01-30 09:25:14 -05:00
|
|
|
*
|
|
|
|
* ${2:return string}
|
2013-03-17 15:13:47 -04:00
|
|
|
*/
|
2014-02-26 03:31:33 -05:00
|
|
|
public function get${1/\w+\s*/\u$0/}()
|
2013-03-17 15:13:47 -04:00
|
|
|
{
|
2015-01-30 09:25:14 -05:00
|
|
|
return $this->$1;$3
|
2013-03-17 15:13:47 -04:00
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet setter "PHP Class Setter" b
|
2015-01-30 09:25:14 -05:00
|
|
|
/**
|
2014-02-26 03:31:33 -05:00
|
|
|
* Setter for $1
|
2015-01-30 09:25:14 -05:00
|
|
|
*
|
|
|
|
* @param ${2:string} $$1
|
|
|
|
* @return ${3:`!p snip.rv=snip.basename`}
|
2014-02-26 03:31:33 -05:00
|
|
|
*/
|
2015-01-30 09:25:14 -05:00
|
|
|
public function set${1/\w+\s*/\u$0/}(${4:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1)
|
2013-03-17 15:13:47 -04:00
|
|
|
{
|
2015-01-30 09:25:14 -05:00
|
|
|
$this->$1 = $$1;$5
|
2015-02-24 11:23:50 -05:00
|
|
|
|
2015-01-30 09:25:14 -05:00
|
|
|
${6:return $this;}
|
2013-03-17 15:13:47 -04:00
|
|
|
}
|
2014-02-26 03:31:33 -05:00
|
|
|
$0
|
2013-03-17 15:13:47 -04:00
|
|
|
endsnippet
|
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet gs "PHP Class Getter Setter" b
|
2015-01-30 09:25:14 -05:00
|
|
|
/**
|
2014-03-19 09:43:08 -04:00
|
|
|
* Getter for $1
|
2015-01-30 09:25:14 -05:00
|
|
|
*
|
|
|
|
* return ${2:string}
|
2014-02-26 03:31:33 -05:00
|
|
|
*/
|
2014-03-19 09:43:08 -04:00
|
|
|
public function get${1/\w+\s*/\u$0/}()
|
2013-03-17 15:13:47 -04:00
|
|
|
{
|
2015-01-30 09:25:14 -05:00
|
|
|
return $this->$1;$3
|
2013-03-17 15:13:47 -04:00
|
|
|
}
|
|
|
|
|
2015-01-30 09:25:14 -05:00
|
|
|
/**
|
2014-03-19 09:43:08 -04:00
|
|
|
* Setter for $1
|
2015-01-30 09:25:14 -05:00
|
|
|
*
|
|
|
|
* @param $2 $$1
|
|
|
|
* @return ${4:`!p snip.rv=snip.basename`}
|
2013-03-17 15:13:47 -04:00
|
|
|
*/
|
2015-01-30 09:25:14 -05:00
|
|
|
public function set${1/\w+\s*/\u$0/}(${5:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1)
|
2014-02-26 03:31:33 -05:00
|
|
|
{
|
2015-01-30 09:25:14 -05:00
|
|
|
$this->$1 = $$1;$6
|
2015-02-24 11:23:50 -05:00
|
|
|
|
2015-01-30 09:25:14 -05:00
|
|
|
${7:return $this;}
|
2014-02-26 03:31:33 -05:00
|
|
|
}
|
|
|
|
$0
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet pub "Public function" b
|
2014-09-23 03:18:53 -04:00
|
|
|
/**
|
|
|
|
* ${3:undocumented function}
|
|
|
|
*
|
|
|
|
* @return ${4:void}
|
|
|
|
*/
|
2014-02-26 03:31:33 -05:00
|
|
|
public function ${1:name}(${2:$param})
|
|
|
|
{
|
2014-09-23 03:18:53 -04:00
|
|
|
${VISUAL}${5:return null;}
|
2014-02-26 03:31:33 -05:00
|
|
|
}
|
|
|
|
$0
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet pro "Protected function" b
|
2014-09-23 03:18:53 -04:00
|
|
|
/**
|
|
|
|
* ${3:undocumented function}
|
|
|
|
*
|
|
|
|
* @return ${4:void}
|
|
|
|
*/
|
2014-02-26 03:31:33 -05:00
|
|
|
protected function ${1:name}(${2:$param})
|
|
|
|
{
|
2014-09-23 03:18:53 -04:00
|
|
|
${VISUAL}${5:return null;}
|
2014-02-26 03:31:33 -05:00
|
|
|
}
|
|
|
|
$0
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet pri "Private function" b
|
2014-09-23 03:18:53 -04:00
|
|
|
/**
|
|
|
|
* ${3:undocumented function}
|
|
|
|
*
|
|
|
|
* @return ${4:void}
|
|
|
|
*/
|
2014-02-26 03:31:33 -05:00
|
|
|
private function ${1:name}(${2:$param})
|
2013-03-17 15:13:47 -04:00
|
|
|
{
|
2014-09-23 03:18:53 -04:00
|
|
|
${VISUAL}${5:return null;}
|
2014-02-26 03:31:33 -05:00
|
|
|
}
|
|
|
|
$0
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet pubs "Public static function" b
|
2014-09-23 03:18:53 -04:00
|
|
|
/**
|
|
|
|
* ${3:undocumented function}
|
|
|
|
*
|
|
|
|
* @return ${4:void}
|
|
|
|
*/
|
2014-02-26 03:31:33 -05:00
|
|
|
public static function ${1:name}(${2:$param})
|
|
|
|
{
|
2014-09-23 03:18:53 -04:00
|
|
|
${VISUAL}${5:return null;}
|
2014-02-26 03:31:33 -05:00
|
|
|
}
|
|
|
|
$0
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet pros "Protected static function" b
|
2014-09-23 03:18:53 -04:00
|
|
|
/**
|
|
|
|
* ${3:undocumented function}
|
|
|
|
*
|
|
|
|
* @return ${4:void}
|
|
|
|
*/
|
2014-02-26 03:31:33 -05:00
|
|
|
protected static function ${1:name}(${2:$param})
|
|
|
|
{
|
2014-09-23 03:18:53 -04:00
|
|
|
${VISUAL}${5:return null;}
|
2014-02-26 03:31:33 -05:00
|
|
|
}
|
|
|
|
$0
|
|
|
|
endsnippet
|
2013-03-17 15:13:47 -04:00
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet pris "Private static function" b
|
2014-09-23 03:18:53 -04:00
|
|
|
/**
|
|
|
|
* ${3:undocumented function}
|
|
|
|
*
|
|
|
|
* @return ${4:void}
|
|
|
|
*/
|
2014-02-26 03:31:33 -05:00
|
|
|
private static function ${1:name}(${2:$param})
|
|
|
|
{
|
2014-09-23 03:18:53 -04:00
|
|
|
${VISUAL}${5:return null;}
|
2013-03-17 15:13:47 -04:00
|
|
|
}
|
2014-02-26 03:31:33 -05:00
|
|
|
$0
|
|
|
|
endsnippet
|
2013-08-02 10:12:04 -04:00
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet fu "Function snip" b
|
|
|
|
function ${1:name}(${2:$param})
|
2013-08-02 10:12:04 -04:00
|
|
|
{
|
2014-02-26 03:31:33 -05:00
|
|
|
${VISUAL}${3:return null;}
|
2013-08-02 10:12:04 -04:00
|
|
|
}
|
2014-02-26 03:31:33 -05:00
|
|
|
$0
|
2013-08-02 10:12:04 -04:00
|
|
|
endsnippet
|
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet fore "Foreach loop"
|
2015-02-24 11:23:50 -05:00
|
|
|
foreach ($${1:variable} as $${3:value}) {
|
2014-02-26 03:31:33 -05:00
|
|
|
${VISUAL}${4}
|
2013-08-02 10:12:04 -04:00
|
|
|
}
|
2014-02-26 03:31:33 -05:00
|
|
|
$0
|
2013-03-17 15:13:47 -04:00
|
|
|
endsnippet
|
2013-08-18 23:58:09 -04:00
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet new "New class instance" b
|
2015-03-02 10:30:48 -05:00
|
|
|
$${1:variableName} = new ${2:${1/\w+\s*/\u$0/}}($3);
|
2014-02-26 03:31:33 -05:00
|
|
|
$0
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet ife "if else"
|
|
|
|
if (${1:/* condition */}) {
|
|
|
|
${2:// code...}
|
2013-08-26 09:11:23 -04:00
|
|
|
} else {
|
2014-02-26 03:31:33 -05:00
|
|
|
${3:// code...}
|
|
|
|
}
|
|
|
|
$0
|
|
|
|
endsnippet
|
2013-08-26 09:11:23 -04:00
|
|
|
|
2015-02-03 04:49:07 -05:00
|
|
|
snippet ns "namespace declaration" b
|
|
|
|
namespace ${1:`!p
|
2016-04-29 12:32:57 -04:00
|
|
|
relpath = os.path.relpath(path)
|
|
|
|
m = re.search(r'[A-Z].+(?=/)', relpath)
|
2015-02-03 04:49:07 -05:00
|
|
|
if m:
|
2015-02-12 05:07:46 -05:00
|
|
|
snip.rv = m.group().replace('/', '\\')
|
2015-02-03 04:49:07 -05:00
|
|
|
`};
|
|
|
|
endsnippet
|
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet class "Class declaration template" b
|
2015-02-03 04:49:07 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace ${1:`!p
|
2016-04-29 12:32:57 -04:00
|
|
|
relpath = os.path.relpath(path)
|
|
|
|
m = re.search(r'[A-Z].+(?=/)', relpath)
|
2015-02-03 04:49:07 -05:00
|
|
|
if m:
|
2015-02-12 05:07:46 -05:00
|
|
|
snip.rv = m.group().replace('/', '\\')
|
2015-02-03 04:49:07 -05:00
|
|
|
`};
|
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
/**
|
2015-02-03 04:49:07 -05:00
|
|
|
* Class ${1:`!p snip.rv=snip.basename`}
|
|
|
|
* @author ${2:`!v g:snips_author`}
|
2014-02-26 03:31:33 -05:00
|
|
|
*/
|
2015-02-03 04:49:07 -05:00
|
|
|
class $1
|
2014-02-26 03:31:33 -05:00
|
|
|
{
|
2013-08-26 09:11:23 -04:00
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
2015-02-03 04:49:07 -05:00
|
|
|
snippet interface "Interface declaration template" b
|
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace ${1:`!p
|
2016-04-29 12:32:57 -04:00
|
|
|
relpath = os.path.relpath(path)
|
|
|
|
m = re.search(r'[A-Z].+(?=/)', relpath)
|
2015-02-03 04:49:07 -05:00
|
|
|
if m:
|
2015-02-12 05:07:46 -05:00
|
|
|
snip.rv = m.group().replace('/', '\\')
|
2015-02-03 04:49:07 -05:00
|
|
|
`};
|
|
|
|
|
2014-09-23 03:51:44 -04:00
|
|
|
/**
|
2015-02-03 04:49:07 -05:00
|
|
|
* Interface ${1:`!p snip.rv=snip.basename`}
|
2014-09-23 03:51:44 -04:00
|
|
|
* @author ${2:`!v g:snips_author`}
|
|
|
|
*/
|
|
|
|
interface $1
|
|
|
|
{
|
2015-02-12 05:07:46 -05:00
|
|
|
public function ${3:someFunction}();$4
|
2014-09-23 03:51:44 -04:00
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
2016-04-30 08:17:26 -04:00
|
|
|
snippet trait "Trait declaration template" b
|
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace ${1:`!p
|
|
|
|
relpath = os.path.relpath(path)
|
|
|
|
m = re.search(r'[A-Z].+(?=/)', relpath)
|
|
|
|
if m:
|
|
|
|
snip.rv = m.group().replace('/', '\\')
|
|
|
|
`};
|
|
|
|
|
|
|
|
/**
|
2016-04-30 08:57:11 -04:00
|
|
|
* Trait ${1:`!p snip.rv=snip.basename`}
|
2016-04-30 08:17:26 -04:00
|
|
|
* @author ${2:`!v g:snips_author`}
|
|
|
|
*/
|
|
|
|
trait $1
|
|
|
|
{
|
|
|
|
}
|
|
|
|
endsnippet
|
2015-02-03 04:49:07 -05:00
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
snippet construct "__construct()" b
|
2013-08-18 23:58:09 -04:00
|
|
|
/**
|
2014-02-26 03:31:33 -05:00
|
|
|
* @param $2mixed ${1/, /\n * \@param mixed /g}
|
2013-08-18 23:58:09 -04:00
|
|
|
*/
|
2014-02-26 03:31:33 -05:00
|
|
|
public function __construct(${1:$dependencies})
|
|
|
|
{${1/\$(\w+)(, )*/\n $this->$1 = $$1;/g}
|
|
|
|
}
|
|
|
|
$0
|
2013-08-18 23:58:09 -04:00
|
|
|
endsnippet
|
2014-02-26 03:31:33 -05:00
|
|
|
|
2014-08-14 07:26:54 -04:00
|
|
|
snippet ve "Dumb debug helper in HTML"
|
|
|
|
echo '<pre>' . var_export($1, 1) . '</pre>';$0
|
2014-02-26 03:31:33 -05:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet pc "Dumb debug helper in cli"
|
|
|
|
var_export($1);$0
|
|
|
|
endsnippet
|
|
|
|
|
2014-09-23 03:19:26 -04:00
|
|
|
snippet inheritdoc "@inheritdoc docblock"
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
endsnippet
|
|
|
|
|
2014-02-26 03:31:33 -05:00
|
|
|
# :vim:ft=snippets:
|