summary refs log tree commit diff
path: root/emacs.d/inits/90_lang-go.el
blob: b20b467b93c3dc9301df4e8f623601f7c089fe56 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(use-package go-eldoc
  :ensure t
  :defer t
  :init (add-hook 'go-mode-hook 'go-eldoc-setup))

(use-package company-go
  :ensure t
  :defer t)

(use-package go-mode
  :ensure t
  :defer t
  :config
  (progn
    (bind-key "C-c C-f" 'gofmt go-mode-map)
    (bind-key "C-c h" 'godoc go-mode-map)
    (bind-key "C-c C-g" 'go-goto-imports go-mode-map)
    (bind-key "C-c C-r" 'go-remove-unused-imports go-mode-map))
  :init
  (progn (add-hook 'go-mode-hook (lambda ()
                                   (go-eldoc-setup)
                                   (add-hook 'before-save-hook 'gofmt-before-save)
                                   (set (make-local-variable 'company-backends) '(company-go))))))