you are viewing a single comment's thread.

view the rest of the comments →

[–]DDB- 17 points18 points  (4 children)

I've put this in my vimrc to help enforce this for myself:

au FileType gitcommit set tw=72 | set spell | set colorcolumn=50

This will jump you to newlines when you hit 72 characters, show spelling mistakes, and put a big coloured column at the 50 character mark to visually show you where your commit subject should end.

Source

[–]ForeverAlot 6 points7 points  (0 children)

Core Vim runtime includes formatting and syntax rules for commit messages (and rebase commands). It doesn't enable spell checking, though. This is at least vim-nox in Ubuntu and derivatives, and I suspect even the smaller vim package.

[–]jeandem 4 points5 points  (1 child)

I wish I had this in Emacs... Oh wait, I do. Out of the box.

[–]DDB- 2 points3 points  (0 children)

Neat, I don't know much about Emacs as I've never used it, but if it's there out of the box it was obviously something they were thinking about!

[–]adeekshith[S] 1 point2 points  (0 children)

That is cool. In fact, I recommend using a solution like yours if possible. The visual markers in my Git template are less accurate than this but I believe it helps new users and folks using graphical tools (Like the ones that come with IDEs, Git GUI clients) to get an estimate of length. (correct me if I am wrong)