I would like to get the default text width of 80 in vim, but if specific file types have their own text width (specifically gitcommit, where tw = 72), I would like vim to keep that width.
In my .vimrc, I have a line:
set tw=80
I also tried
setlocal tw=80
However, this seems to override the width of gitcommit 72.
If I delete the line, git will do the job fine (wrap in 72), but the text file (for example) will not be automatically wrapped.
Is it possible to trim vim to 80 if nothing is specified, but otherwise follow the instructions for a specific file type?
Aside, I think this worked until recently. I tried to remove everything else from my .virmrc, but set tw = 80, but that doesn't make any difference.
EDIT : if I open the git commit message editor and run
:verbose set tw?
vim displays:
textwidth=80 Last set from ~/.vimrc
source share