Files
zed/docs/src/snippets.md
T
Miguel Raz Guzmán Macedo a2da6d971f Fix grammatical errors throughout the documentation (#58183)
Fixes a batch of grammatical mistakes found across the `docs/` folder:
typos/misspellings, subject-verb agreement errors, missing and
duplicated words, article errors (`a`/`an`), wrong word forms, and
punctuation issues (doubled periods, unclosed parentheses).

Scope is limited to prose in `docs/src/**`; no behavior, settings, or
code changes. 33 files updated, 49 lines changed.

Representative fixes:

- `globs.md`: "features varies" -> "features"; "platforms libc" ->
"platform's libc".
- `installation.md`: "the follow macOS releases" -> "the following macOS
releases".
- `key-bindings.md`: "command pallets" -> "command palette's".
- `linux.md`: capitalization after a period; "able to the environment
variable" -> "able to set the environment variable"; "These feature also
requires" -> "This feature also requires".
- `multibuffers.md`: "Window/Linux" -> "Windows/Linux"; added a missing
closing parenthesis.
- `reference/all-settings.md`: several agreement/article/missing-word
fixes plus an unclosed parenthesis.
- `languages/*`: "partent" -> "parent", "complimentary" ->
"complementary", "setup" -> "set up", "is enabled" -> "are enabled", and
similar.

Release Notes:

- N/A
2026-05-31 22:05:41 +00:00

1.7 KiB

title, description
title description
Snippets - Zed Create and use code snippets in Zed with tab stops, placeholders, variables, and language-scoped triggers.

Snippets

Use the {#action snippets::ConfigureSnippets} action to create a new snippets file or edit an existing snippets file for a specified scope.

The snippets are located in ~/.config/zed/snippets directory to which you can navigate with the {#action snippets::OpenFolder} action.

Example configuration

{
  // Each snippet must have a name and body, but the prefix and description are optional.
  // The prefix is used to trigger the snippet, but when omitted then the name is used.
  // Use placeholders like $1, $2 or ${1:defaultValue} to define tab stops.
  // The $0 determines the final cursor position.
  // Placeholders with the same value are linked.
  // If the snippet contains the $ symbol outside of a placeholder, it must be escaped with two slashes (e.g. \\$var).
  "Log to console": {
    "prefix": "log",
    "body": ["console.info(\"Hello, ${1:World}!\")", "$0"],
    "description": "Logs to console"
  }
}

Scopes

The scope is determined by the language name in lowercase e.g. python.json for Python, shell script.json for Shell Script, but there are some exceptions to this rule:

Scope Filename
Global snippets.json
JSX javascript.json
Plain Text plaintext.json

To create JSX snippets you have to use javascript.json snippets file, instead of jsx.json, but this does not apply to TSX and TypeScript which follow the above rule.

Known Limitations

  • Only the first prefix is used when a list of prefixes is passed in.
  • Currently only the json snippet file format is supported.