The recent-ish version of Magit ( Mx magit-version
says magit-20131222.850
) I'm currently using enforces certain annoying properties on commit messages, and colors them oddly. Specifically, it auto-breaks lines at a certain length and colors the first one green.
Is there any way to disable this, and make it act like the old dumb commit message window? I don't see anything relevant-looking in Mx customize-mode
, so I assume the solution will involve some elisp
.
Add the following to your .emacs
:
(add-hook 'git-commit-mode-hook
'(lambda () (auto-fill-mode 0))
;; append rather than prepend to git-commit-mode-hook, since the
;; thing that turns auto-fill-mode on in the first place is itself
;; another hook on git-commit-mode.
t)
As for the font color, I suggest you move the cursor to the text of interest, do Mx customize-face
, and use the dialog.
However, you could do something like this in raw elisp:
(set-face-foreground 'git-commit-summary-face "white")
(In general you can move the cursor to the text of interest and do Mx describe-face
to learn what face it is you want to modify.)
In the latest magit versions (I'm using Magit 20190122.503) you need to use git-commit-setup-hook
to make this work:
(add-hook 'git-commit-setup-hook 'turn-off-auto-fill
;; append to end of git-commit-setup-hook to ensure our hook trumps others.
t)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.