summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-04-18 09:16:00 +0200
committerAlan Pearce2024-04-18 09:16:14 +0200
commitf128790d36147be1db3834b12f0ece9a766c8e06 (patch)
tree097e58c3f8e89e6bc949e01fbfdd2b512e5d1daa
parent743e0bfdc880a036d46f6f8e147be480cdfe8266 (diff)
downloadnixfiles-f128790d36147be1db3834b12f0ece9a766c8e06.tar.lz
nixfiles-f128790d36147be1db3834b12f0ece9a766c8e06.tar.zst
nixfiles-f128790d36147be1db3834b12f0ece9a766c8e06.zip
emacs: improve golang setup
-rw-r--r--user/emacs/init.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 1722d392..e7d59f97 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -740,9 +740,10 @@ _C-k_: prev  _u_pper              _=_: upper/lower       _s_mart resolve
                                (yaml-mode . yaml-ts-mode)))
 
 ;;;; golang
-(use-package go-mode
-  :defer t)
-(add-to-list 'major-mode-remap-alist '(go-mode . go-ts-mode))
+(with-eval-after-load 'go-ts-mode
+  (setq go-ts-mode-indent-offset tab-width))
+(with-eval-after-load 'project
+  (add-to-list 'project-vc-extra-root-markers "go.mod"))
 
 ;;;; nim
 (use-package nim-mode