From b5dd649f07998b289e90862d74d6fb8e046345a8 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 13 Jan 2020 14:15:31 -0800 Subject: emacs/prog: more cleanup for lsp/go. A few changes to the configuration related to go, mostly to drop some code that is not needed anymore. Add a few more bindings for LSP. Add `company-posframe`, which is a nicer UI for company. --- emacs.d/custom/fcuny-go.el | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'emacs.d/custom/fcuny-go.el') 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"))) -- cgit 1.4.1