summaryrefslogtreecommitdiffstats
path: root/lisp/init-eglot.el
blob: 1b407c7bcb674dca94dfb8c4a90d06fc9d980c2c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(use-package eglot
  :hook
  ;; enable eglot in go-mode
  ;; requires gopls: env GO111MODULE=on go get golang.org/x/tools/gopls@latest
  ((go-mode . eglot-ensure)
   ;; format on save
   (before-save . eglot-format))

  :bind (:map eglot-mode-map
              ;; C-c r renames identifier
              ("C-c r" . eglot-rename)
              ;; C-c f formats buffer
              ("C-c f" . eglot-format))

  :config
  ;; disable symbol highlighting and documentation on hover
  (setq eglot-ignored-server-capabilites '(:documentHighlightProvider
                                           :hoverProvider)))

(provide 'init-eglot)