Emacs: Add godoc bindings and indent godoc examples

master
Pierre Neidhardt 2016-06-06 20:52:19 +02:00
parent 298d752fff
commit 1344fc97c3
1 changed files with 10 additions and 2 deletions

View File

@ -20,13 +20,21 @@
(and looping (not (string= dir "/")))))
(if (string= dir "/") nil t)))
(add-hook-and-eval
(add-hook
'godoc-mode-hook
(lambda ()
(setq tab-width 8)))
(add-hook-and-eval
'go-mode-hook
(lambda ()
(setq gofmt-command "goimports")
(setq godoc-command "godoc -ex")
(setq godoc-and-godef-command "godoc -ex")
(add-hook 'before-save-hook #'gofmt-before-save nil t)
(local-set-key (kbd "C-c m") 'go-main)
(local-set-key (kbd "C-c d") 'godoc)
(local-set-key (kbd "C-c D") 'godoc)
(local-set-key (kbd "C-c d") 'godoc-at-point)
(local-set-key (kbd "M-.") #'godef-jump)
(local-set-key (kbd "C-<f10>") 'go-eval-buffer)
(local-set-key (kbd "<f9>")