From b9ca6f9e1e66fc911014e51074d5aa3b8b6614e7 Mon Sep 17 00:00:00 2001 From: jowj Date: Mon, 14 Oct 2019 19:01:25 -0500 Subject: [PATCH] Configure some changes for better go use - specifically, use eglot / gopls --- applicationConfiguration/.emacs/init.el | 2 +- applicationConfiguration/.emacs/jlj-golang.el | 46 ++----------------- 2 files changed, 5 insertions(+), 43 deletions(-) diff --git a/applicationConfiguration/.emacs/init.el b/applicationConfiguration/.emacs/init.el index ee522b1..9245de8 100644 --- a/applicationConfiguration/.emacs/init.el +++ b/applicationConfiguration/.emacs/init.el @@ -36,7 +36,7 @@ '(global-hl-line-mode t) '(package-selected-packages (quote - (jedi znc yaml-mode which-key use-package twittering-mode try smex racer python-mode pylint py-autopep8 powershell pdf-tools outline-magic org2blog multiple-cursors magit helm flycheck-rust eyebrowse exec-path-from-shell emojify elpy ein doom-themes dockerfile-mode docker csharp-mode ansible anaconda-mode ace-window))) + (lsp-ui lsp-mode jedi znc yaml-mode which-key use-package twittering-mode try smex racer python-mode pylint py-autopep8 powershell pdf-tools outline-magic org2blog multiple-cursors magit helm flycheck-rust eyebrowse exec-path-from-shell emojify elpy ein doom-themes dockerfile-mode docker csharp-mode ansible anaconda-mode ace-window))) '(znc-servers (\` (("bouncer.awful.club" 5000 t diff --git a/applicationConfiguration/.emacs/jlj-golang.el b/applicationConfiguration/.emacs/jlj-golang.el index 596bac8..eb54123 100644 --- a/applicationConfiguration/.emacs/jlj-golang.el +++ b/applicationConfiguration/.emacs/jlj-golang.el @@ -1,44 +1,6 @@ -;; this is an intermediary golang config. my goals are to: -;; - have gofmt run on save -;; - have good syntax highlighting -;; - compile, test, run gocode through emacs: - -(use-package go-eldoc - :ensure) - -(use-package gotest - :ensure) - -(use-package company-go - :ensure) - -(use-package go-guru - :ensure) - -(use-package go-mode - :init +(use-package eglot :ensure t :config - (add-hook 'before-save-hook #'gofmt-before-save) - - ;; stolen from luipan.pl/dotemacs/ - (defun jlj-go-mode-hook () - (go-eldoc-setup) - (set (make-local-variable 'company-backends) '(company-go)) - (company-mode) - ;; Customize compile command to run go build - - (let ((goimports (executable-find "goimports"))) - (when goimports - (setq gofmt-command goimports))) - - (smartparens-mode 1) - (flycheck-mode 1) - (setq imenu-generic-expression - '(("type" "^type *\\([^ \t\n\r\f]*\\)" 1) - ("func" "^func *\\(.*\\) {" 1)))) - - (setq compile-command "echo Building... && go build -v && go test -v && go vet") - (add-hook 'go-mode-hook 'jlj-go-mode-hook)) - -(with-eval-after-load "go-mode" (define-key go-mode-map (kbd "C-c C-c") 'compile)) + (add-hook 'go-mode-hook 'eglot-ensure) + (local-set-key "\C-x\C-m" 'compile) + (setq compile-command "go test -v && go vet && golint"))