Improve go-mode support
This commit is contained in:
parent
de5e498a77
commit
b580ffdb8a
2 changed files with 24 additions and 2 deletions
4
Cask
4
Cask
|
@ -132,6 +132,9 @@
|
||||||
;; C#
|
;; C#
|
||||||
(depends-on "csharp-mode")
|
(depends-on "csharp-mode")
|
||||||
(depends-on "omnisharp")
|
(depends-on "omnisharp")
|
||||||
|
;; Golang
|
||||||
|
(depends-on "go-mode")
|
||||||
|
(depends-on "go-eldoc")
|
||||||
;; Java
|
;; Java
|
||||||
(depends-on "emacs-eclim")
|
(depends-on "emacs-eclim")
|
||||||
(depends-on "groovy-mode")
|
(depends-on "groovy-mode")
|
||||||
|
@ -144,7 +147,6 @@
|
||||||
;;(depends-on "org-plus-contrib")
|
;;(depends-on "org-plus-contrib")
|
||||||
;;(depends-on "org-opml" :git "https://github.com/edavis/org-opml")
|
;;(depends-on "org-opml" :git "https://github.com/edavis/org-opml")
|
||||||
;; Other
|
;; Other
|
||||||
(depends-on "go-mode")
|
|
||||||
(depends-on "swift-mode")
|
(depends-on "swift-mode")
|
||||||
(depends-on "vimrc-mode")
|
(depends-on "vimrc-mode")
|
||||||
(depends-on "crystal-mode" :git "https://github.com/jpellerin/emacs-crystal-mode/")
|
(depends-on "crystal-mode" :git "https://github.com/jpellerin/emacs-crystal-mode/")
|
||||||
|
|
|
@ -3,8 +3,28 @@
|
||||||
(use-package go-mode
|
(use-package go-mode
|
||||||
:mode "\\.go$"
|
:mode "\\.go$"
|
||||||
:interpreter "go"
|
:interpreter "go"
|
||||||
|
:init (add-hook! go-mode 'emr-initialize)
|
||||||
:config
|
: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
|
(use-package company-go
|
||||||
:config
|
:config
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue