summaryrefslogtreecommitdiff
path: root/emacs/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/init.el')
-rw-r--r--emacs/init.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 9c5f5c7..741c6f8 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -145,8 +145,11 @@
(my/with-add-hook 'go-mode-hook
(setq tab-width 2)
- (add-hook 'before-save-hook #'gofmt-before-save nil :local)
- (flycheck-mode))
+
+ (when (executable-find "gopls")
+ (eglot-ensure)
+ (add-hook 'before-save-hook #'my/eglot-organize-imports nil :local)
+ (add-hook 'before-save-hook #'eglot-format-buffer nil :local)))
;; Flycheck