feat(emacs): nix-ts-mode

This commit is contained in:
2025-12-20 13:59:27 -07:00
parent 1b327727e9
commit fd06ba49bb
2 changed files with 18 additions and 1 deletions
@@ -182,4 +182,15 @@ form."
;; (user-error (concat "Ignoring a call to `lsp-install-server'"
;; " — tell the caller to use Nix!")))
(defun syd-remap-mode-to-ts (mode)
"Given a symbol MODE of form *-mode, remap *-mode to *-ts-mode via
`major-mode-remap-alist'."
(let ((s (symbol-name mode)))
(if (string-match (rx bol (group (* any)) "-mode" eol)
s)
(add-to-list
'major-mode-remap-alist
(cons mode (intern (concat (match-string 1 s) "-ts-mode"))))
(error "Symbol `%c' is not a mode." mode))))
(provide 'syd/prelude)