2015-12-02 14:23:39 +00:00
|
|
|
#+TITLE: YAML layer
|
2015-08-10 12:45:21 +00:00
|
|
|
|
2019-05-07 08:21:07 +00:00
|
|
|
#+TAGS: dsl|layer|markup|programming
|
2019-05-05 17:26:40 +00:00
|
|
|
|
2019-05-07 20:05:06 +00:00
|
|
|
* Table of Contents :TOC_5_gh:noexport:
|
2017-05-22 14:16:12 +00:00
|
|
|
- [[#description][Description]]
|
2017-10-04 08:13:01 +00:00
|
|
|
- [[#features][Features:]]
|
2017-05-22 14:16:12 +00:00
|
|
|
- [[#install][Install]]
|
2019-12-15 07:16:58 +00:00
|
|
|
- [[#layer][Layer]]
|
|
|
|
- [[#lsp][LSP]]
|
2017-05-22 14:16:12 +00:00
|
|
|
- [[#syntax-checking-with-flycheck][Syntax checking with flycheck]]
|
2015-08-10 12:45:21 +00:00
|
|
|
|
|
|
|
* Description
|
2017-10-04 08:13:01 +00:00
|
|
|
This layer provides support for the YAML file format.
|
|
|
|
|
|
|
|
** Features:
|
|
|
|
- Syntax highlighting
|
|
|
|
- Syntax checking via [[http://www.flycheck.org/en/latest/languages.html#yaml][flycheck]]
|
2015-08-10 12:45:21 +00:00
|
|
|
|
|
|
|
* Install
|
2019-12-15 07:16:58 +00:00
|
|
|
** Layer
|
2016-01-06 05:21:55 +00:00
|
|
|
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.
|
2016-09-16 16:49:29 +00:00
|
|
|
|
2019-12-15 07:16:58 +00:00
|
|
|
** LSP
|
|
|
|
To enable LSP, install [[https://github.com/redhat-developer/yaml-language-server][yaml-language-server]]:
|
|
|
|
|
|
|
|
#+BEGIN_SRC sh
|
2019-12-15 21:56:35 +00:00
|
|
|
npm i -g yaml-language-server
|
2019-12-15 07:16:58 +00:00
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
And set the layer variable =yaml-enable-lsp= to =t= like shown below:
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq-default dotspacemacs-configuration-layers
|
|
|
|
'((yaml :variables yaml-enable-lsp t)))
|
|
|
|
#+END_SRC
|
|
|
|
|
2016-09-16 16:49:29 +00:00
|
|
|
* Syntax checking with flycheck
|
2019-11-11 15:48:10 +00:00
|
|
|
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)
|
2017-10-04 08:13:01 +00:00
|
|
|
|
2019-11-11 15:48:10 +00:00
|
|
|
The flycheck YAML documentation can be found at the [[http://www.flycheck.org/en/latest/languages.html#yaml][flycheck website]].
|