From e04df90980677cc559c5116c0ebb6b13a0e804ac Mon Sep 17 00:00:00 2001 From: Lucas Sta Maria Date: Thu, 25 Sep 2025 20:53:50 -0500 Subject: [PATCH] fix(emacs): set default formatters and add biome formatter --- .emacs.d/include/priime-edit.el | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.emacs.d/include/priime-edit.el b/.emacs.d/include/priime-edit.el index 5df4004..eb96f5a 100644 --- a/.emacs.d/include/priime-edit.el +++ b/.emacs.d/include/priime-edit.el @@ -180,13 +180,35 @@ :config (global-undo-tree-mode)) (use-package format-all :straight t - :bind ("C-c f" . format-all-region-or-buffer)) + :bind ("C-c f" . format-all-region-or-buffer) + :config + (setq-default format-all-formatters + '(("OCaml" ocamlformat) + ("Python" black) + ("TypeScript" biome)))) (use-package ws-butler :straight t :config (ws-butler-global-mode)) (use-package avy :straight t :bind ("C-'" . #'avy-goto-word-0)) +(require 'format-all) + +(define-format-all-formatter biome + (:executable "biome") + (:install (macos "brew install biome")) + (:languages + "JavaScript" "JSX" + "TypeScript" "TSX" + "JSON" "JSON5") + (:features) + (:format + (format-all--buffer-easy + executable + "format" + (when (buffer-file-name) + (list "--stdin-file-path" (buffer-file-name)))))) + (provide 'priime-edit) ;;; priime-edit.el ends here