summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-06-16 17:53:50 +0200
committerAlan Pearce2024-06-16 17:53:50 +0200
commit8bb999782312ec263c0640dee33a87d97c448351 (patch)
tree17af5a5b042b5e22bc5fcf7db6ba2744cdd77151
parent21bf21d01da7d78994d4339804374c0a62ea44fd (diff)
downloadnixfiles-8bb999782312ec263c0640dee33a87d97c448351.tar.lz
nixfiles-8bb999782312ec263c0640dee33a87d97c448351.tar.zst
nixfiles-8bb999782312ec263c0640dee33a87d97c448351.zip
golang: support editing templ files
-rw-r--r--user/emacs/init.el10
-rw-r--r--user/settings/development/golang.nix1
2 files changed, 10 insertions, 1 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 27c10ba5..dae7cabd 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -789,6 +789,12 @@ _C-k_: prev  _u_pper              _=_: upper/lower       _s_mart resolve
 (with-eval-after-load 'project
   (add-to-list 'project-vc-extra-root-markers "go.mod"))
 
+(setq-default go-ts-mode-indent-offset 2)
+(use-package templ-ts-mode
+  :defer t
+  :config (progn
+            (setq-default go-ts-mode-indent-offset 2)))
+
 ;;;; nim
 (use-package nim-mode
   :defer t
@@ -1048,7 +1054,9 @@ _C-k_: prev  _u_pper              _=_: upper/lower       _s_mart resolve
   :defer 2
   :config (progn
             (editorconfig-mode +1)
-            (setq editorconfig-lisp-use-default-indent t)))
+            (setq editorconfig-lisp-use-default-indent t)
+            (setf (alist-get 'templ-ts-mode editorconfig-indentation-alist)
+                  'go-ts-mode-indent-offset)))
 
 (setq-default ispell-dictionary "en_GB-ise-w_accents")
 (setq ispell-extra-args '("--sug-mode=ultra" "--camel-case"))
diff --git a/user/settings/development/golang.nix b/user/settings/development/golang.nix
index 6c2916be..a9293a31 100644
--- a/user/settings/development/golang.nix
+++ b/user/settings/development/golang.nix
@@ -15,6 +15,7 @@
   programs.emacs.extraPackages = epkgs: (with epkgs; [
     go-eldoc
     go-tag
+    templ-ts-mode
   ]);
   programs.neovim.plugins = with pkgs.vimPlugins; [
     coc-go