2015-01-09 06:08:07 +00:00
|
|
|
(defvar go-packages
|
|
|
|
'(
|
2015-01-10 04:09:16 +00:00
|
|
|
flycheck
|
2015-01-09 06:08:07 +00:00
|
|
|
go-mode
|
2015-01-12 04:22:23 +00:00
|
|
|
go-eldoc
|
2015-01-19 08:01:00 +00:00
|
|
|
go-autocomplete
|
|
|
|
company-go
|
2015-01-09 06:08:07 +00:00
|
|
|
)
|
|
|
|
"List of all packages to install and/or initialize. Built-in packages
|
|
|
|
which require an initialization must be listed explicitly in the list.")
|
|
|
|
|
2015-01-10 04:09:16 +00:00
|
|
|
(defun go/init-flycheck ()
|
|
|
|
(add-hook 'go-mode-hook 'flycheck-mode))
|
|
|
|
|
2015-01-09 06:08:07 +00:00
|
|
|
(defun go/init-go-mode()
|
|
|
|
(use-package go-mode
|
|
|
|
:defer t
|
2015-01-19 08:01:00 +00:00
|
|
|
:config
|
|
|
|
(add-hook 'before-save-hook 'gofmt-before-save)
|
|
|
|
(evil-leader/set-key-for-mode 'go-mode
|
2015-01-09 06:08:07 +00:00
|
|
|
"mdp" 'godoc-at-point
|
|
|
|
"mig" 'go-goto-imports
|
|
|
|
"mia" 'go-import-add
|
|
|
|
"mir" 'go-remove-unused-imports
|
|
|
|
"mpb" 'go-play-buffer
|
|
|
|
"mpr" 'go-play-region
|
|
|
|
"mpd" 'go-download-play
|
2015-01-21 03:32:13 +00:00
|
|
|
"mgg" 'godef-jump
|
2015-01-19 08:01:00 +00:00
|
|
|
)
|
2015-01-10 04:09:16 +00:00
|
|
|
))
|
2015-01-12 04:22:23 +00:00
|
|
|
|
|
|
|
(defun go/init-go-eldoc()
|
|
|
|
(add-hook 'go-mode-hook 'go-eldoc-setup))
|
2015-01-19 08:01:00 +00:00
|
|
|
|
|
|
|
(defun go/init-go-autocomplete()
|
|
|
|
(use-package go-autocomplete
|
|
|
|
:if (boundp 'ac-sources)
|
|
|
|
:defer t
|
|
|
|
:init (add-to-list 'ac-sources 'ac-source-go)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(defun go/init-company-go ()
|
|
|
|
(use-package company-go
|
|
|
|
:if (boundp 'company-backends)
|
|
|
|
:defer t
|
|
|
|
:init (add-to-list 'company-backends 'company-go)
|
|
|
|
)
|
|
|
|
)
|