Skip to content

Commit

Permalink
[emacs] Switch to built-in eglot
Browse files Browse the repository at this point in the history
  • Loading branch information
gmacon committed Oct 28, 2024
1 parent 609a7b5 commit a36448a
Showing 1 changed file with 19 additions and 26 deletions.
45 changes: 19 additions & 26 deletions home-manager/config/emacs/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
(ispell-program-name "hunspell")
(require-final-newline t)
(sentence-end-double-space nil)
(eglot-extend-to-xref t)

:init
(global-hl-line-mode 1)
Expand All @@ -58,13 +59,25 @@
tab-width 4 ; but when encountering a tab, how large is it?
))

(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
'((rust-ts-mode rust-mode) .
("rust-analyzer" :initializationOptions (:check (:command "clippy"))))))

:general
(:states 'normal
:prefix gam-default-leader-key
"." #'find-file
"p" #'project-switch-project
"b" #'project-switch-to-buffer
gam-default-leader-key #'project-find-file)
gam-default-leader-key #'project-find-file
"l a" 'eglot-code-actions
"l h" 'eldoc
"l l" 'eglot
"l q" 'eglot-shutdown
"l Q" 'eglot-reconnect
"l r" 'eglot-rename
"l =" 'eglot-format)
(:states 'visual
:prefix gam-default-leader-key
"s" #'sort-lines)
Expand All @@ -73,7 +86,11 @@
(prog-mode . gam-prog-mode-setup)
(after-init . gam-after-init-hook)
(before-save . 'whitespace-cleanup)
(text-mode . flyspell-mode))
(text-mode . flyspell-mode)
(python-mode . eglot-ensure)
(python-ts-mode . eglot-ensure)
(rust-mode . eglot-ensure)
(nix-mode . eglot-ensure))

(use-package textsize
:defer nil
Expand Down Expand Up @@ -173,30 +190,6 @@
:general
(:states 'normal :prefix gam-default-leader-key "e" 'separedit))

(use-package eglot
:defer nil
:custom (eglot-extend-to-xref t)
:general
(:states 'normal
:prefix gam-default-leader-key
"l a" 'eglot-code-actions
"l h" 'eldoc
"l l" 'eglot
"l q" 'eglot-shutdown
"l Q" 'eglot-reconnect
"l r" 'eglot-rename
"l =" 'eglot-format)
:config
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
'((rust-ts-mode rust-mode) .
("rust-analyzer" :initializationOptions (:check (:command "clippy"))))))
:hook
(python-mode . eglot-ensure)
(python-ts-mode . eglot-ensure)
(rust-mode . eglot-ensure)
(nix-mode . eglot-ensure))

(use-package sideline
:hook (flymake-mode . sideline-mode))

Expand Down

0 comments on commit a36448a

Please sign in to comment.