summary refs log tree commit diff stats
path: root/user/emacs/init.el
diff options
context:
space:
mode:
authorAlan Pearce2025-03-16 15:54:51 +0100
committerAlan Pearce2025-03-16 15:54:51 +0100
commit6234918b624931b70cda57d015a534794d0ec8d1 (patch)
tree2dd646aef5bc817c6fe25eb12bf176f09c4261c3 /user/emacs/init.el
parenta7d2453e018469dd67c6eeabe033a1919b212078 (diff)
downloadnixfiles-6234918b624931b70cda57d015a534794d0ec8d1.tar.lz
nixfiles-6234918b624931b70cda57d015a534794d0ec8d1.tar.zst
nixfiles-6234918b624931b70cda57d015a534794d0ec8d1.zip
emacs: disable other formatter modes when using eglot
Diffstat (limited to 'user/emacs/init.el')
-rw-r--r--user/emacs/init.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 5d5c1cb3..c8643529 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -1226,7 +1226,12 @@ paths for the same project."
   "Whether to ask the LSP to format the buffer before saving"
   :init-val nil
   (if eglot-format-before-save-mode
-      (add-hook 'before-save-hook #'eglot-format-buffer nil 'local)
+      (progn
+        (add-hook 'before-save-hook #'eglot-format-buffer nil 'local)
+        (when (bound-and-true-p apheleia-mode)
+          (apheleia-mode -1))
+        (when (bound-and-true-p format-all-mode)
+          (format-all-mode -1)))
     (remove-hook 'before-save-hook #'eglot-format-buffer 'local)))
 
 (use-package eglot