From baa7ee6576b8e3795ac2b771ba146b57e86b7249 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Tue, 9 Jul 2024 07:24:24 -0600 Subject: [PATCH] configs/emacs: fix eglot format-buffer stuff, add clang/rust server --- configs/emacs.org | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configs/emacs.org b/configs/emacs.org index c7023c0..448586c 100644 --- a/configs/emacs.org +++ b/configs/emacs.org @@ -216,9 +216,17 @@ auto-completion stuff. (add-hook 'typescript-mode-hook 'eglot-ensure) (add-hook 'ruby-mode-hook 'eglot-ensure) (add-hook 'perl-mode-hook 'eglot-ensure) + + (add-to-list 'eglot-server-programs '(c-mode . ("clangd"))) + (add-to-list 'eglot-server-programs '(c++-mode . ("clangd"))) + (add-to-list 'eglot-server-programs '(rust-mode . ("rust-analyzer"))) + (define-key eglot-mode-map (kbd "C-c r") 'eglot-rename) (define-key eglot-mode-map (kbd "C-c f") 'eglot-format) - (add-hook 'before-save-hook 'eglot-format-buffer)) + + :hook + (eglot-managed-mode . (lambda() (add-hook 'before-save-hook 'eglot-format-buffer nil 'local)))) + #+end_src