summaryrefslogtreecommitdiffstats
path: root/lisp/init-eglot.el
blob: 91c2c3b92694e7e1807f16214192df6bc5845ee9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(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 p formats buffer
              ("C-c p" . eglot-format))
  :config
  ;; disable imenu integration as it's currently unsupported with gopls
  ;; https://github.com/joaotavora/eglot/pull/303
  (setq eglot-stay-out-of '("imenu")))

(provide 'init-eglot)