From 70e4c824e704dfc3060ed0576dc740351680f5ef Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 10 May 2020 14:20:10 -0700 Subject: emacs: stuff for go --- emacs.d/custom/fcuny-prog.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'emacs.d/custom') diff --git a/emacs.d/custom/fcuny-prog.el b/emacs.d/custom/fcuny-prog.el index 481995b..64ba181 100644 --- a/emacs.d/custom/fcuny-prog.el +++ b/emacs.d/custom/fcuny-prog.el @@ -1,5 +1,12 @@ (require 'fcuny-vars) +(use-package auto-fill + :hook (prog-mode . auto-fill-mode) + :custom + ;; this does not seem to work .. + (comment-fill-column 80) + (comment-auto-fill-only-comments t)) + (use-package company :ensure t :diminish company-mode @@ -96,20 +103,15 @@ :config (add-hook 'makefile-mode-hook (lambda () (setq-local tab-width 2)))) -(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 - :hook ((go-mode . fcuny/go-mode-setup) - (before-save . lsp-format-buffer) + :hook ((before-save . lsp-format-buffer) (before-save . lsp-organize-imports)) :config (when (memq window-system '(mac ns)) - (exec-path-from-shell-copy-env "GOPATH"))) + (exec-path-from-shell-copy-env "GOPATH")) + :custom + (tab-width 4)) (use-package gotest :ensure t -- cgit 1.4.1