Variable: yaml-ts-mode-hook

yaml-ts-mode-hook is a variable defined in yaml-ts-mode.el.gz.

Value

nil

Documentation

Hook run after entering yaml-ts-mode.

No problems result if this variable is not bound. add-hook automatically binds it. (This is true for all hook variables.)

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/yaml-ts-mode.el.gz
;;;###autoload
(define-derived-mode yaml-ts-mode text-mode "YAML"
  "Major mode for editing YAML, powered by tree-sitter."
  :group 'yaml
  :syntax-table yaml-ts-mode--syntax-table

  (when (treesit-ready-p 'yaml)
    (treesit-parser-create 'yaml)

    ;; Comments.
    (setq-local comment-start "# ")
    (setq-local comment-end "")

    ;; Indentation.
    (setq-local indent-tabs-mode nil)

    ;; Font-lock.
    (setq-local treesit-font-lock-settings yaml-ts-mode--font-lock-settings)
    (setq-local treesit-font-lock-feature-list
                '((comment)
                  (string type)
                  (constant escape-sequence number property)
                  (bracket delimiter error misc-punctuation)))

    (setq-local fill-paragraph-function #'yaml-ts-mode--fill-paragraph)

    (treesit-major-mode-setup)))