← All extensions

Code Snippets iWonder

v0.0.1 · by ityme · added 3 November 2026

Code snippets for Zed. Currently supports [ python, ... ]

Snippets

How to install

With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.

You can also open the Extensions panel in the app and search for Code Snippets iWonder. The extension's id is snippet-iwonder.

Don't have Forge Super yet? Download it here.

README

From the extension's repository, written by its authors and not by Mentenaz. See the source.

Code Snippets iWonder

Code Snippets iWonder is a productivity extension for the Zed editor, aimed at speeding up your development workflow by providing a comprehensive collection of code snippets.

Currently, this extension provides robust support for Python, covering everything from basic control flow to type hinting and asynchronous programming.

Features

  • Instant Boilerplate: Quickly insert common patterns like main blocks, class definitions, and loops.
  • Modern Python Support: Includes snippets for async/await, type hinting, and f-strings.
  • Debugging Helpers: Fast insertion of logging statements and debug prints.
  • Type Safety: Pre-filled snippets with type annotations for variables and functions.
  • Context Aware: Snippets designed for specific contexts (e.g., class methods vs. standalone functions).

🤝 Call for Contributions

We currently support Python, but we want to build a universal library of snippets!

We invite the community to help add support for other languages (JavaScript, Rust, Go, C++, etc.). If you have a favorite set of snippets or want to improve the existing ones, please submit a Pull Request.

Installation

Method 1: Zed Extension Store (Recommended)

  1. Open Zed.
  2. Press Cmd+Shift+X (or click the Extensions icon in the sidebar).
  3. Search for Code Snippets iWonder.
  4. Click Install.

Method 2: Manual / Git Installation (For Development)

If you want to modify the snippets or contribute to the project:

  1. Clone this repository to a local directory:
    git clone https://github.com/ityme/snippet-iwonder.git
    
  2. Open Zed.
  3. Go to Extensions view.
  4. Click the Install Dev Extension button (or "Load Extension from Folder").
  5. Select the snippet-iwonder folder you just cloned.

Usage

Simply type the prefix of a snippet in your editor, and Zed will show the autocomplete suggestion. Press Tab or Enter to insert the snippet. You can then tab through the placeholders (e.g., variable names, arguments) to customize the code.

Python Snippets Guide

The Python module (python.json) is designed to cover the full spectrum of Python development. Here is a guide to the included snippets:

1. Entry Points & Imports

Start your files quickly.

PrefixDescription
mainGenerates the standard if __name__ == "__main__": block.
importBasic import module.
fromfrom module import item.
2. Function & Class Definitions

Includes aliases for speed (e.g., func vs def).

PrefixDescription
def / funcStandard function definition.
classClass definition with __init__.
def-self / func-selfInstance method (automatically adds self as the first argument).
propertyFull property definition with @property, @x.setter, and @x.deleter.
decoratorTemplate for creating a standard decorator.
decorator-with-argTemplate for a decorator that accepts arguments.
lambdaInline lambda function.
3. Control Flow
PrefixDescription
if, ifelse, elifConditional blocks.
for-i-inStandard for-loop iteration.
whileWhile loop.
try, try-finallyException handling with try/except and optional finally.
withContext manager usage (specifically tailored for file opening).
context-managerTemplate for creating your own Context Manager class (__enter__, __exit__).
4. Asynchronous Programming
PrefixDescription
def-asyncDefine an async def coroutine.
def-self-asyncDefine an async method inside a class.
5. Type Hinting (Modern Python)

These snippets help you write type-safe code faster by pre-filling annotation syntax.

PrefixDescription
def-hintFunction definition with arguments and return type hints (-> None).
def-self-hintClass method definition with type hints.
var-hint-intVariable declaration: x: int = 0.
var-hint-strVariable declaration: s: str = "".
var-hint-listVariable declaration: l: list[...] = [...].
var-hint-dictVariable declaration: d: dict[..., ...] = {...}.
6. Debugging & Logging

Don't waste time typing out print statements.

PrefixDescription
printSimple print().
print-with-typePrints a value alongside its type for debugging: print(val, type(val)).
f-stringSelf-documenting f-string for debugging variables: f"{var=}".
log-infologging.info(...)
log-debuglogging.debug(...)
log-warnlogging.warn(...)
log-errorlogging.error(...)
7. Utilities
PrefixDescription
docGenerates a Google-style docstring template.
list-comprehensionSnippet for [x for x in ...].
dict-comprehensionSnippet for {k:v for k,v in ...}.
sort-listSorts a list in-place with a lambda key.
sorted-listCreates a new sorted list using sorted().

Happy Coding!