summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-05-25 12:45:25 +0200
committerAlan Pearce2024-05-25 12:46:03 +0200
commit74c9fabdbea4cf1f9181fa5ad76a86b1bf6bccf1 (patch)
tree911d0f5aae11da376283b92e030593c69376f5de
parentaa3b04c83e8fb05490feb37d8c1fe338b36437cc (diff)
downloadnixfiles-74c9fabdbea4cf1f9181fa5ad76a86b1bf6bccf1.tar.lz
nixfiles-74c9fabdbea4cf1f9181fa5ad76a86b1bf6bccf1.tar.zst
nixfiles-74c9fabdbea4cf1f9181fa5ad76a86b1bf6bccf1.zip
emacs: enable format on save for TOML files
-rw-r--r--user/emacs/init.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 5620010e..a69fe8d1 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -1221,6 +1221,7 @@ _C-k_: prev  _u_pper              _=_: upper/lower       _s_mart resolve
             (setq apheleia-formatters
                   (append apheleia-formatters '((nixpkgs-fmt "nixpkgs-fmt")
                                                 (golines "golines")
+                                                (taplo "taplo" "format" "-")
                                                 (prettier-gotmpl
                                                  "prettier" "--stdin-filepath" filepath
                                                  "--parser=go-template" (apheleia-formatters-indent "--use-tabs" "--tab-width")))))
@@ -1229,7 +1230,8 @@ _C-k_: prev  _u_pper              _=_: upper/lower       _s_mart resolve
                   (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))))
+                                                                    (nix-mode . nixpkgs-fmt)
+                                                                    (toml-ts-mode . taplo))))
             (add-hook 'apheleia-mode-hook #'turn-off-format-all-mode))
   :init (progn
           (apheleia-global-mode +1)))