From 349127958597117b63eee6762c65d6ee5a61a923 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Tue, 17 Jun 2014 17:55:42 -0700 Subject: [PATCH] Add key bindings for godoc C-h G -> godoc: can be used in any mode C-h f -> godoc-at-point: go-mode only --- modules/prelude-go.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/prelude-go.el b/modules/prelude-go.el index 08a0450..36be9e3 100644 --- a/modules/prelude-go.el +++ b/modules/prelude-go.el @@ -42,15 +42,18 @@ ;; Ignore go test -c output files (add-to-list 'completion-ignored-extensions ".test") +(define-key 'help-command (kbd "G") 'godoc) + (eval-after-load 'go-mode '(progn (defun prelude-go-mode-defaults () - ;; Default key bindings for gotest.el + ;; Add to default go-mode key bindings (let ((map go-mode-map)) (define-key map (kbd "C-c a") 'go-test-current-project) ;; current package, really (define-key map (kbd "C-c m") 'go-test-current-file) (define-key map (kbd "C-c .") 'go-test-current-test) - (define-key map (kbd "C-c b") 'go-run)) + (define-key map (kbd "C-c b") 'go-run) + (define-key map (kbd "C-h f") 'godoc-at-point)) ;; Prefer goimports to gofmt if installed (let ((goimports (executable-find "goimports")))