Commit 5266b54ec92e
Changed files (1)
lisp
lisp/vde-go.el
@@ -2,13 +2,31 @@
:ensure t
:mode "\\.go$"
:interpreter "go"
+ :bind (:map go-mode-map
+ ("C-," . 'hydra-go/body))
:pin melpa
+ :init
+ (defhydra hydra-go (:hint nil :color teal)
+ "
+ ^Command^ ^Imports^ ^Doc^
+ ^-------^ ^-------^ ^---^
+ _r_: run _ig_: goto _d_: doc at point
+ [_g_]: guru _ia_: add
+ ^ ^ _ir_: remove
+ "
+ ("g" 'hydra-go-guru/body :color blue)
+ ("r" go-run-main)
+ ("d" godoc-at-point)
+ ("ig" go-goto-imports )
+ ("ia" go-import-add)
+ ("ir" go-remove-unused-imports)
+ ("q" nil "quit" :color blue))
:config
(setq gofmt-command "goimports")
(if (not (executable-find "goimports"))
(warn "go-mode: couldn't find goimports; no code formatting/fixed imports on save")
- (add-hook 'go-mode-hook (add-hook 'before-save-hook #'gofmt-before-save nil t))))
+ (add-hook 'before-save-hook 'gofmt-before-save)))
(use-package go-guru
:ensure t