Re: vim/signature help
On Mon, Apr 25, 2005 at 12:44:45AM -0500, Kyle Wheeler wrote:
I use vim as my $EDITOR, and I have the format-flowed message setup
working nicely (with fo+=aw and text_flowed="yes"). But my signature
lines all have a space at the end of them. Normally this isn't a
problem, but occasionally, the cursor will get down there (because of a
stray mouseclick or something) and vim will decide that that needs to be
wrapped --- because obviously, it's a line that ends in a space.
The only solution I've come up with so far is to hack the mutt source to
make it insert "--" rather than "-- " to separate signatures... but I
know that isn't correct according to the RFC.
Does anyone have a good way to handle this?
I've hacked up my vimrc to make it avoid wrapping lines for text_flowed
messages while I am editing the headers, which sometimes have spaces on
the end. Perhaps you can extend this to work for the signature as well.
It's not perfect, but it makes life easier for me. Here's an extract
from my .vimrc:
let MAIL_flowed = 0
function! s:flowed_context()
if g:MAIL_flowed
if getline(line(".")) =~ "^[-A-Za-z]*: "
set formatoptions-=aw
else
set formatoptions+=aw
endif
endif
endfunc
function! s:ft_mail()
set noai textwidth=72 expandtab
set updatetime=100
if &formatoptions =~# '\(w.*a\)\|\(a.*w\)'
let g:MAIL_flowed = 1
else
let g:MAIL_flowed = 0
endif
augroup Mail
au!
au CursorHold * call <SID>flowed_context()
augroup END
endfunc
au FileType mail call s:ft_mail()
--
Bob Bell <bbell@xxxxxxxxxxxxxxxxxxxxx>