I am doing this with traditional vi, so I assume that it will work with vim as well.
In my .exrc, I have:
map ^_ !}fmt 71 72^M
(To enter ^_
by typing ctrl-V ctrl -_ and ^M
by typing ctrl-V ctrl-M
When I hit ctrl -_ in vi, it reformatts my current line to 72 characters.
ghoti source share