From d36125c200937c0c3a141bcfa6ad752150f3d415 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 18 Nov 2015 21:05:59 -0800 Subject: [emacs] add company-mode for golang. --- emacs.d/inits/90_lang-go.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'emacs.d') diff --git a/emacs.d/inits/90_lang-go.el b/emacs.d/inits/90_lang-go.el index 8e6a565..94c44ef 100644 --- a/emacs.d/inits/90_lang-go.el +++ b/emacs.d/inits/90_lang-go.el @@ -3,6 +3,10 @@ :defer t :init (add-hook 'go-mode-hook 'go-eldoc-setup)) +(use-package company-go + :ensure t + :defer t) + (use-package go-mode :ensure t :defer t @@ -11,8 +15,8 @@ (bind-key "C-c C-f" 'gofmt go-mode-map) (bind-key "C-c h" 'godoc go-mode-map) (bind-key "C-c C-g" 'go-goto-imports go-mode-map) - (bind-key "C-c C-r" 'go-remove-unused-imports go-mode-map))) - -(use-package company-go - :ensure t - :defer t) + (bind-key "C-c C-r" 'go-remove-unused-imports go-mode-map)) + :init + (progn (add-hook 'go-mode-hook (lambda () + (go-eldoc-setup) + (set (make-local-variable 'company-backends) '(company-go)))))) -- cgit 1.4.1