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