mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
Some buffers which use markdown-mode or yaml mode yield errors when using the prettier-js package to format them, as it looks at the file extension by default to figure out what parser to use. Some temporary files that use these modes don't have the correct file extension, so prettier-js yields an error. My manually specifying the correct "--parser" option for each major-mode, this is no longer an issue.
35 lines
689 B
EmacsLisp
35 lines
689 B
EmacsLisp
;;; siren-yaml.el --- jimeh's Emacs Siren: yaml-mode configuration.
|
|
|
|
;;; Commentary:
|
|
|
|
;; Basic configuration for yaml-mode.
|
|
|
|
;;; Code:
|
|
|
|
(require 'siren-prettier-js)
|
|
(require 'siren-prog-mode)
|
|
|
|
(use-package yaml-mode
|
|
:mode "\\.yml\\'" "\\.yaml\\'"
|
|
:bind (:map yaml-mode-map
|
|
("RET" . newline-and-indent))
|
|
|
|
:hook
|
|
(yaml-mode . siren-yaml-mode-setup)
|
|
|
|
:init
|
|
(defun siren-yaml-mode-setup ()
|
|
(run-hooks 'prog-mode-hook)
|
|
(setq tab-width 2
|
|
prettier-js-args '("--parser" "yaml"))
|
|
(prettier-js-mode)
|
|
(subword-mode +1)))
|
|
|
|
(use-package yaml-imenu
|
|
:after yaml-mode
|
|
:config
|
|
(yaml-imenu-enable))
|
|
|
|
(provide 'siren-yaml)
|
|
;;; siren-yaml.el ends here
|