Improve go-mode support
This commit is contained in:
parent
de5e498a77
commit
b580ffdb8a
2 changed files with 24 additions and 2 deletions
|
@ -3,8 +3,28 @@
|
|||
(use-package go-mode
|
||||
:mode "\\.go$"
|
||||
:interpreter "go"
|
||||
:init (add-hook! go-mode 'emr-initialize)
|
||||
:config
|
||||
(bind! :map go-mode-map :n "gd" 'godef-jump)
|
||||
(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))
|
||||
|
||||
(use-package company-go
|
||||
:config
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue