Skip to content

Latest commit

 

History

History
105 lines (65 loc) · 2.18 KB

README.md

File metadata and controls

105 lines (65 loc) · 2.18 KB

lsp-yaml

CircleCI Coverage Status

YAML support for lsp-mode using yaml-language-server.

Setup

Prerequisite

Install yaml-language-server (>= v0.4.0) by npm.

$ npm install -g yaml-language-server

Dependency

Configuration

To enable lsp-yaml in yaml-mode buffer, with use-package,

(use-package lsp-yaml
  :after lsp
  :config
  (add-hook 'yaml-mode-hook #'lsp))

Customization

lsp-yaml-format-enable

Specify whether to enable YAML format feature.

Default is nil.

lsp-yaml-format-options

Specify YAML format options as plist, alist or hash table. Specified options are converted to JSON object under yaml.format and sent to the server as is.

For example,

(:singleQuote t :bracketSpacing :json-false :proseWrap "preserve")

will be sent as

{
  "yaml": {
    "format": {
      "singleQuote": true,
      "bracketSpacing": false,
      "proseWrap": "preserve"
    }
  }
}

Refer to Language Server Settings of yaml-language-server for the detail.

Default is nil.

lsp-yaml-language-server-dir

Directory where yaml-language-server is installed.

Default is yaml-language-server installed under global NPM prefix directory.

lsp-yaml-schemas

Schemas plist or alist that associates schema with glob patterns. This can be also a hash table.

For example,

(setq lsp-yaml-schemas '(:kubernetes "/*-k8s.yaml"))

Default is nil.

lsp-yaml-validate

Specify whether to enable YAML validation feature.

Default is t.

lsp-yaml-hover

Specify whether to enable hover feature.

Default is t.

lsp-yaml-completion

Specify whether to enable YAML autocompletion feature.

Default is t.