From: Ramakrishnan Muthukrishnan Date: Sun, 22 Nov 2015 01:26:28 +0000 (+0530) Subject: go-mode: hooks to call goimport/fmt X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/biz/statistics?a=commitdiff_plain;h=c3dce370f60719d9aed25ab5aaafc17d36d0263a;p=.emacs.d.git go-mode: hooks to call goimport/fmt --- diff --git a/init.el b/init.el index 9442590..983217e 100644 --- a/init.el +++ b/init.el @@ -225,3 +225,20 @@ ;; auto complete (ac-config-default) (ac-linum-workaround) + +;; highlight todo +(add-hook 'prog-mode-hook 'highlight-todos) + +;; Ledger +(setq ledger-binary-path "~/.cabal/bin/hledger") + +;; golang +(setq exec-path (cons "/usr/local/go/bin" exec-path)) +(add-to-list 'exec-path (concat (getenv "GOPATH") "/bin")) + +(defun go-mode-setup () + (go-eldoc-setup) + (setq gofmt-command "goimports") + (add-hook 'before-save-hook 'gofmt-before-save)) + +(add-hook 'go-mode-hook 'go-mode-setup)