From 984f23312ba1298ef0c90169e74351da65f58585 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 4 Sep 2015 00:05:10 -0700 Subject: [PATCH] company-go, binding for godef-jump --- dotfiles/emacs.d/init.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dotfiles/emacs.d/init.el b/dotfiles/emacs.d/init.el index 02eedf72..e641b96b 100644 --- a/dotfiles/emacs.d/init.el +++ b/dotfiles/emacs.d/init.el @@ -1996,7 +1996,16 @@ window is active in the perspective." ;; ============================================================================= (use-package go-mode - :mode (("\\.go\\'" . go-mode))) + :mode (("\\.go\\'" . go-mode)) + :config + (progn + (use-package company-go) + (defun imalison:go-mode-hook () + (local-set-key (kbd "M-.") 'godef-jump) + (local-set-key (kbd "M-,") 'pop-tag-mark) + (set (make-local-variable 'company-backends) '(company-go))) + (add-hook 'go-mode-hook 'imalison:go-mode-hook) + (add-hook 'before-save-hook 'gofmt-before-save))) (use-package rust-mode :mode (("\\.rs\\'" . rust-mode)))