aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/rul-init.d/go-lang.el
diff options
context:
space:
mode:
authorRaúl Benencia <id@rbenencia.name>2023-07-20 07:53:35 -0700
committerRaúl Benencia <id@rbenencia.name>2023-07-22 10:45:18 -0700
commit5860445da55ac3abc3935c6ffd5e9bb4539225c9 (patch)
tree2de3124b4c0577245a0b7e1dec30732af7fcc191 /.emacs.d/rul-init.d/go-lang.el
parentfd0754be08f4b2f9ef58625c17544a238afefade (diff)
emacs: move everything to ~/.emacs.d
Diffstat (limited to '.emacs.d/rul-init.d/go-lang.el')
-rw-r--r--.emacs.d/rul-init.d/go-lang.el23
1 files changed, 23 insertions, 0 deletions
diff --git a/.emacs.d/rul-init.d/go-lang.el b/.emacs.d/rul-init.d/go-lang.el
new file mode 100644
index 0000000..8ec678b
--- /dev/null
+++ b/.emacs.d/rul-init.d/go-lang.el
@@ -0,0 +1,23 @@
+;; Debian packages: elpa-go-mode
+;; Elpa packages: go-eldoc
+
+(use-package go-mode
+ :ensure t
+ :init
+ (progn
+ (bind-key [remap find-tag] #'godef-jump))
+ :config
+ (add-hook 'go-mode-hook #'yas-minor-mode)
+ (add-hook 'go-mode-hook 'electric-pair-mode)
+ (add-hook 'go-mode-hook 'my-go-mode-hook)
+ (add-hook 'before-save-hook 'gofmt-before-save)
+)
+
+(use-package go-eldoc
+ :ensure t
+ :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