golang: support editing templ files
Alan Pearce alan@alanpearce.eu
Sun, 16 Jun 2024 17:53:50 +0200
2 files changed, 10 insertions(+), 1 deletions(-)
M user/emacs/init.el → user/emacs/init.el
@@ -789,6 +789,12 @@ ;;;; golang (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 @@ (use-package editorconfig :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"))
M user/settings/development/golang.nix → 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