From 1b96179b3ade261f163d0413bfe29ce3867b950d Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 3 Feb 2025 11:28:06 -0500 Subject: [PATCH] Add eglot settings and optimizations --- README.md | 1 + init.el | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 58ac12a..14d1b2f 100644 --- a/README.md +++ b/README.md @@ -852,6 +852,7 @@ Please [send me](https://www.jamescherti.com/contact/) your feedback and I'll ad 10. **Miscellaneous** - Configure recentf, savehist, and auto-save - Configure Ediff to use a single frame and split windows horizontally + - Optimize Eglot ## Author and license diff --git a/init.el b/init.el index 27ff3a9..d40cb28 100644 --- a/init.el +++ b/init.el @@ -23,6 +23,7 @@ (setq ffap-machine-p-known 'reject) ;;; package.el + (when (bound-and-true-p minimal-emacs-package-initialize-and-refresh) ;; Initialize and refresh package contents again if needed (package-initialize) @@ -431,7 +432,25 @@ ;; increasing their usefulness. (setq apropos-do-all t) -;;; Load post-init.el +;;; Eglot + +(setq eglot-sync-connect 1 + eglot-autoshutdown t) + +;; Activate Eglot in cross-referenced non-project files +(setq eglot-extend-to-xref t) + +;; Eglot optimization +(setq jsonrpc-event-hook nil) +(setq eglot-events-buffer-size 0) +(setq eglot-report-progress nil) ; Prevent Eglot minibuffer spam + +;; Eglot optimization: Disable `eglot-events-buffer' to maintain consistent +;; performance in long-running Emacs sessions. By default, it retains 2,000,000 +;; lines, and each new event triggers pretty-printing of the entire buffer, +;; leading to a gradual performance decline. +(setq eglot-events-buffer-config '(:size 0 :format full)) + (minimal-emacs-load-user-init "post-init.el") (provide 'init)