summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck.cuny@gmail.com>2018-07-03 08:25:51 -0700
committerFranck Cuny <franck.cuny@gmail.com>2018-07-03 08:25:51 -0700
commitf0540b8c6006cec616d77449209d28b91cfb41bf (patch)
treeab89c680d90fb23984b9d8ace1dbfb37223e49a4
parent[emacs] Remove configuration for rust (diff)
downloademacs.d-f0540b8c6006cec616d77449209d28b91cfb41bf.tar.gz
[emacs] A number of fixes for go-mode
Set correctly go-eldoc, set the width of tab to 2, define a proper
hook, etc.
-rw-r--r--emacs.d/config/fcuny-go.el51
1 files changed, 30 insertions, 21 deletions
diff --git a/emacs.d/config/fcuny-go.el b/emacs.d/config/fcuny-go.el
index 14acbe4..dc0cd8b 100644
--- a/emacs.d/config/fcuny-go.el
+++ b/emacs.d/config/fcuny-go.el
@@ -3,33 +3,42 @@
 
 (use-package go-mode
   :ensure t
-  :init
-  (progn
-    (defun fcuny-go-set-tab-width ()
-      (setq-local tab-width 2))
-    (add-hook 'go-mode-hook 'fcuny-go-set-tab-width))
-
+  :after (company flycheck)
+  :preface
+  (defun fcuny/go-mode-setup ()
+    (add-hook 'go-mode-hook 'flycheck-mode)
+    (setq-default)
+    (setq tab-width 2))
   :config
-  (use-package go-eldoc
-    :config
-    (add-hook 'go-mode-hook 'go-eldoc-setup))
+  (add-hook 'go-mode-hook #'fcuny/go-mode-setup))
+
+(use-package go-eldoc
+  :after go-mode
+  :ensure t
+  :hook (go-mode . go-eldoc-setup))
 
-  (use-package gotest :ensure t)
+(use-package gotest
+  :ensure t)
 
-  (use-package go-guru :ensure t)
+(use-package go-guru
+  :ensure t)
 
-  (use-package go-imports :ensure t)
+(use-package go-imports
+  :ensure t)
 
-  (use-package golint :ensure t)
+(use-package golint
+  :ensure t)
 
-  (use-package go-projectile :ensure t)
+(use-package go-projectile
+  :ensure t)
 
-  (use-package company-go
-    :ensure t
-    :init
-    (progn
-      (setq company-go-show-annotation t))
-    :config
-    (add-hook 'go-mode-hook (lambda() (add-to-list 'company-backends 'company-go)))))
+(use-package company-go
+  :ensure t
+  :after (company go-mode)
+  :custom
+  (company-go-show-annotation t)
+  :config
+  (add-hook 'go-mode-hook 'company-mode)
+  (add-to-list 'company-backends 'company-go))
 
 (provide 'fcuny-go)