Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Sublime Text Snippets
<snippet>
<!-- Example: Hello, ${1:this} is a ${2:snippet}. -->
<content><![CDATA[
<?php
nampespace
class ${TM_FILENAME/(.+)\..+|.*/$1/:name}
{
${0}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>class</tabTrigger>
<description>Generate PHP class</description>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>embedding.php, text.html.basic, meta.embedded.block.php, punctuation.section.embedded.begin.php</scope>
</snippet>
<snippet>
<content><![CDATA[
public function __construct($1)
{
${2}
}
]]></content>
<tabTrigger>_c</tabTrigger>
<description>insert constructor</description>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
<snippet>
<content><![CDATA[
public function ${1}(${2})
{
${4}
}
]]></content>
<tabTrigger>_f</tabTrigger>
<description>new function</description>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
<snippet>
<content><![CDATA[
public function ${1}(${2})
{
${4}
}
]]></content>
<description>new protected function</description>
<tabTrigger>_pf</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
<snippet>
<content><![CDATA[
/** @test */
function a_${1}()
{
${2}
}
]]></content>
<tabTrigger>_t</tabTrigger>
<description>PHPUnit test</description>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
<snippet>
<!-- Example: Hello, ${1:this} is a ${2:snippet}. -->
<content><![CDATA[
\$this->
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>$</tabTrigger>
<description>expand this</description>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>embedding.php, text.html.basic, meta.embedded.block.php, source.php, variable.other.php, punctuation.definition.variable.php</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment