diff options
Diffstat (limited to 'emacs.d/custom/fcuny-go.el')
-rw-r--r-- | emacs.d/custom/fcuny-go.el | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/emacs.d/custom/fcuny-go.el b/emacs.d/custom/fcuny-go.el index 75bd042..cd0c05f 100644 --- a/emacs.d/custom/fcuny-go.el +++ b/emacs.d/custom/fcuny-go.el @@ -1,13 +1,14 @@ (use-package go-mode :ensure t - :after (exec-path-from-shell flycheck flyspell) - :hook (go-mode . fcuny/go-mode-setup) - :bind (("M-?" . godoc-at-point) - ("M-." . godef-jump) - ;; Jump back after godef-jump - ("M-*" . pop-tag-mark)) + :after (exec-path-from-shell flycheck flyspell company company-go hydra) + :hook ((go-mode . fcuny/go-mode-setup) + (go-mode . company-mode)) + :bind (("C-c a ?" . godoc-at-point) + ("C-c a ." . godef-jump) + ("C-c a a" . go-import-add)) :custom (godoc-use-completing-read t) + (gofmt-command "goimports") ;; see https://github.com/dominikh/go-mode.el/issues/262 (godoc-at-point-function 'godoc-gogetdoc) :init @@ -16,7 +17,16 @@ (add-hook 'before-save-hook 'gofmt-before-save)) :config (when (memq window-system '(mac ns)) - (exec-path-from-shell-copy-env "GOPATH"))) + (exec-path-from-shell-copy-env "GOPATH")) + (defhydra go-hydra (:color teal :columns 3) + "Go" + ("r" go-guru-referrers "referrers") + ("i" go-guru-implements "implements") + ("d" go-guru-definition "definition") + ("D" go-guru-describe "describe") + ("t" go-test-current-test "run this test") + ("f" go-test-current-file "run tests for this file")) + (define-key go-mode-map (kbd "C-c g") 'go-hydra/body)) (use-package go-guru :ensure t @@ -40,4 +50,8 @@ :ensure t :after go-mode) +(use-package gotest + :ensure t + :after go-mode) + (provide 'fcuny-go) |