From 2d2481e11d7404cd237d734a44d3e95b98bce9cf Mon Sep 17 00:00:00 2001 From: larstvei Date: Fri, 22 Mar 2024 19:54:31 +0100 Subject: [PATCH] Format before save when using eglot --- init.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.org b/init.org index dbfe87d..edc2738 100644 --- a/init.org +++ b/init.org @@ -1523,7 +1523,9 @@ (use-package eglot :defer t - :hook (eglot-managed-mode . (lambda () (eglot-inlay-hints-mode -1))) + :hook (eglot-managed-mode . (lambda () + (eglot-inlay-hints-mode -1) + (add-hook 'before-save-hook 'eglot-format nil t))) :config (setq eglot-events-buffer-size 0) (add-to-list 'eglot-server-programs