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?
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With