-
Notifications
You must be signed in to change notification settings - Fork 1
/
init-go.el
47 lines (43 loc) · 1.08 KB
/
init-go.el
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
;;; init-go.el --- Golang related config -*- lexical-binding: t; -*-
;;
;; Author: Kiran Shenoy
;; URL: https://github.com/kgs1992/.emacs.d/
;;
;;; Commentary:
;;
;; This package contains all of the golang related config.
;;
;;;
;;; Code:
(use-package go-mode
:ensure t
:defer t
:after (lsp-mode company)
:bind
(("C-c ." . lsp-find-definition)
("C-c ," . pop-global-mark))
:config
(lsp-register-custom-settings
'(("gopls.completeUnimported" t t)
("gopls.staticcheck" t t)
("gopls.experimentalTemplateSupport" t t)))
(setq lsp-go-codelenses nil)
:hook ((go-mode . lsp)
(before-save . lsp-format-buffer)
;; (before-save . lsp-organize-imports)
))
(use-package company-go
:ensure t
:defer t
:config
(setq company-go-show-annotation t)
:hook (go-mode . (lambda ()
(set (make-local-variable 'company-backends) '(company-go))
(company-mode 1))))
;; Local playground
(use-package go-playground
:ensure t
:defer t)
(message "Loaded init-go.el")
(provide 'init-go)
;;; init-go.el ends here