Home Explore Blog CI



zed

2nd chunk of `docs/src/languages/yaml.md`
35c0e4c1ad2a98857f0e1d6fa637935b3af3cb9cf875bada0000000100000ccf
        "singleQuote": false
      }
    }
  ]
}
```

### yaml-language-server Formatting

To use `yaml-language-server` instead of Prettier for YAML formatting, add the following to your Zed `settings.json`:

```json
  "languages": {
    "YAML": {
      "formatter": "language_server"
    }
  }
```

## Schemas

By default yaml-language-server will attempt to determine the correct schema for a given yaml file and retrieve the appropriate JSON Schema from [Json Schema Store](https://schemastore.org/).

You can override any auto-detected schema via the `schemas` settings key (demonstrated above) or by providing an [inlined schema](https://github.com/redhat-developer/yaml-language-server#using-inlined-schema) reference via a modeline comment at the top of your yaml file:

```yaml
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json
name: Issue Assignment
on:
  issues:
    types: [oppened]
```

You can disable the automatic detection and retrieval of schemas from the JSON Schema if desired:

```json
  "lsp": {
    "yaml-language-server": {
      "settings": {
        "yaml": {
          "schemaStore": {
            "enable": false
          }
        }
      }
    }
  }
```

## Custom Tags

Yaml-language-server supports [custom tags](https://github.com/redhat-developer/yaml-language-server#adding-custom-tags) which can be used to inject custom application functionality at runtime into your yaml files.

For example Amazon CloudFormation YAML uses a number of custom tags, to support these you can add the following to your settings.json:

```json
  "lsp": {
    "yaml-language-server": {
      "settings": {
        "yaml": {
          "customTags": [
            "!And scalar",
            "!And mapping",
            "!And sequence",
            "!If scalar",
            "!If mapping",
            "!If sequence",
            "!Not scalar",
            "!Not mapping",
            "!Not sequence",
            "!Equals scalar",
            "!Equals mapping",
            "!Equals sequence",
            "!Or scalar",
            "!Or mapping",
            "!Or sequence",
            "!FindInMap scalar",
            "!FindInMap mapping",
            "!FindInMap sequence",
            "!Base64 scalar",
            "!Base64 mapping",
            "!Base64 sequence",
            "!Cidr scalar",
            "!Cidr mapping",
            "!Cidr sequence",
            "!Ref scalar",
            "!Ref mapping",
            "!Ref sequence",
            "!Sub scalar",
            "!Sub mapping",
            "!Sub sequence",
            "!GetAtt scalar",
            "!GetAtt mapping",
            "!GetAtt sequence",
            "!GetAZs scalar",
            "!GetAZs mapping",
            "!GetAZs sequence",
            "!ImportValue scalar",
            "!ImportValue mapping",
            "!ImportValue sequence",
            "!Select scalar",
            "!Select mapping",
            "!Select sequence",
            "!Split scalar",
            "!Split mapping",
            "!Split sequence",
            "!Join scalar",
            "!Join mapping",
            "!Join sequence",
            "!Condition scalar",
            "!Condition mapping",
            "!Condition sequence"
          ]
        }
      }
    }
  }
```

Title: Further YAML Configuration: Schemas and Custom Tags
Summary
This section details how to configure YAML schemas and custom tags in Zed. It explains how to use yaml-language-server to determine the correct schema, override auto-detection, and disable schema retrieval from the JSON Schema Store. It also covers how to define custom tags for injecting application functionality into YAML files, providing an example for Amazon CloudFormation YAML.