Skip to content

Instantly share code, notes, and snippets.

@dakira
Last active October 31, 2023 18:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dakira/6d9e4674aa1af7d0ddf0302c4a079bbf to your computer and use it in GitHub Desktop.
Save dakira/6d9e4674aa1af7d0ddf0302c4a079bbf to your computer and use it in GitHub Desktop.
Sublime Text Snippets
<snippet>
<content><![CDATA[
<?php
class ${TM_FILENAME/(.+)\..+|.*/$1/:name}
{
${0}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>_c</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 ${1}(${2})
{
${4}
}
]]></content>
<tabTrigger>_f</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
<snippet>
<content><![CDATA[
protected function ${1}(${2})
{
${4}
}
]]></content>
<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>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
<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