I use mailmap files for some git repos. The lines in the files can be in one of these formats:
Proper Name <commit@email.xx>
<proper@email.xx> <commit@email.xx>
Proper Name <proper@email.xx> <commit@email.xx>
Proper Name <proper@email.xx> Commit Name <commit@email.xx>
I want to keep the lines formatted as a table with columns separated with 2 spaces, e.g.
Some Dude <some@dude.xx> <bugs@company.xx>
Other Author <other@author.xx> <bugs@company.xx>
Other Author <other@author.xx> <nick2@company.xx>
Santa Claus <santa.claus@northpole.xx> <me@company.xx>
How can I make Vim reformat a mailmap file this way on save (e.g. if a new name is too large for the column size)? I guess it's possible with an autocommand like this:
autocmd BufWritePre mailmap :<reformat_cmd>
but I'm not sure how to implement the actual command.