From 5f2b301a8df5410962519d2b7e9a977b03e75977 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 12 Feb 2016 20:58:37 -0800 Subject: [emacs] Split the config into 'core' and 'modes'. Separate the modules that are 'core' (e.g.: related to editing, manipulating text, and so on) and the 'modes' (e.g.: related to syntax, langage support, etc). --- emacs.d/modes/lang-go.el | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 emacs.d/modes/lang-go.el (limited to 'emacs.d/modes/lang-go.el') diff --git a/emacs.d/modes/lang-go.el b/emacs.d/modes/lang-go.el new file mode 100644 index 0000000..8d81f2c --- /dev/null +++ b/emacs.d/modes/lang-go.el @@ -0,0 +1,25 @@ +(use-package go-mode + :ensure t + :defer t + :config + (progn + (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)) + :init + (progn (add-hook 'go-mode-hook (lambda () + (go-eldoc-setup) + (add-hook 'before-save-hook 'gofmt-before-save) + (set (make-local-variable 'company-backends) '(company-go)))))) + +(use-package go-eldoc + :ensure t + :defer t + :init (add-hook 'go-mode-hook 'go-eldoc-setup)) + +(use-package company-go + :ensure t + :defer t) + +(provide 'lang-go) -- cgit 1.4.1