Skip to content

Instantly share code, notes, and snippets.

@Emp3r
Last active March 7, 2017 17:02
Show Gist options
  • Save Emp3r/e79332a991dd64dae7c1ab14365f024f to your computer and use it in GitHub Desktop.
Save Emp3r/e79332a991dd64dae7c1ab14365f024f to your computer and use it in GitHub Desktop.
Short PHP snippets for Sublime Text. Maybe unnecessary, but they actually save a lot of time.
{
"scope": "source.php",
"completions":
[
{ "trigger": "pu", "contents": "public $1" },
{ "trigger": "pri", "contents": "private $1" },
{ "trigger": "pro", "contents": "protected $1" },
{ "trigger": "rt", "contents": "return $1;" },
{ "trigger": "ifne", "contents": "if (! empty($1)) {$2}" },
{ "trigger": "ifin", "contents": "if (is_numeric($1)) {$2}" },
]
}
// This one is funny, but also it's the best one. It's a full snippet because completion are bugged with "\$" symbols.
<snippet>
<content><![CDATA[
\$this->$1
]]></content>
<tabTrigger>t</tabTrigger>
<scope>source.php</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment