diff options
Diffstat (limited to '')
-rw-r--r-- | emacs.d/custom/fcuny-go.el | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/emacs.d/custom/fcuny-go.el b/emacs.d/custom/fcuny-go.el index 032f794..d925cf6 100644 --- a/emacs.d/custom/fcuny-go.el +++ b/emacs.d/custom/fcuny-go.el @@ -1,23 +1,16 @@ +(defun fcuny/go-mode-setup () + (setq tab-width 4) + (setq comment-auto-fill-only-comments t) + (setq fill-column 80) + (auto-fill-mode 1)) + (use-package go-mode :ensure t - :after (exec-path-from-shell flycheck flyspell company company-go hydra) + :after (exec-path-from-shell flycheck flyspell company hydra) :hook ((go-mode . fcuny/go-mode-setup) - (go-mode . company-mode)) - :custom - (godoc-use-completing-read t) - (gofmt-command "goimports") - - ;; see https://github.com/dominikh/go-mode.el/issues/262 - (godoc-at-point-function 'godoc-gogetdoc) - - :init - (defun fcuny/go-mode-setup () - (setq tab-width 4) - (setq comment-auto-fill-only-comments t) - (setq fill-column 80) - (auto-fill-mode 1) - (add-hook 'before-save-hook 'gofmt-before-save)) - + (go-mode . lsp-deferred) + (before-save . lsp-format-buffer) + (before-save . lsp-organize-imports)) :config (when (memq window-system '(mac ns)) (exec-path-from-shell-copy-env "GOPATH"))) |