Table of Contents

YAML layer

Table of ContentsClose

1. Description

This layer provides support for the YAML file format.

1.1. Features:

  • Syntax highlighting
  • Syntax checking via flycheck

2. Install

2.1. Layer

To use this configuration layer, add it to your ~/.spacemacs. You will need to add yaml to the existing dotspacemacs-configuration-layers list in this file.

2.2. LSP

To enable LSP, install yaml-language-server:

npm i -g yaml-language-server

And set the layer variable yaml-enable-lsp to t like shown below:

(setq-default dotspacemacs-configuration-layers
              '((yaml :variables yaml-enable-lsp t)))

3. Syntax checking with flycheck

Flycheck checks YAML files with either:

  • yaml-yamllint (requires yamllint)
  • yaml-jsyaml (requires the node-js package js-yaml)
  • or yaml-ruby (requires that ruby is installed on your system)

The flycheck YAML documentation can be found at the flycheck website.

Author: root

Created: 2024-07-23 Tue 17:37