diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2020-10-24 14:42:03 +0100 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2020-10-24 14:42:03 +0100 |
| commit | a173e951cd32aa3696c0e62d7fd9112a6bc390f8 (patch) | |
| tree | 6f4ff4d8224b4f35407f40bef31efda9c46c90aa | |
| parent | b4ccb0890e65833a4f24c06d04558c17e7a6bc35 (diff) | |
emacs: Configure go-mode with use-package
| -rw-r--r-- | emacs/init.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/emacs/init.el b/emacs/init.el index 26db10c..c0a2d7f 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -77,6 +77,15 @@ (use-package diminish :ensure t) +(use-package go-mode + :init + (setq gofmt-command "goimports") + (add-hook 'go-mode-hook + (lambda () + (setq tab-width 2) + (add-hook 'before-save-hook 'gofmt-before-save nil t))) + :ensure t) + (use-package google-c-style :hook (c++-mode . google-set-c-style) :ensure t) @@ -116,11 +125,6 @@ (balance-windows))) (add-hook 'before-save-hook 'delete-trailing-whitespace) -(add-hook 'go-mode-hook - (lambda () - (setq-local gofmt-command "goimports") - (setq-local tab-width 2) - (add-hook 'before-save-hook 'gofmt-before-save nil t))) (add-hook 'ibuffer-mode-hook (lambda () (ibuffer-switch-to-saved-filter-groups "default"))) (add-hook 'server-switch-hook |
