Skip to content

Commit

Permalink
tweak(git-commit): simplify the config
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Jul 19, 2023
1 parent d566710 commit 2445798
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions modules/me-vc.el
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,11 @@
(use-package git-commit
:after magit
:demand t
:hook (git-commit-mode . +git-gommit--set-fill-column-h)
:hook (git-commit-setup . +git-commit--enter-evil-insert-state-maybe-h)
:custom
(git-commit-summary-max-length 50)
(git-commit-summary-max-length 72) ;; defaults to Github's max commit message length
(git-commit-style-convention-checks '(overlong-summary-line non-empty-second-line))
:config
(defun +git-gommit--set-fill-column-h ()
(setq-local fill-column 72))

;; Enter evil-insert-state for new commits (hooked to `git-commit-setup-hook')
(defun +git-commit--enter-evil-insert-state-maybe-h ()
(when (and (bound-and-true-p evil-mode)
(not (evil-emacs-state-p))
(bobp)
(eolp))
(evil-insert-state)))

(evil-set-initial-state 'git-commit-mode 'insert)
(global-git-commit-mode 1))

(use-package git-modes
Expand Down

0 comments on commit 2445798

Please sign in to comment.