# commit message columns

6 messages from 2007-01-22 to 2007-01-23. Participants: J. Bruce Fields, Shawn O. Pearce, Jimmy Tang, Matthias Lederhofer, Jeff King.
Thread: https://gitlist.dev/t/6481

## J. Bruce Fields, 2007-01-22 21:19

Subject: commit message columns
Message-ID: <20070122211902.GC6614@fieldses.org>
URL: https://gitlist.dev/e/20070122211902.GC6614%40fieldses.org

```
Uh, I feel like I must be missing something simple here--when editing
commit messages, you'd like the editor (vim in my case) to wrap text
sooner than it normally would, since commit messages are displayed
indented.  What's the easiest way to ensure this always happens?

--b.

```

## Jimmy Tang, 2007-01-22 21:23

Subject: Re: commit message columns
Message-ID: <20070122212304.GA17243@vual.tchpc.tcd.ie>
URL: https://gitlist.dev/e/20070122212304.GA17243%40vual.tchpc.tcd.ie
In-Reply-To: <20070122211902.GC6614@fieldses.org>

```
Hi,

On Mon, Jan 22, 2007 at 04:19:02PM -0500, J. Bruce Fields wrote:
> Uh, I feel like I must be missing something simple here--when editing
> commit messages, you'd like the editor (vim in my case) to wrap text
> sooner than it normally would, since commit messages are displayed
> indented.  What's the easiest way to ensure this always happens?

vim -c 'set tw=60'

where 60 is the column width. dont know how useful that is to you though


Jimmy.


-- 
Jimmy Tang
Trinity Centre for High Performance Computing,
Lloyd Building, Trinity College Dublin, Dublin 2, Ireland.
http://www.tchpc.tcd.ie/ | http://www.tchpc.tcd.ie/~jtang

```

## Shawn O. Pearce, 2007-01-22 21:23

Subject: Re: commit message columns
Message-ID: <20070122212359.GC29975@spearce.org>
URL: https://gitlist.dev/e/20070122212359.GC29975%40spearce.org
In-Reply-To: <20070122211902.GC6614@fieldses.org>

```
"J. Bruce Fields" <bfields@fieldses.org> wrote:
> Uh, I feel like I must be missing something simple here--when editing
> commit messages, you'd like the editor (vim in my case) to wrap text
> sooner than it normally would, since commit messages are displayed
> indented.  What's the easiest way to ensure this always happens?

<shameless-plug>
Use git-gui.  The message buffer window doesn't linewrap nor does
it scroll, so you learn to linewrap on your own.  :-)
</shameless-plug>

When I'm not in git-gui I use vile and have a macro in it to
pass the current paragraph of text through:

  fmt --crown-margin --width=70 --uniform-spacing

works reasonably well.

-- 
Shawn.

```

## J. Bruce Fields, 2007-01-22 21:44

Subject: Re: commit message columns
Message-ID: <20070122214419.GD6614@fieldses.org>
URL: https://gitlist.dev/e/20070122214419.GD6614%40fieldses.org
In-Reply-To: <20070122212304.GA17243@vual.tchpc.tcd.ie>

```
On Mon, Jan 22, 2007 at 09:23:04PM +0000, Jimmy Tang wrote:
> Hi,
> 
> On Mon, Jan 22, 2007 at 04:19:02PM -0500, J. Bruce Fields wrote:
> > Uh, I feel like I must be missing something simple here--when editing
> > commit messages, you'd like the editor (vim in my case) to wrap text
> > sooner than it normally would, since commit messages are displayed
> > indented.  What's the easiest way to ensure this always happens?
> 
> vim -c 'set tw=60'
> 
> where 60 is the column width. dont know how useful that is to you though

I was trying to figure out how to get that for git's invocations of vim,
but not all others.

But, come to think of it, maybe I'd rather have the textwidth just be 72
everywhere.

--b.

```

## Matthias Lederhofer, 2007-01-22 22:19

Subject: Re: commit message columns
Message-ID: <20070122221927.GA3746@moooo.ath.cx>
URL: https://gitlist.dev/e/20070122221927.GA3746%40moooo.ath.cx
In-Reply-To: <20070122211902.GC6614@fieldses.org>

```
J. Bruce Fields <bfields@fieldses.org> wrote:
> Uh, I feel like I must be missing something simple here--when editing
> commit messages, you'd like the editor (vim in my case) to wrap text
> sooner than it normally would, since commit messages are displayed
> indented.  What's the easiest way to ensure this always happens?

You could add this to your .vimrc:
> autocmd BufNewFile,BufRead .git/COMMIT_EDITMSG setlocal tw=60 ft=human
Has anyone a good filetype for this?

```

## Jeff King, 2007-01-23 05:17

Subject: Re: commit message columns
Message-ID: <20070123051720.GA24259@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20070123051720.GA24259%40coredump.intra.peff.net
In-Reply-To: <20070122221927.GA3746@moooo.ath.cx>

```
On Mon, Jan 22, 2007 at 11:19:27PM +0100, Matthias Lederhofer wrote:

> You could add this to your .vimrc:
> > autocmd BufNewFile,BufRead .git/COMMIT_EDITMSG setlocal tw=60 ft=human
> Has anyone a good filetype for this?

I do the same thing, but I use filetype=gitcommit. Then it picks up the
syntax highlighting file automatically (see contrib/vim).

-Peff

```
