Skip to content

mfabing/zed-php-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Zed PHP Snippets

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.

✨ Features

  • 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

📂 Installation

  1. Clone or download this repository.

  2. Copy php.json to 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\
  3. Restart Zed Editor.

🖥 Usage

  • 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.

📌 Example

Typing:

f⇥

Expands to:

function name($args) {
    // code
}

🤝 Contributing

Pull requests are welcome! If you have additional snippets or improvements, feel free to submit a PR.

📜 License

MIT License

About

PHP snippets for Zed Editor — fast coding shortcuts for functions, classes, superglobals, and more.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors