From c3dce370f60719d9aed25ab5aaafc17d36d0263a Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan Date: Sun, 22 Nov 2015 06:56:28 +0530 Subject: [PATCH] go-mode: hooks to call goimport/fmt --- init.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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) -- 2.37.2