commit dd1d5f6133585cea4dcac26b044da92029c24f2d
parent 4bdfeb00c0694cfdadb156f427a0545a31d3a3ad
Author: Ethan Long <ethandavidlong@gmail.com>
Date: Sun, 24 Dec 2023 17:16:46 +1100
Fixed config playing up with eglot.
Also added back the early-init.el, no idea why I ever removed it.
Diffstat:
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/config.org b/config.org
@@ -392,9 +392,12 @@ Other auxillary packages for Org mode:
LSP, the Language Server Protocol. Very nice for debugging code live as you write it. It depends on the language as to how useful this really is.
*Warning:* Some LSPs are godawful slow and can chew through CPU and memory. Be careful, tinker, and don't be afraid to disable the training wheels.
-We use the built-in package eglot for this, though we still tell ~use-package~ to downlaod it.
+We use the built-in package eglot (requires emacs 29) if possible as there seems to occasionally be issues with installing eglot.
#+begin_src emacs-lisp
- (use-package eglot)
+ (if (>= emacs-major-version 29)
+ (use-package eglot
+ :elpaca nil)
+ (use-package eglot))
(use-package markdown-mode) ; needed for formatting the stuff in the eldoc buffers
#+end_src
** Tree Sitter Setup
@@ -446,6 +449,7 @@ Haskell mode is really good for the indenting and overall behaviour of the edito
(use-package haskell-mode)
(use-package eglot
:elpaca nil
+ :after eglot
:hook (haskell-mode . eglot-ensure)
:config
(setq-default eglot-workplace-configuration
@@ -464,9 +468,10 @@ Rust mode alongside LSP again. The rust LSP is very good as far as LSPs go, very
#+begin_src emacs-lisp
(unless treesit-enabled
(print "Cannot use rust without tree-sitter!"))
-
+
(use-package eglot
:elpaca nil
+ :after eglot
:hook (rust-ts-mode . eglot-ensure)
:config
(add-to-list 'eglot-server-programs
@@ -481,7 +486,7 @@ This basic LSP setup is based on the golang guide: https://cs.opensource.google/
#+begin_src emacs-lisp
(unless treesit-enabled
(print "Cannot use go without tree-sitter!"))
-
+
(push '("\\.go\\'" . go-ts-mode) auto-mode-alist)
(push '("\\.mod\\'" . go-mod-ts-mode) auto-mode-alist)
(defun golang/project-find-go-module (dir)
@@ -497,6 +502,7 @@ This basic LSP setup is based on the golang guide: https://cs.opensource.google/
(use-package eglot
:elpaca nil
+ :after eglot
:hook (go-ts-mode . eglot-ensure)
:config
(setq-default eglot-workspace-configuration
@@ -522,9 +528,10 @@ JavaScript and TypeScript are easy thanks to tree sitter!
#+begin_src emacs-lisp
(unless treesit-enabled
(print "Cannot use JS/TS without tree-sitter!"))
-
+
(use-package eglot
:elpaca nil
+ :after eglot
:hook
(js-ts-mode . eglot-ensure)
(typescript-ts-mode . eglot-ensure)
@@ -540,6 +547,7 @@ A.K.A. the most overused and overhyped language. This language is incredibly slo
#+begin_src emacs-lisp
(use-package eglot
:elpaca nil
+ :after eglot
:hook ((python-mode python-ts-mode) . eglot-ensure)
:config
(add-to-list 'eglot-server-programs
diff --git a/early-init.el b/early-init.el
@@ -0,0 +1 @@
+(setq package-enable-at-startup nil)