spacemacs/layers/+lang/yaml/README.org

47 lines
1.4 KiB
Org Mode
Raw Normal View History

#+TITLE: YAML layer
2015-08-10 12:45:21 +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]]
- [[#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
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
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
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
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 [[http://www.flycheck.org/en/latest/languages.html#yaml][flycheck website]].