aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/lisp/init-eglot.el
blob: 58b4d02986a2edf1e2bef1ff6fb7679c0815dc98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(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 "K") 'eldoc-doc-buffer
    (kbd "gi") 'eglot-find-implementation
    (kbd "C-t") 'xref-pop-marker-stack))

(provide 'init-eglot)