Re: Good .vimrc / for mutt
- To: mutt-users@xxxxxxxx
- Subject: Re: Good .vimrc / for mutt
- From: Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx>
- Date: Tue, 30 Oct 2007 12:17:25 -0500
- Comment: DomainKeys? See http://domainkeys.sourceforge.net/
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=memoryhole.net; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; q=dns/txt; s=default; bh=i6Ujg55dMiYOFxnyDi90Tnpg3lA=; b=e7oJQbfl9vEJhn/tUgcJxGyQfGbOeMaEoBrDUgkzs11UvEAk3xHgVuoW/3Nbk+tmRBqtqUncsbmnNPbi0jReuGWSSEFieWYoSYr2fE27KA8NQ3jGIb4veHCY6dL8VD8QZlqjLfbI51ZmEL8nKEXlZkQqh4G20NEL4K8OYVxSioU=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=memoryhole.net; b=CvTEChJV9Y4wsUn0FgF2yU7BP4cLXH+Z8dGYPCIdY9tNf1leCyEUwG2SEgVzOzgPwrfl5ca9+feK1E5+G8C8AxdG7LAXLvHriIzoAMKB/CMNH9hXHT9kXaXHRbr3yYP89u8XMssmDpwe188JaDBTaCbzqLzMeO416qsjnmDMKyA=; h=Received:Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent;
- In-reply-to: <6e7aafb90710300157gac30ce7m5789d2759eb886d9@xxxxxxxxxxxxxx>
- List-post: <mailto:mutt-users@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-users"
- Mail-followup-to: mutt-users@xxxxxxxx
- References: <6e7aafb90710300157gac30ce7m5789d2759eb886d9@xxxxxxxxxxxxxx>
- Sender: owner-mutt-users@xxxxxxxx
- User-agent: Mutt/1.5.16 (2007-09-19)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tuesday, October 30 at 02:27 PM, quoth Dilip M:
>1. How to delete the lines between '>' and chars. something like
>this,
>
>> > Hi, how are you.
>> > Send a report.
>
>Is there any function/macro used my anyone, which will fix this?
>Please share the same.
I use a little function of my own design:
autocmd FileType mail command! Fixq call Fixflowed()
function! Fixflowed()
" save position
let l = line(".")
let c = col(".")
normal G$
" whiles are used to avoid nasty error messages
" add spaces to the end of every line
while search('[^]> :]\n> \?\%(> \?\)*[^> ]','w') > 0
s/\([^]> :]\)\n\(> \?\%(> \?\)*[^> ]\)/\1 \r\2/g
endwhile
" make sure there's only one space at the end of every line
while search('^.\{-}\s\{2,}$','w') > 0
s/^\(.\{-}\)\s\{2,}$/\1 /g
endwhile
" now, fix the wockas spacing from the text
while search('^[> ]*>[^> ]','w') > 0
s/^\([> ]*>\)\([^> ]\)/\1 \2/
endwhile
" now, compress the wockas
while search('^>>*\s\+>>*\%( [^>]\)*', 'w') > 0
s/^\(>>*\)\s\+\(>>*\%( [^>]\)*\)/\1\2/
endwhile
" restore the original location, such as it is
execute l . " normal " . c . "|"
endfunction
You could, if you wanted, make that function trigger on BufRead, like
so:
autocmd BufRead */tmp/mutt-* call Fixflowed()
~Kyle
- --
The rule is, jam tomorrow and jam yesterday---but never jam today.
-- Lewis Carroll
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iD8DBQFHJ2clBkIOoMqOI14RAveiAKDy5jkJOELSlTLUHM2J7gav4SbAmQCgo16n
hcbawGcn69xNg8wSnjIDr5k=
=vmlV
-----END PGP SIGNATURE-----