aboutsummaryrefslogtreecommitdiff
path: root/.emacs.local.d/modes/go-lang.el
diff options
context:
space:
mode:
authorRaúl Benencia <rul@kalgan.cc>2019-06-23 11:43:30 -0700
committerRaúl Benencia <rul@kalgan.cc>2019-06-23 13:32:01 -0700
commit284c8327c95bb0c71b111ebf95723a35a478295c (patch)
treefaea9db4b1bba00d73d33b2065ed102f88b76b2c /.emacs.local.d/modes/go-lang.el
Add emacs config
Diffstat (limited to '.emacs.local.d/modes/go-lang.el')
-rw-r--r--.emacs.local.d/modes/go-lang.el23
1 files changed, 23 insertions, 0 deletions
diff --git a/.emacs.local.d/modes/go-lang.el b/.emacs.local.d/modes/go-lang.el
new file mode 100644
index 0000000..5d43e16
--- /dev/null
+++ b/.emacs.local.d/modes/go-lang.el
@@ -0,0 +1,23 @@
+;; Debian packages: elpa-go-mode
+;; Elpa packages: go-eldoc
+
+(use-package go-mode
+ :ensure t
+ :init
+ (progn
+ (setq gofmt-command "goimports")
+ (add-hook 'before-save-hook 'gofmt-before-save)
+ (bind-key [remap find-tag] #'godef-jump))
+ :config
+ (add-hook 'go-mode-hook 'electric-pair-mode)
+ (add-hook 'go-mode-hook 'my-go-mode-hook))
+
+(use-package go-eldoc
+ :ensure t
+ :defer
+ :init
+ (add-hook 'go-mode-hook 'go-eldoc-setup))
+
+;; Define function to call when go-mode loads
+(defun my-go-mode-hook ()
+ (set 'compile-command "go build -v && go test -v && go vet"))
nihil fit ex nihilo