2015-06-15 09:06:10 +02:00
|
|
|
;;; module-go.el
|
|
|
|
|
|
|
|
(use-package go-mode
|
|
|
|
:mode "\\.go$"
|
|
|
|
:interpreter "go"
|
2015-09-25 23:14:48 -04:00
|
|
|
:init (add-hook! go-mode 'emr-initialize)
|
2015-06-15 09:06:10 +02:00
|
|
|
:config
|
2015-09-25 23:14:48 -04:00
|
|
|
(bind! :map go-mode-map
|
|
|
|
:n "gd" 'godef-jump
|
|
|
|
:n "gD" 'godef-describe)
|
|
|
|
|
|
|
|
(mapc (lambda (x)
|
|
|
|
(let ((command-name (car x))
|
|
|
|
(title (cadr x))
|
|
|
|
(region-p (caddr x))
|
|
|
|
predicate)
|
|
|
|
(setq predicate (cond ((eq region-p 'both) nil)
|
|
|
|
(t (if region-p
|
|
|
|
(lambda () (use-region-p))
|
|
|
|
(lambda () (not (use-region-p)))))))
|
|
|
|
(emr-declare-command (intern (symbol-name command-name))
|
|
|
|
:title title :modes 'go-mode :predicate predicate)))
|
|
|
|
'((go-remove-unused-imports "Remove unushed imports" nil)
|
|
|
|
(gofmt "Format code" nil)))
|
|
|
|
|
|
|
|
(use-package go-eldoc
|
|
|
|
:config (add-hook! go-mode 'go-eldoc-setup))
|
2015-06-15 09:06:10 +02:00
|
|
|
|
|
|
|
(use-package company-go
|
|
|
|
:config
|
|
|
|
(add-company-backend! go-mode (go yasnippet))))
|
|
|
|
|
|
|
|
(provide 'module-go)
|
|
|
|
;;; module-go.el ends here
|