From a96fed6261783ecb3d61f00786f4254a4d7c69fe Mon Sep 17 00:00:00 2001 From: Rawley Fowler <75388349+rawleyfowler@users.noreply.github.com> Date: Wed, 8 Jun 2022 08:11:39 -0600 Subject: [PATCH] eglot mode hooks --- emacs.d/modes.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/emacs.d/modes.el b/emacs.d/modes.el index 7a75ffe..7bdf19e 100644 --- a/emacs.d/modes.el +++ b/emacs.d/modes.el @@ -4,11 +4,10 @@ ;;; Code: (require 'lsp-mode) ;; Language modes + configurations +(require 'eglot) (use-package typescript-mode :mode ("\\.tsx?\\'" . typescript-mode) - :hook - (typescript-mode . lsp-deferred) :config (setq typescript-indent-level 2)) @@ -44,6 +43,15 @@ (use-package json-mode) (use-package yaml-mode) +;; eglot mode hooks +(add-to-list 'eglot-server-programs '((c++-mode c-mode) "clangd")) +(add-hook 'c-mode-hook 'eglot-ensure) +(add-hook 'c++-mode-hook 'eglot-ensure) +(add-hook 'typescript-mode 'eglot-ensure) +(add-hook 'go-mode 'eglot-ensure) +(add-hook 'clojure-mode 'eglot-ensure) + + ;; Built-in mode configs ; Ruby (add-to-list 'auto-mode-alist