Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set textwidth on hg commit messages?

Tags:

vim

mercurial

I use vim to write my Mercurial commit messages and I would like it to automatically wrap my text when it hits a specific limit, say 80 characters. My git setup already does this, but I'm not sure how to make hg behave in the same way.

How do you set the textwidth used in vim when writing hg commit messages?

like image 393
Cory Klein Avatar asked Feb 15 '23 02:02

Cory Klein


1 Answers

You can define the command to run when you do a commit by setting the editor option inside the [ui] section of your .hgrc config file. To set the textwidth in vim you could do:

[ui]
...
editor = vim -c ":set textwidth=80"
like image 125
David Levesque Avatar answered Feb 26 '23 09:02

David Levesque