snippets.md

 1---
 2title: Snippets
 3description: "Snippets for Zed extensions."
 4---
 5
 6# Snippets
 7
 8Extensions may provide snippets for one or more languages.
 9
10Each file containing snippets can be specified in the `snippets` field of the `extensions.toml` file.
11
12The referenced path must be relative to the `extension.toml`.
13
14## Defining Snippets
15
16A given extension may provide one or more snippets. Each snippet must be registered in the `extension.toml`.
17
18Zed matches snippet files based on the lowercase name of the language (e.g. `rust.json` for Rust).
19You can use `snippets.json` as a file name to define snippets that will be available regardless of the current buffer language.
20
21For example, here is an extension that provides snippets for Rust and TypeScript:
22
23```toml
24snippets = ["./snippets/rust.json", "./snippets/typescript.json"]
25```
26
27For more information on how to create snippets, see the [Snippets documentation](../snippets.md).