feat(version-control/magic): use git-commit-ts-mode

Offers more advanced syntax highlighting for commit messages, with
support for conventional commit messages.
This commit is contained in:
2024-10-24 03:13:45 +01:00
parent 3edd8e647e
commit 983ccd3c27

View File

@@ -10,6 +10,15 @@
(require 'siren-display-line-numbers)
(require 'siren-whitespace)
(defun siren-git-commit-mode-setup ()
(setq tab-width 4
fill-column 72)
(siren-display-fill-column)
(siren-display-line-numbers)
(auto-fill-mode t)
(whitespace-mode t))
(use-package magit
:general
("C-x g" 'magit-status)
@@ -47,15 +56,6 @@
(defun siren-magit-mode-setup ())
(defun siren-git-commit-mode-setup ()
(setq tab-width 4
fill-column 72)
(siren-display-fill-column)
(siren-display-line-numbers)
(auto-fill-mode t)
(whitespace-mode t))
:config
(when (fboundp 'system-move-file-to-trash)
(setq magit-delete-by-moving-to-trash t)))
@@ -97,5 +97,19 @@
:hook
(git-commit-mode . conventional-commit-setup))
(use-package git-commit-ts-mode
:mode "\\COMMIT_EDITMSG\\'"
:hook
(git-ts-commit-setup . siren-git-commit-mode-setup)
:custom
(git-commit-major-mode 'git-commit-ts-mode)
:init
(siren-treesit-manual-prepare
'git-commit-ts-mode
'(gitcommit . ("https://github.com/gbprod/tree-sitter-gitcommit"))))
(provide 'siren-magit)
;;; siren-magit.el ends here