Proposal for a MacPorts'ish commit message template

Clemens Lang cal at macports.org
Wed Nov 2 16:07:14 PDT 2016


On Wed, Nov 02, 2016 at 05:46:16PM -0500, Ryan Schmidt wrote:
> Well, you mentioned vim. Very occasionally I use that. I don't
> remember seeing any particular syntax highlighting in it when editing
> a commit message.

You need syntax highlighting (:syntax on) and ideally color enabled.
Additionally, the filetype must be set to 'gitcommit' (:setfiletype
gitcommit). I have "syntax on" in my ~/.vimrc and the filetype is
automatically set when I get prompted for a git commit message. I don't
know how that happens.

To enforce a certain textwidth, you can just :set textwidth=72. Text
typed after you set this will automatically wrap. Other text can be
reflowed, for example by selecting it in visual mode (shift+v) and
pressing gq.

> Usually I use TextWrangler or TextMate.

TextMate has a file type for git commit messages. Unfortunately, it only
seems to highlight overlong summary lines and nothing else (e.g. it does
not warn you about text in the second line). You can get a wrap column
in TextMate using View > Show Wrap Column and set the position of the
line in View > Wrap Column...

I do not know TextWrangler.

-- 
Clemens


More information about the macports-dev mailing list