A collection of PHP snippets for Zed Editor, converted from Sublime Text. These snippets make writing PHP code faster with shortcuts for common patterns such as functions, classes, conditionals, arrays, superglobals, and more.
-
Quick access to PHP superglobals (
$_GET,$_POST,$_SESSION, etc.) -
Shortcuts for:
- Functions and methods
- Classes, interfaces, traits
- Control structures (
if,else,foreach,switch, etc.) - Debugging helpers (
print_r,var_dump,exit) - PHPDoc comments (
/** ... */)
-
Consistent prefixes based on PHP coding habits
-
Clone or download this repository.
-
Copy
php.jsonto your Zed snippets directory:Linux / macOS:
mkdir -p ~/.config/zed/snippets cp php.json ~/.config/zed/snippets/
Windows (PowerShell):
mkdir $env:USERPROFILE\.config\zed\snippets copy php.json $env:USERPROFILE\.config\zed\snippets\
-
Restart Zed Editor.
- Start typing a prefix (e.g.
_G) and hit Tab → expands to$_GET['variable']. - Type
f+ Tab → expands to a function template. - Type
class+ Tab → expands to a full PHP class skeleton. - Type
doc_f+ Tab → expands to a PHPDoc function block.
Typing:
f⇥
Expands to:
function name($args) {
// code
}Pull requests are welcome! If you have additional snippets or improvements, feel free to submit a PR.
MIT License