all repos — nixfiles @ f128790d36147be1db3834b12f0ece9a766c8e06

System and user configuration, managed by nix and home-manager

emacs: improve golang setup
Alan Pearce alan@alanpearce.eu
Thu, 18 Apr 2024 09:16:00 +0200
commit

f128790d36147be1db3834b12f0ece9a766c8e06

parent

743e0bfdc880a036d46f6f8e147be480cdfe8266

1 files changed, 4 insertions(+), 3 deletions(-)

jump to
M user/emacs/init.eluser/emacs/init.el
@@ -740,9 +740,10 @@ (toml-mode . toml-ts-mode)                                (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