Hi, I have made several modifications to my mail plugin for vim. It is available from vim online at:
http://vim.sourceforge.net/scripts/script.php?script_id=99 Below is a description with what it does. This plugin's purpose is helping with mail editing. It has two major roles. The first is email address retrievel and the second is added functionality while editing. Below is a description of the user callable functions in this plugin. Email address retrieval ======================= MailAliasList ------------- This routine is designed to run an external program, allow the user to select a bunch of emails, and then these emails are returned in a comma seperated list. For example, suppose the following line exists (the cursor is at the caret): To: ^ If the user hits '\al' then the currently configured program launches and the plugin will wait for the email list to be retrieved. At present, only Abook is supported in this manner. Patches are welcome. MailAliasQuery -------------- This routine is designed to take the <cword> under the cursor and do a lookup on it. This lookup should return a mutt email query, for example, given the following: To: john ^ If the user hits \aq, then the plugin will go out and attempt to lookup "john" in the current alias source. Currently, both abook and the mutt alias file are supported sources. Formatting ========== MailFormatQuote --------------- Format a quote segment using QuoteMotion1. MailFormatLine -------------- Formats the current line. MailFormatMerge --------------- Conjoins the current line with the previous line. MailFormatParagraph ------------------- Formats the current paragraph. Quote Manipulation ================== MailQuoteEraseSig ----------------- This routine will remove quoted signatures. It always operates over the entire email. % | No, I don't agree with you. % % Nonsense. You are wrong. Grow up. % % | I can't believe I'm even replying to this. % | -- % | Some power user % % Yeah, believe it, brother. % -- % Some other user will become: % | No, I don't agree with you. % % Nonsense. You are wrong. Grow up. % % | I can't believe I'm even replying to this. % % Yeah, believe it, brother. MailQuoteFixupSpaces -------------------- This will take a quote segment and try to put spaces in quote blocks where they don't currently exist. For example, >>% hello >> bob would turn into: > > % hello > > bob In normal mode the ranger to operate over comes from mail_quote_motion1. MailQuoteMangledMerge --------------------- This routine will try and make sense out of 'Mangled' quoted paragraph. For example, it will try and turn > > starting to look like a distro problem... Anyone > else > > having this problem running a different distro > besides > > LinuxBlast 8? Anyone tried 8.1 yet? into: > > starting to look like a distro problem... Anyone else > > having this problem running a different distro besides > > LinuxBlast 8? Anyone tried 8.1 yet? In normal mode this routine will operate over the current and next line. MailQuoteDelEmpty ----------------- This will search through the given range and attempt to delete all lines consisting of a quote block and optional white space. For example, % > yellow % > blue % > % yes will become: % > yellow % > blue % yes In normal mode this routine will operate over the entire email. MailQuoteRemoveDpth ------------------- This routine will try and decrease the quote depth of a quote segment by one. However, it will remove the last layer of quoting. This is because it is assumed that the user wants the oldest quote to be gone. For example, ab> % > I really ab> % > like ab> % > apples will become: ab> % I really ab> % like ab> % apples In normal mode the ranger to operate over comes from mail_quote_motion1. Quote Motions ============= A quote motion is a vim linewise motion that operates over quotes. The default motion character is 'q'. These motions are analogous to '$', 'E', and others. They allow the user to use operator commands over a quote range. For example, dq would allow the user to delete the current quote. This means that given: > % Hi <<< cursor on this line, > % How are you doing? > % Did you get over that STD? > Yeah, It only took a few months. And the user hits dq, the text will be transformed into: > Yeah, It only took a few months. Or if the user were to hit, dqq, the text would be transformed into: > % Hi How are you doing? Did you get over that STD? > Yeah, It only took a few months. To re-define the first or define the other two, use something like this: omap <silent> <unique> q <Plug>MailQuoteMotion1 omap <silent> <unique> Q <Plug>MailQuoteMotion2 omap <silent> <unique> x <Plug>MailQuoteMotion3 -- ~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~=-., \|/ (___) \|/ _,.-=~'`^` Brian Medley @~./'O o`\.~@ "Knowledge is Power" [EMAIL PROTECTED] /__( \___/ )__\ *PPPFFBT!* -- Francis Bacon `\__`U_/' _,.-=~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~= <____|' ^^`'~=-.,__,.-= ~`'^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-==--^'~=-.,__,.-=~'`^`