;; Start of oni-yaml (use-package yaml-ts-mode :ensure nil :defer t :init (when (and (functionp 'treesit-available-p) (treesit-available-p) (require 'treesit) (treesit-ready-p 'yaml)) (add-to-list 'major-mode-remap-alist '(yaml-mode . yaml-ts-mode))) :config (defun oni-yaml--auto-fill-mode () "Enable ‘auto-fill-mode’ only for comments." (setq-local comment-auto-fill-only-comments t) (auto-fill-mode)) (defun oni-yaml--enable-hooks (hook) "Enable all hooks I use for editing yaml files for HOOK." (add-hook hook 'electric-indent-local-mode) (add-hook hook 'electric-pair-local-mode) (add-hook hook 'highlight-indent-guides-mode) (add-hook hook 'oni-yaml--auto-fill-mode) (add-hook hook 'yaml-imenu-enable) (add-hook hook 'yaml-pro-mode) (add-hook hook 'flycheck-mode)) (define-key yaml-ts-mode-map (kbd "C-c >") 'indent-tools-hydra/body) (oni-yaml--enable-hooks 'yaml-mode-hook)) (use-package yaml-pro) ;; End of oni-yaml