summary refs log tree commit diff stats
path: root/user/emacs
diff options
context:
space:
mode:
authorAlan Pearce2022-10-03 18:03:43 +0200
committerAlan Pearce2022-10-03 18:03:43 +0200
commit55375ce81d52a0aac8a25629da970699d2af549d (patch)
tree0c259c3dd6e693ab23b5877b6b176956c39402e3 /user/emacs
parente55ec214705492e8ac0baaca394b34cabbc23461 (diff)
downloadnixfiles-55375ce81d52a0aac8a25629da970699d2af549d.tar.lz
nixfiles-55375ce81d52a0aac8a25629da970699d2af549d.tar.zst
nixfiles-55375ce81d52a0aac8a25629da970699d2af549d.zip
Emacs: replace lsp packages with eglot
Diffstat (limited to 'user/emacs')
-rw-r--r--user/emacs/init.el54
1 files changed, 14 insertions, 40 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 00a3598f..858aa98a 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -576,8 +576,8 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
             (global-eldoc-mode +1)))
 
 (use-package eldoc-box
-  :after (eldoc lsp-mode)
-  :ghook ('lsp-managed-mode #'eldoc-box-hover-mode))
+  :after (eldoc eglot)
+  :ghook ('eglot-managed-mode #'eldoc-box-hover-mode))
 
 (use-package ehelp
   :defer 15)
@@ -747,9 +747,7 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
 (use-package rustic
   :mode (("\\.rs\\'" . rustic-mode))
   :config (progn
-            (setq rustic-format-on-save t
-                  lsp-rust-analyzer-display-inlay-hints t
-                  lsp-rust-analyzer-cargo-watch-command "clippy")
+            (setq rustic-format-on-save t)
             (with-eval-after-load 'flycheck
               (add-to-list 'flycheck-checkers 'rustic-clippy))))
 
@@ -963,9 +961,8 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
 (use-package tree-sitter-indent
   :ghook ('(rustic-mode-hook)))
 
-(use-package lsp-mode
-  :defer 2
-  :general (:states 'normal :keymaps 'lsp-mode-map
+(use-package eglot
+  :general (:states 'normal :keymaps 'eglot-mode-map
                     "gd" #'xref-find-definitions
                     "gr" #'xref-find-references
                     "C-t" #'xref-pop-marker-stack)
@@ -978,38 +975,16 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
             scss-mode-hook
             html-mode-hook
             haskell-mode-hook)
-          #'lsp-deferred)
-  :ghook ('lsp-mode-hook #'lsp-enable-which-key-integration)
-  :config (progn
-            (setq lsp-auto-guess-root t
-                  lsp-auto-configure nil
-                  lsp-idle-delay 0.5
-                  lsp-enable-symbol-highlighting nil
-                  lsp-eldoc-render-all t)
-            (add-to-list 'lsp-language-id-configuration '(js-mode . "javascript"))))
-
-(use-package lsp-javascript
-  :after (lsp-mode))
-
-(use-package lsp-ui
-  :after lsp-mode
-  :ghook ('lsp-mode-hook)
-  :general (:states 'normal :keymaps 'lsp-ui-mode-map
-                    "gd" #'lsp-ui-peek-find-definitions
-                    "gr" #'lsp-ui-peek-find-references
-                    "C-t" #'lsp-ui-peek-jump-backward)
+          #'eglot-ensure)
   :config (progn
-            (setq lsp-enable-snippet nil
-                  lsp-ui-sideline-show-code-actions nil
-                  lsp-ui-sideline-enable t
-                  lsp-ui-doc-enable nil
-                  lsp-ui-peek-always-show t)))
-
-(use-package lsp-ivy
-  :after (lsp ivy))
+						(add-to-list 'eglot-stay-out-of 'company)
+            (defun my/setup-eglot-eldoc ()
+              (push 'flymake-eldoc-function eldoc-documentation-functions))
+            (add-hook 'eglot-managed-mode-hook 'my/setup-eglot-eldoc)))
 
-(use-package lsp-haskell
-  :after lsp-mode)
+(use-package consult-eglot
+  :commands (consult-eglot-symbols)
+  :after eglot)
 
 ;; Inside a javascript project, it's common to install tools locally to
 ;; the project.  This will allows emacs to find their executables.
@@ -1103,8 +1078,7 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
   "w" '(:keymap evil-window-map :package evil)
   "x" '(:keymap ctl-x-map)
   "c" (general-simulate-key "C-c")
-  "l" '(:keymap lsp-command-map :package lsp-mode)
-  "j" #'lsp-ivy-workspace-symbol
+  "j" #'consult-eglot-symbols
   "q" #'evil-delete-buffer
   "p" '(:keymap projectile-command-map :package projectile)
   "v" #'split-window-right