diff options
-rw-r--r-- | emacs.d/init.el | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/emacs.d/init.el b/emacs.d/init.el index d44a982..0408dd6 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -230,26 +230,32 @@ :ensure t :config - (when (memq window-system '(mac ns x)) - (dolist (var '("GOPATH")) - (unless (getenv var) - (exec-path-from-shell-copy-env var)))) - (use-package go-eldoc - :ensure t - :config - (add-hook 'go-mode-hook 'go-eldoc-setup)) - (use-package gotest - :ensure t) - (add-hook 'before-save-hook 'gofmt-before-save) - (add-hook 'go-mode-hook (lambda () (setq-local tab-width 4)))) - -(use-package hl-line - ;; highlight current line - :defer t - :init (progn - (add-hook 'text-mode-hook 'hl-line-mode) - (add-hook 'prog-mode-hook 'hl-line-mode))) + (when (memq window-system '(mac ns x)) + (dolist (var '("GOPATH")) + (unless (getenv var) + (exec-path-from-shell-copy-env var)))) + + (use-package go-eldoc + :ensure t + :config + (add-hook 'go-mode-hook 'go-eldoc-setup)) + + (use-package gotest + :ensure t) + + (use-package go-guru + :ensure t) + + (defun fc/my-go-hook () + (set (make-local-variable 'compile-command) + "go build -v && go test -v && go vet") + (setq-local tab-width 4) + (make-variable-buffer-local 'whitespace-style) + (setq whitespace-style (delq 'tabs whitespace-style))) + + (add-hook 'before-save-hook 'gofmt-before-save) + (add-hook 'go-mode-hook 'fc/my-go-hook))) (use-package ibuffer ;; configuration for ibuffer |