Tuesday, April 30, 2013

vim, format=flowed and hanging indents

Is there a good way to configure vim to send format=flowed emails that include hanging indents.

My complete vimrc (for testing purposes) is:

set nocompatible
set fo+=awn
set tw=72
set ai

I'm typing something like:

1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam
posuere dui lorem, et condimentum nulla. Sed pharetra justo nec ante
fringilla non mattis nisi blandit. Donec molestie ligula dolor.
Nulla facilisi. Aliquam vel nulla elit, mollis facilisis metus. Sed
id eros a ante blandit convallis id sit amet elit. Duis malesuada
lobortis leo a placerat. Sed ut ipsum nisl. Sed pretium mauris vitae
velit sollicitudin iaculis.

vim adds a trailing space to each line except the last, per set fo+=w. It also adds spaces for the hanging indent. It looks great!

My mail client sets the format=flowed header. The result when this email is viewed in either Mail.app or mutt is not pretty:

1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam posuere dui lorem, et condimentum nulla. Sed pharetra justo nec ante fringilla non mattis nisi blandit. Donec molestie ligula dolor. Nulla facilisi. Aliquam vel nulla elit, mollis facilisis metus. Sed id eros a ante blandit convallis id sit amet elit. Duis malesuada lobortis leo a placerat. Sed ut ipsum nisl. Sed pretium mauris vitae velit sollicitudin iaculis.

In case my/your news client screws this up, all the lines have been correctly joined back together and the text reflows as expected when you resize the window. Fine. But there are 5 spaces between "Etiam" and "posuere" at all the other joins.

Is there a fix for this in vim? Or is this a limitation of the format=flowed spec? If so, how do other people handle this?

Mike

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment