我目前使用的Magit的最新版本(M-x magit-version说magit-20131222.850)在提交消息上强制执行了某些恼人的属性,并对它们进行了奇怪的着色。具体来说,它会自动打断一定长度的线条,并将第一个绿色的线条涂上颜色.
有什么方法可以禁用它,并使它像旧的哑巴提交消息窗口一样吗?我在M-x customize-mode中没有看到任何相关的东西,所以我假设解决方案将涉及到一些elisp。
发布于 2014-05-02 03:54:19
将以下内容添加到.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)至于字体颜色,我建议您将光标移动到感兴趣的文本,执行M-x customize-face,并使用对话框。
但是,您可以在原始的elisp中这样做:
(set-face-foreground 'git-commit-summary-face "white")(通常,您可以将光标移动到感兴趣的文本,并执行M-x describe-face来了解要修改的外观。)
发布于 2019-01-30 10:40:55
在最新的magit版本(我使用的是Magit 20190122.503)中,您需要使用git-commit-setup-hook来完成这项工作:
(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)https://stackoverflow.com/questions/23417579
复制相似问题