threads / discuss / 6481

commit message columns

Subject: commit message columns

## tl;dr

6 messages between Jan 22, 2007 and Jan 23, 2007.

replies: 5people: 5as markdown or json

J. Bruce Fields· Jan 22, 2007, 21:19 UTC · lore

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· Jan 22, 2007, 21:23 UTC · re: J. Bruce Fields · lore

Re: commit message columns

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
J. Bruce Fields· Jan 22, 2007, 21:44 UTC · re: Jimmy Tang · lore

Re: commit message columns

On Mon, Jan 22, 2007 at 09:23:04PM +0000, Jimmy Tang wrote:
Show 11 quoted lines
> 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.
Shawn O. Pearce· Jan 22, 2007, 21:23 UTC · re: J. Bruce Fields · lore

Re: commit message columns

"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.
Matthias Lederhofer· Jan 22, 2007, 22:19 UTC · re: J. Bruce Fields · lore

Re: commit message columns

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· Jan 23, 2007, 05:17 UTC · re: Matthias Lederhofer · lore

Re: commit message columns

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

← back to recent threads