blob: 8a04c8457447ad86b9849ddbf1f8403ac4894c8b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
(when (gx/maybe-require-package 'eglot)
(autoload #'eglot-ensure "eglot" nil t))
(defun gx/eglot-format-before-save ()
(add-hook 'before-save-hook #'eglot-format nil t))
(defun gx/eglot-code-action-organize-imports-before-save ()
(add-hook 'before-save-hook #'eglot-code-action-organize-imports nil t))
(with-eval-after-load 'evil
(evil-define-key 'normal 'eglot--managed-mode
(kbd "gd") 'xref-find-definitions
(kbd "gr") 'xref-find-references
(kbd "gt") 'eglot-find-typeDefinition
(kbd "K") 'eldoc-doc-buffer
(kbd "gi") 'eglot-find-implementation
(kbd "C-t") 'xref-pop-marker-stack))
(setq eglot-autoreconnect t)
(with-eval-after-load 'eglot
(setq completion-category-defaults nil)
(setq read-process-output-max (* 1024 1024)))
(provide 'init-eglot)
|