summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-05-11 15:05:16 +0200
committerAlan Pearce2024-05-11 15:05:16 +0200
commited3b8982fdc50c2e79532a203f749a8f96e538f8 (patch)
tree9d28a52fae1a614405e4974f8c55e6fc6fe16fca
parent10563d73b1c4f87e78fd2a93dd0bfb9787701d99 (diff)
downloadnixfiles-ed3b8982fdc50c2e79532a203f749a8f96e538f8.tar.lz
nixfiles-ed3b8982fdc50c2e79532a203f749a8f96e538f8.tar.zst
nixfiles-ed3b8982fdc50c2e79532a203f749a8f96e538f8.zip
emacs: fix auto-formatting setup for go templates
-rw-r--r--user/emacs/init.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 239e9e0a..40c83846 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -1113,13 +1113,14 @@ _C-k_: prev  _u_pper              _=_: upper/lower       _s_mart resolve
                   (append apheleia-formatters '((nixpkgs-fmt "nixpkgs-fmt")
                                                 (golines "golines")
                                                 (prettier-gotmpl
-                                                 ("prettier" "--stdin-filepath" filepath
-                                                  "--parser=go-template" (apheleia-formatters-js-indent "--use-tabs" "--tab-width"))))))
+                                                 "prettier" "--stdin-filepath" filepath
+                                                 "--parser=go-template" (apheleia-formatters-indent "--use-tabs" "--tab-width")))))
             (setf (alist-get 'go-ts-mode apheleia-mode-alist)
-                  '(golines))
+                  '(golines)
+                  (alist-get 'web-mode apheleia-mode-alist)
+                  '(prettier-gotmpl))
             (setq apheleia-mode-alist (append apheleia-mode-alist '((nix-ts-mode . nixpkgs-fmt)
-                                                                    (nix-mode . nixpkgs-fmt)
-                                                                    (go-ts-mode . prettier-gotmpl))))
+                                                                    (nix-mode . nixpkgs-fmt))))
             (add-hook 'apheleia-mode-hook #'turn-off-format-all-mode))
   :init (progn
           (apheleia-global-mode +1)))