本文介绍了在Vim中自动换行长的Git提交消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用Git,我的提交编辑器是Vim。我经常在记住换行的工作上做得不好,因此我得到了很长的行数(例如,请参阅) 。有没有办法使用 git config
或 .vimrc
魔术,我可以让Vim自动换行为72列?
Using Git, my editor for commits is Vim. I'm constantly doing a poor job of remembering to wrap lines and so I get long lines (see this answer for example). Is there a way using some git config
or .vimrc
magic that I can get Vim to automatically wrap lines at 72 columns?
推荐答案
将此添加到您的 .vimrc
:
au FileType gitcommit set tw=72
这篇关于在Vim中自动换行长的Git提交消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!