Function: yaml-mode

yaml-mode is an interactive and natively compiled function defined in yaml-mode.el.

Signature

(yaml-mode)

Documentation

Simple mode to edit YAML.

In addition to any hooks its parent mode text-mode might have run, this mode runs the hook yaml-mode-hook, as the final or penultimate step during initialization.

- yaml-electric-dash-and-dot
. yaml-electric-dash-and-dot
> yaml-electric-bar-and-angle
DEL yaml-electric-backspace
| yaml-electric-bar-and-angle

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/i3kilmgmg3bk0mkr28r6pk0h5mg4s0wd-emacs-packages-deps/share/emacs/site-lisp/elpa/yaml-mode-20260830.2340/yaml-mode.el
;;;###autoload
(define-derived-mode yaml-mode text-mode "YAML"
  "Simple mode to edit YAML."
  (setq-local electric-indent-inhibit t) ;We can't *re*indent reliably.
  (setq-local comment-start "# ")
  (setq-local comment-start-skip "#+ *")
  (setq-local comment-end "")
  (setq-local indent-line-function #'yaml-indent-line)
  (setq-local indent-tabs-mode nil)
  (setq-local fill-paragraph-function #'yaml-fill-paragraph)
  (setq-local page-delimiter "^---\\([ \t].*\\)*\n")

  (setq-local syntax-propertize-function  #'yaml-mode-syntax-propertize-function)
  (setq-local imenu-generic-expression yaml-imenu-generic-expression)
  (setq-local font-lock-defaults '(yaml-font-lock-keywords)))