diff options
author | Alan Pearce | 2022-10-03 18:03:43 +0200 |
---|---|---|
committer | Alan Pearce | 2022-10-03 18:03:43 +0200 |
commit | 55375ce81d52a0aac8a25629da970699d2af549d (patch) | |
tree | 0c259c3dd6e693ab23b5877b6b176956c39402e3 | |
parent | e55ec214705492e8ac0baaca394b34cabbc23461 (diff) | |
download | nixfiles-55375ce81d52a0aac8a25629da970699d2af549d.tar.lz nixfiles-55375ce81d52a0aac8a25629da970699d2af549d.tar.zst nixfiles-55375ce81d52a0aac8a25629da970699d2af549d.zip |
Emacs: replace lsp packages with eglot
-rw-r--r-- | user/emacs/init.el | 54 | ||||
-rw-r--r-- | user/settings/emacs.nix | 8 |
2 files changed, 17 insertions, 45 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 diff --git a/user/settings/emacs.nix b/user/settings/emacs.nix index c187ad69..e0022265 100644 --- a/user/settings/emacs.nix +++ b/user/settings/emacs.nix @@ -88,6 +88,8 @@ in company company-web company-tabnine + consult + consult-eglot counsel counsel-projectile crux @@ -96,6 +98,7 @@ in doom-themes dired-git-info editorconfig + eglot eldoc-box emmet-mode esh-autosuggest @@ -141,11 +144,6 @@ in kubel kubel-evil ledger-mode - lsp-mode - lsp-ui - lsp-haskell - lsp-ivy - lsp-treemacs magit markdown-mode modus-themes |