Vim and email quoting

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Vim and email quoting

Timothy Knox
I use vim to write my outgoing email, and for the most part, it rocks. Thanks to
all the folks who have written modules and provided tips that make it the best
thing for writing email since mailx <grin>.

That said, there is one small annoyance I find: When replying to an email, I
like to intersperse the original email with my commentary. When I am on the last
line of a paragraph I wish to respond to, I hit "o" to open a new line. All well
and good, save that something recognises the leading "> " of the previous
paragraph, and adds one to my new line. Can somebody tell me how to make it
stop? ;-)

Many thanks to you all. :-)

--
Timothy Knox  <mailto:[hidden email]>
I have always wished that my computer would be as easy to use as my telephone.
My wish has come true. I no longer know how to use my telephone.
    -- Bjarne Stroustrup, creator of the C++ programming language
Reply | Threaded
Open this post in threaded view
|

Re: Vim and email quoting

Andy Wokula
Timothy Knox schrieb:

> I use vim to write my outgoing email, and for the most part, it rocks. Thanks to
> all the folks who have written modules and provided tips that make it the best
> thing for writing email since mailx <grin>.
>
> That said, there is one small annoyance I find: When replying to an email, I
> like to intersperse the original email with my commentary. When I am on the last
> line of a paragraph I wish to respond to, I hit "o" to open a new line. All well
> and good, save that something recognises the leading "> " of the previous
> paragraph, and adds one to my new line. Can somebody tell me how to make it
> stop? ;-)
>
> Many thanks to you all. :-)

Add the following line to ~/.vim/after/ftplugin/mail.vim :

    setlocal fo-=o

Create the path or file if it doesn't exist.

--
Regards,
Andy

EOM
Reply | Threaded
Open this post in threaded view
|

Re: Vim and email quoting

Timothy Knox
Somewhere on Shadow Earth, at Fri, May 11, 2007 at 09:37:05PM +0200, Andy Wokula wrote:

> Timothy Knox schrieb:
> >I use vim to write my outgoing email, and for the most part, it rocks.
> >Thanks to
> >all the folks who have written modules and provided tips that make it the
> >best
> >thing for writing email since mailx <grin>.
> >
> >That said, there is one small annoyance I find: When replying to an email,
> >I
> >like to intersperse the original email with my commentary. When I am on
> >the last
> >line of a paragraph I wish to respond to, I hit "o" to open a new line.
> >All well
> >and good, save that something recognises the leading "> " of the previous
> >paragraph, and adds one to my new line. Can somebody tell me how to make it
> >stop? ;-)
> >
> >Many thanks to you all. :-)
>
> Add the following line to ~/.vim/after/ftplugin/mail.vim :
>
>    setlocal fo-=o
>
> Create the path or file if it doesn't exist.

Thanks, Andy, and thanks to those who responded offlist, especially Alan Isaac,
whose aimail.vim is filled with neat stuff to plunder.

--
Timothy Knox  <mailto:[hidden email]>
I have always wished that my computer would be as easy to use as my telephone.
My wish has come true. I no longer know how to use my telephone.
    -- Bjarne Stroustrup, creator of the C++ programming language
Reply | Threaded
Open this post in threaded view
|

Re: Vim and email quoting

Troy Piggins-2
In reply to this post by Timothy Knox
* Timothy Knox is quoted & my replies are inline below :
> I use vim to write my outgoing email, and for the most part, it
> rocks. Thanks to all the folks who have written modules and
> provided tips that make it the best thing for writing email
> since mailx <grin>.

What tips/scripts are you using and what are your favourites?

> That said, there is one small annoyance I find: When replying
> to an email, I like to intersperse the original email with my
> commentary. When I am on the last line of a paragraph I wish to
> respond to, I hit "o" to open a new line. All well and good,
> save that something recognises the leading "> " of the previous
> paragraph, and adds one to my new line. Can somebody tell me
> how to make it stop? ;-)

I see you have already solved this.

--
Troy Piggins | http://piggo.com/~troy         __   ___          
RLU#415538                                    \ \ / (_)_ __     ,-O   (o-    O
                                               \ V /| | '  \   O   )  //\     O
