mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user