Vim 7.0.22                                      \_/ |_|_|_|_|   `-O   V_/_  OOO
Reply | Threaded
Open this post in threaded view
|

Re: Vim and email quoting

fREW Schmidt
On 5/12/07, Troy Piggins <[hidden email]> wrote:
> * Timothy Knox is quoted & my replies are inline below :
> > I use vim to write my outgoing email, and for the most part, it
> > rocks. Thanks to all the folks who have written modules and
> > provided tips that make it the best thing for writing email
> > since mailx <grin>.
>
> What tips/scripts are you using and what are your favourites?

Yeah, I am interested as well.  What do you use to do all of this?

-fREW
Reply | Threaded
Open this post in threaded view
|

Re: Vim and email quoting

Benjamin Esham
fREW wrote:

> On 5/12/07, Troy Piggins <[hidden email]> wrote:
>
>> * Timothy Knox is quoted & my replies are inline below :
>>
>>> I use vim to write my outgoing email, and for the most part, it
>>> rocks. Thanks to all the folks who have written modules and
>>> provided tips that make it the best thing for writing email
>>> since mailx <grin>.
>>
>> What tips/scripts are you using and what are your favourites?
>
> Yeah, I am interested as well.  What do you use to do all of this?

I use the non-Vim-friendly Apple Mail for my e-mail, but I use pan  
and Vim for Usenet; here is the function that's called whenever I set  
filetype=usenet:

" :: set us up for usenet-article editing
function! UsenetSetup()
     setl textwidth=75                " wrap at 75 columns
     setl comments=n:>,n:\|,n:%       " recognize [>|%] as quote  
indicators
     setl formatoptions=qn            " allow formatting with 'gq';  
recognize lists (q.v.)
     " the unholy mess on the next line recognizes lists with "1.",  
"-", and "*" as bullets,
     setl flp=^\\(\\d\\+[.\\t\ ]\\\|[-*•]\ \\\|\ \ \\)\\s*    " and  
also recognizes two-space blockquoting
     setl expandtab                   " use spaces instead of tabs  
(eugh)

     nmap <Leader>s :call InsertSpoilerSpace()<CR>
     nmap <Leader>f :call FormatUsenetParagraph()<CR>
     " insert a randomly-chosen signature and turn on spell checking
     nmap <Leader>g :r !~/.vim/usenet/sig.pl ~/.vim/usenet/
sigs<CR>:setl spell<CR>

     setl encoding=utf-8
     setl fileencoding=utf-8
endfunction

function! FormatUsenetParagraph()
     sil '{,'}s/\%(^[|>% \t]*\)\@<=\([|>%]\)\s*/\1 /ge
     normal gqip
endfunction

The second function does a beautiful job of reflowing paragraphs to  
take up the entire textwidth; it was devised by Peppe on  
comp.editors.  (If anyone has questions about how any of this works,  
please ask!)

HTH,
--
Benjamin D. Esham
[hidden email]  |  AIM: bdesham128  |  Jabber: same as e-mail
Esperanto, the international language  ☆  http://www.lernu.net


Reply | Threaded
Open this post in threaded view
|

Re: Vim and email quoting

Suresh Govindachar`
  Benjamin Esham wrote:
 > fREW wrote:
 
 >> On 5/12/07, Troy Piggins <[hidden email]> wrote:
 >>
 >>> * Timothy Knox is quoted & my replies are inline below :
 >>>
 >>>> I use vim to write my outgoing email, and for the most part, it
 >>>> rocks. Thanks to all the folks who have written modules and
 >>>> provided tips that make it the best thing for writing email
 >>>> since mailx <grin>.
 >>>
 >>> What tips/scripts are you using and what are your favourites?
 >>
 >> Yeah, I am interested as well.  What do you use to do all of this?
 >
 > I use the non-Vim-friendly Apple Mail for my e-mail, but I use pan  
 > and Vim for Usenet; here is the function that's called whenever I set  
 > filetype=usenet:
 >
 > " :: set us up for usenet-article editing
 > function! UsenetSetup()
 >      setl textwidth=75                " wrap at 75 columns
 >      setl comments=n:>,n:\|,n:%       " recognize [>|%] as quote  
 > indicators
 >      setl formatoptions=qn            " allow formatting with 'gq';  
 > recognize lists (q.v.)
 >      " the unholy mess on the next line recognizes lists with "1.",  
 > "-", and "*" as bullets,
 >      setl flp=^\\(\\d\\+[.\\t\ ]\\\|[-*•]\ \\\|\ \ \\)\\s*    " and  
 > also recognizes two-space blockquoting
 >      setl expandtab                   " use spaces instead of tabs  
 > (eugh)
 >
 >      nmap <Leader>s :call InsertSpoilerSpace()<CR>
 >      nmap <Leader>f :call FormatUsenetParagraph()<CR>
 >      " insert a randomly-chosen signature and turn on spell checking
 >      nmap <Leader>g :r !~/.vim/usenet/sig.pl ~/.vim/usenet/
 > sigs<CR>:setl spell<CR>
 >
 >      setl encoding=utf-8
 >      setl fileencoding=utf-8
 > endfunction
 >
 > function! FormatUsenetParagraph()
 >      sil '{,'}s/\%(^[|>% \t]*\)\@<=\([|>%]\)\s*/\1 /ge
 >      normal gqip
 > endfunction
 >
 > The second function does a beautiful job of reflowing
 > paragraphs to  take up the entire textwidth; it was
 > devised by Peppe on  comp.editors.  (If anyone has
 > questions about how any of this works,  please ask!)
   
 Please explain FormatUsenetParagraph().
 Also, where is InsertSpoilerSpace()?

 Thanks,

 --Suresh
 
Reply | Threaded
Open this post in threaded view
|

Re: Vim and email quoting

Benjamin Esham
Suresh Govindachar wrote:

>   Benjamin Esham wrote:
>
>> I use the non-Vim-friendly Apple Mail for my e-mail, but I use pan
>> and Vim for Usenet; here is the function that's called whenever I set
>> filetype=usenet:
>>
>> [snip]
>>
>> The second function does a beautiful job of reflowing
>> paragraphs to  take up the entire textwidth; it was
>> devised by Peppe on  comp.editors.  (If anyone has
>> questions about how any of this works,  please ask!)
>
>  Please explain FormatUsenetParagraph().

See <http://groups.google.com/group/comp.editors/browse_thread/thread/ 
a382470b98eb4671/2f6728e3d24a5d11?#2f6728e3d24a5d11>; there's a fair  
amount of discussion and dissection there.

>  Also, where is InsertSpoilerSpace()?

Sorry for the omission.  Here it is:

function! InsertSpoilerSpace()
     call append(0, ["Spoiler Space (24 lines)", ""])
     let @a = 22
     while @a >= 2
         call append(24 - @a, [getreg("a"), ""])
         let @a = @a - 2
     endwhile
endfunction

This inserts numbers that count down the number of lines of spoiler  
space left.  Apparently this is helpful for people who use screen  
readers.

HTH,
--
Benjamin D. Esham
[hidden email]  |  AIM: bdesham128  |  Jabber: same as e-mail
Esperanto, the international language  ☆  http://www.lernu.net